Commit graph

62554 commits

Author SHA1 Message Date
Liav A.
79d9abd3cc Kernel: Create coredump by using the crashed process VFS root context
Resolve a regression caused by 01e1af732b.

This unbreaks coredump generation, because we need to use the VFS root
context of the crashed process and not of the FinalizerTask, as it will
hold an empty VFS root context that is assigned to kernel processes.
2024-08-10 10:14:37 -04:00
doctor-rd
2a8032bc68 Meta: Remove /mod
This directory was introduced with
commit a43b115a6c
and is no longer needed.
2024-08-10 10:13:52 -04:00
EWouters
48f578a898 Ports/git: Update to version 2.46.0 2024-08-10 10:10:55 -04:00
EWouters
54b6c3cbc5 Ports/bison: Update to version 3.8.2 2024-08-10 10:10:55 -04:00
EWouters
d8d5691f7d Ports/ca-certificates: Update to version 2024-07-02 2024-08-10 10:10:55 -04:00
EWouters
5f661ba571 Ports/bash: Update to version 5.2.32 2024-08-10 10:10:55 -04:00
EWouters
126b2e638e Ports/curl: Update to version 8.9.1 2024-08-10 10:10:55 -04:00
EWouters
00afd803fd Ports/pcre2: Update to version 10.44 2024-08-10 10:10:55 -04:00
EWouters
724b3f4c36 Ports/ncurses: Update to version 6.5 2024-08-10 10:10:55 -04:00
Hendiadyoin1
832b5ff603 AK: Add simd_cast<T> and replace to_TxN with it 2024-08-08 22:43:53 -04:00
brody-qq
e0242abf93 Tests/Kernel: Add test for Ext2FS reads and writes
This commit adds a new test case which carries out the following steps:
* write() to a block of an ext2 file, verify the write() was successful
* read() the same block back, verify the read() was successful
* verify that the data from the read() is identical to the data that was
  written in the write()

The test runs the above steps on the following blocks of an ext2 file:
* the first and last direct blocks
* the first and last singly indirect blocks
* the first and last doubly indirect blocks
* the first and last triply indirect blocks
2024-08-08 19:04:04 -04:00
Sönke Holz
c247aac15e Meta: Add ahci option to SERENITY_BOOT_DRIVE 2024-08-07 18:30:06 -04:00
Sönke Holz
bb9aa6c7c6 Meta: Allow choosing between UHCI and xHCI HCs for USB storage in run.py 2024-08-07 18:30:06 -04:00
Sönke Holz
c7903e30f4 Meta: Combine boot drive environment variables into SERENITY_BOOT_DRIVE
This allows you to simply use e.g. SERENITY_BOOT_DRIVE=usb instead of
setting SERENITY_NVME_ENABLE=0 and SERENITY_USE_USBDRIVE=1.
2024-08-07 18:30:06 -04:00
Sönke Holz
f2d3202e1d Meta: Remove unnecessary sdhci-pci devices from run.py
This allows us to have a more stable device address "root=sd0:0:0" for
SERENITY_USE_SDCARD.
2024-08-07 18:30:06 -04:00
Sönke Holz
de3e864a80 Meta: Remove microvm machine type from run.py
Running in the microvm doesn't work anymore, since we removed IDE
support. Currently, we only support PCI(e)-attached storage devices,
which are not compatible with the microvm, as it doesn't support PCI(e)
at all.
2024-08-07 18:30:06 -04:00
Sönke Holz
4c307e9073 Meta: Remove bochsrc
Running in bochs was broken at least since the removal of IDE support.
2024-08-07 18:30:06 -04:00
Sönke Holz
6a195b6616 Kernel/USB: Add support for xHCI bulk transfers
Bulk transfers also use Normal TRBs, so move the reusable normal TRB
setup code from submit_async_interrupt_transfer into a new function
prepare_normal_transfer.

submit_bulk_transfer and submit_async_interrupt_transfer use this
function and then either block on the completion or submit it
asynchronously and wrap it into a PeriodicPendingTransfer.
2024-08-07 18:30:06 -04:00
Sönke Holz
d82148aae1 Kernel/USB: Don't truncate the max packet size in the MassStorage driver 2024-08-07 18:30:06 -04:00
Nico Weber
cf8210175f LibGfx/PNGWriter: Inline the now not very useful append(u8)
No behavior change.
2024-08-06 23:00:32 -04:00
Nico Weber
781a39e613 LibGfx/PNGWriter: Use SIMD for PNG score calculation
Produces exactly the same output, but a bit faster.

The speedup is relatively bigger for worse compression:

    image -o sunset_retro.png sunset_retro.bmp --png-compression-level 0
       56.8 ms ±  1.5 ms ->  34.8 ms ± 0.9 ms (38.7% faster)

    image -o sunset_retro.png sunset_retro.bmp --png-compression-level 1
       84.6 ms ±  1.7 ms ->  64.2 ms ± 4.9 ms (24.1% faster)

    image -o sunset_retro.png sunset_retro.bmp --png-compression-level 2
      212.1 ms ±  2.5 ms -> 190.3 ms ± 1.6 ms (10.3% faster)

    image -o sunset_retro.png sunset_retro.bmp --png-compression-level 3
      671.4 ms ± 12.3 ms -> 646.5 ms ± 4.7 ms (3.7% faster)

Compression level 2 is the default, so about a 10% speedup in practice.

For comparison, `sips` needs 49.9 ms ± 3.0 ms to convert
sunset_retro.bmp to sunset_retro.png, and judging from the output file
size, it uses something similar to our compression level 1.
We used to take 1.7x as long as sips, now we take 1.29x as long.
2024-08-06 23:00:32 -04:00
Nico Weber
34a4d16776 AK: Add AK::SIMD::to_i8x4() 2024-08-06 23:00:32 -04:00
Dennis Camera
b367479d00 AK: Fix {:c} formatter for big-endian 2024-08-06 23:03:10 +02:00
Ali Mohammad Pur
0b54579173 RequestServer: Make the ThreadPool global
Previously we made one thread pool per ipc client, which is excessive
and can eat up all the available fds very fast.

This is a manual port of commit 18499c4eac301db7e8915284f33766ca96cdeef2
from Ladybird.
2024-08-06 15:37:37 +02:00
Alec Murphy
041243c97a Presenter: Modify CSS to hide scrollbars
This PR modifies the style for the `slide` class generated in
`Presentation::render()` to hide the scrollbars.
2024-08-05 14:40:37 -04:00
Nico Weber
efc6f8d7b7 Toolchain: Remove dependency on grealpath from BuildClang.sh
Regular `realpath` seems to work fine.

This removes the last coreutils dependency from BuildClang.sh.
It can now run on a system that has just ninja and cmake and Xcode
installed.

No intended behavior change.
2024-08-04 22:42:43 +02:00
Nico Weber
d8cf885f89 Toolchain: Remove dependency on install from BuildClang.sh
Less code, and makes it easier to run this script on vanilla macOS.

No intended behavior change.
2024-08-04 22:42:43 +02:00
sdomi
7b65200b72 Ports/SDL2: Upgrade to 2.30.5
Co-Authored-By: EWouters <6179932+EWouters@users.noreply.github.com>
2024-08-04 16:42:32 -04:00
sdomi
05d0a03768 Ports/SuperTuxKart: Fix building on Clang
Removed redundant link flags from CXXFLAGS, which was necessary due to
clang treating them as errors. Additionally, removed legacy include
paths.
2024-08-04 11:11:18 -04:00
sdomi
4db8a0b964 Toolchain: Fix default library paths when building with clang
When building with the GNU toolchain, /usr/local/lib and
/usr/local/include are among the default search paths for the compiler
and linker. It seems that this is not the case for Clang/LLVM, and thus
some packages fail to build, while others silently drop optional deps.

This commit adds those paths back, fixing multiple packages at once.
Additionally, it removes legacy -I/-L includes in various Ports which
are no longer needed.

Co-Authored-By: Nico Weber <thakis@chromium.org>
2024-08-04 11:09:53 -04:00
Liav A.
cb10f70394 Kernel: Change internal handling of filesystem-specific options
Instead of using a raw `KBuffer` and letting each implementation to
populating the specific flags on its own, we change things so we only
let each FileSystem implementation to validate the flag and its value
but then store it in a HashMap which its key is the flag name and
the value is a special new class called `FileSystemSpecificOption`
which wraps around `AK::Variant<...>`.

This approach has multiple advantages over the previous:
- It allows runtime inspection of what the user has set on a `MountFile`
  description for a specific filesystem.
- It ensures accidental overriding of filesystem specific option that
  was already set is not possible
- It removes ugly casting of a `KBuffer` contents to a strongly-typed
  values. Instead, a strongly-typed `AK::Variant` is used which ensures
  we always get a value without doing any casting.

Please note that we have removed support for ASCII string-oriented flags
as there were no actual use cases, and supporting such type would make
`FileSystemSpecificOption` more complicated unnecessarily for now.
2024-08-03 20:35:06 +02:00
Sergey Lisov
f439f02083 LibELF: Fix incorrect treatment of DT_REL&DT_RELA
In the current code, these are treated as if they were a bitmap. They
are not, and (DT_REL & DT_RELA) is actually nonzero. This causes the
linker to treat all sections as having addends, which is not correct.
2024-08-03 19:33:42 +02:00
Linus Groh
6b4c300353 Ports: Update Python to 3.12.4
Released on 2024-06-06.
https://www.python.org/downloads/release/python-3124/
2024-08-02 23:06:23 -04:00
Andreas Kling
8a7d9a7b68 ImageDecoder: Pass decoded images as Gfx::Bitmap over IPC
Before this change, we were passing them as Gfx::ShareableBitmap. The
problem is that shareable bitmaps keep their underlying file descriptor
open, so that they can be shared again with someone else.

When a Gfx::Bitmap is decoded from an IPC message, the file descriptor
is closed and recovered immediately.

This fixes an issue where we'd accumulate one file descriptor for every
image decoded. This eventually led to descriptor starvation after enough
images were loaded and still referenced at the same time.

(cherry picked from commit 166e603c5eb0a103eea148baf97a075fe5fea964)
2024-08-02 09:04:13 -04:00
Andreas Kling
1270daca0e LibGfx: Add ability to pass NonnullRefPtr<Gfx::Bitmap> over IPC
(cherry picked from commit 9f1a853cc83a08ece3fa949a637c8b9f1bbb142c;
amended to also serialize scale factor)
2024-08-02 09:04:13 -04:00
Aliaksandr Kalenik
7a88c19975 LibGfx: Add release callback for Bitmap
In upcoming changes, bitmap is going to be used to wrap the memory of
the IOSurface, and we will want to release the corresponding IOSurface
along with the bitmap.

(cherry picked from commit 3110411c60f0c5f9860ba9de4d229e246afadb62;
amended to fix trivial conflicts arising from serenityos still having an
`intrinsic_scale` argument that ladybird removed. We don't need this
commit for IOSurfaces, but for the use added in
LadybirdBrowser/ladybird#688)
2024-08-02 09:04:13 -04:00
sideshowbarker
38ea81c312 LibGfx: Handle UTF-16-encoded OpenType font names
This change makes OpenType::Name::string_for_id handle fonts whose names
are UTF-16-encoded (along with handling UTF-8-encoded names).

Otherwise, without this change, the existing code assumes the names are
UTF-8-encoded, fails gracelessly if they’re not, and crashes.

Fixes https://github.com/LadybirdBrowser/ladybird/issues/75

(cherry picked from commit 1a9dabe5ff443315a1e3e9c577f93936e6dd45dc)
2024-08-02 08:52:26 -04:00
sdomi
e8bfd9ea4c Ports/libpng: Upgrade to 1.6.43 2024-08-02 08:47:34 -04:00
Ralf Donau
d369ec2f03 Maps: Use Config::pledge_domain() 2024-08-02 08:46:48 -04:00
Ralf Donau
e182bcd9ff MapsSettings: Use Config::pledge_domain() 2024-08-02 08:46:48 -04:00
gouchi
ac0e71c8ac Ports: Update RetroArch to version 1.19.1
Update AvailablePorts.md
2024-08-01 16:27:58 -07:00
sdomi
9351ba8568 Ports/aria2: Upgrade to 1.37.0
This fixes building with clang.
2024-08-01 16:19:00 -07:00
sdomi
c0f58505bc Ports/harfbuzz: Upgrade to 9.0.0
This fixes building with clang.
2024-08-01 16:18:38 -07:00
Sönke Holz
ad64243bb9 Kernel/x86: Properly restore rflags in the syscall handler
The sysret instruction restores the rflags value from the r11 register.
Before, we expected that the value in RegisterState::r11 is still the
rflags value saved by syscall and therefore didn't copy
RegisterState::rflags to r11 before the sysret.

But signal handlers and ptrace can change the value in
RegisterState::r11 while we are handling a syscall, so we shouldn't
assume that it still contains the saved rflags.
While handling a syscall the contents of RegisterState::rflags may also
have been updated by e.g. ptrace in which case we should restore the
updated rflags, not the original state on syscall entry.
2024-08-01 22:08:08 +02:00
doctor-rd
3e20c7bbc0 Terminal: Remove unveiling portal/config 2024-08-01 12:07:02 -07:00
Andrew Kaster
a0bc09af85 LibThreading: Guard closing the background thread on the thread existing
This prevents a crash in ImageDecoder when it's closed before any
image decoding requests have been made.

(cherry picked from commit 88176d4be2339108d9d54b8af62f5438f9c82f30)
2024-08-01 12:06:30 -07:00
randomusername-a
8ee652bc7c ImageViewer: Call clear() in the ViewWidget before loading a new image
We need to do this to stop the animation timer and delete the current
animation, otherwise the new image will be shown only for a moment
before the previous animation continues.
2024-08-01 12:06:13 -07:00
Sönke Holz
640530dbed Kernel/PCI: Handle 64-bit MSI-X BARs
PCI::get_BAR just returns the raw BAR value and doesn't handle 64-bit
BARs.
2024-08-01 12:05:56 -07:00
Nico Weber
28af4aa4ff LibGfx/PNGWriter: Change default PNG compression level to Default
The numbers in the previous commit show that going from n = 2 to
n = 3 comes with a big cost in runtime (3-4 times as long) for a
very modest to modest size win (0.5% to 2.5%). The jumps from n = 0
to n = 1 and from n = 1 to n = 2 look much more reasonable.

If image size is the main concern, webp is a better option now.
If PNG size is a big concern, recompressing with something like
zopflipng is currently still necessary anyways.

All in all, I think Default is the better default compression level now.

This effectively reverts #14738.

Affects PNGs written by all apps in the system (PixelPaint, Mandelbrot,
LibWeb's HTMLCanvasElement png serialization, LibWeb's screenshot
feature, `shot`, SpiceAgent, Magnify, `pdf` output, `image` without
--png-compression-level flag).
2024-07-31 18:39:08 -07:00
Nico Weber
fd6142eba4 LibGfx/PNGWriter: Only store alpha channel if it's used
Using the same two benchmarks as in the previous commit:

1.

    n |               time |   size
    --+--------------------+--------
    0 |  56.5 ms ±  0.9 ms | 2.3M
    1 |  88.2 ms ± 14.0 ms |   962K
    2 | 214.8 ms ±  5.6 ms |   908K
    3 | 670.8 ms ±  3.6 ms |   903K

Compared to the numbers in the previous commit:

    n = 0: 17.3% faster, 23.3% smaller
    n = 1: 12.9% faster, 12.5% smaller
    n = 2, 24.9% faster,  9.2% smaller
    n = 3: 49.6% faster,  9.6% smaller

For comparison,
`sips -s format png -o sunset_retro_sips.png sunset_retro.bmp` writes
a 1.1M file (i.e. it always writes RGBA, not RGB when not necessary),
and it needs 49.9 ms ± 3.0 ms for that (also using a .bmp input). So
our output file size is competitive! We have to get a bit faster though.

For another comparison, `image -o sunset_retro.webp sunset_retro.bmp`
writes a 730K file and needs 32.1 ms ± 0.7 ms for that.

2.

    n |         time | size
    --+----------------+------
    0 | 11.334 total | 390M
    1 | 13.640 total |  83M
    2 | 15.642 total |  73M
    3 | 48.643 total |  71M

Compared to the numbers in the previous commit:

    n = 0: 15.8% faster, 25.0% smaller
    n = 1: 15.5% faster,  7.7% smaller
    n = 2: 24.0% faster,  5.2% smaller
    n = 3: 29.2% faster,  5.3% smaller

So a relatively bigger speed win for higher levels, and
a bigger size win for lower levels.

Also, the size at n = 2 with this change is now lower than it
was at n = 3 previously.
2024-07-31 18:39:08 -07:00