Commit Graph

61283 Commits

Author SHA1 Message Date
Liav A
a5e2694ebf DynamicLoader: Add an option to dry-run an ELF exectuable
This option is useful for measuring time of dynamic linking and
profiling the DynamicLoader itself.
2024-05-14 15:42:42 -06:00
Liav A
8fc1f470ef DynamicLoader: Add standard argument parsing for executing ELF binaries
This change essentially puts the DynamicLoader with 2 roles - the first
one is to be invoked by the kernel to dynamically link an ELF executable
in runtime.

The second role is to allow running ELF executables explicitly from
userspace so the kernel runs the DynamicLoader as the "intended" program
but now the DynamicLoader can do its own commandline argument parsing
and run a specified binary, with future options being possible to
implement easily.
2024-05-14 15:42:42 -06:00
Liav A
7e8dfe758c LibCore: Add a small library with only ArgsParser for DynamicLoader
This will be used in the DynamicLoader code, as it can't do syscalls via
LibCore code.
Because we can't use most of the LibCore code, we convert the versioning
code in Version.cpp to use LibC uname() function.
2024-05-14 15:42:42 -06:00
Liav A.
5f3ef1aa9e Kernel: Remove includes of PCI API.h file
This file will be removed in a future commit, so let's get rid of what
we can right now.
2024-05-14 15:42:29 -06:00
Liav A.
e1d435d0b0 Kernel/x86_64: Rename PCI HostBridge => PIIX4HostBridge
This code is actually for the old PIIX4 PCI host bridge, which requires
to use legacy x86 IO instructions.
2024-05-14 15:42:29 -06:00
Liav A.
69a3602237 Kernel/GPU: Rename GenericGraphicsAdapter => GPUDevice
GenericGraphicsAdapter is mouthful. Also, the idea is to move towards a
more advanced subsystem that handles GPUs, not merely graphics adapters.
2024-05-14 15:42:29 -06:00
Liav A
6014ce0552 Kernel/PCI: Add small access spinlock to each HostController
Prepare to remove biglock on PCI::Access in a future commit, so we can
ensure we only lock a spinlock on a precise PCI HostController if needed
instead of the entire subsystem.
2024-05-14 15:42:29 -06:00
Liav A.
0bab9a9313 Kernel: Move VirtIO RNG implementation to the Security/Random directory 2024-05-14 15:42:29 -06:00
Liav A.
bbb749ab47 Kernel: Move VirtIO console code to the Devices/Serial/VirtIO directory 2024-05-14 15:42:29 -06:00
Liav A.
cb558f4459 Kernel/Devices: Remove SerialDevice::initialize method
We can just do the initialization sequence in the constructor.
2024-05-14 15:42:29 -06:00
Liav A.
b4c218168f Kernel/Storage: Remove StorageController reset and shutdown methods
We never used these virtual methods outside their own implementation,
so let's stop pretending that we should be able to utilize this for
unknown purpose.
2024-05-14 15:42:29 -06:00
Liav A.
eadf2bf29f Kernel/Devices: Remove UNMAP_AFTER_INIT from SerialDevice code 2024-05-14 15:42:29 -06:00
Liav A.
136d5b12d5 Kernel/VirtIO: Remove stale detect method 2024-05-14 15:42:29 -06:00
Liav A.
d73c82d746 Kernel: Remove UNMAP_AFTER_INIT from VGA text mode console 2024-05-14 15:42:29 -06:00
Liav A
d068af89d5 Kernel/x86: Bake the Prekernel and the Kernel into one image
The new baked image is a Prekernel and a Kernel baked together now, so
essentially we no longer need to pass the Prekernel as -kernel and the
actual kernel image as -initrd to QEMU, leaving the option to pass an
actual initrd or initramfs module later on with multiboot.
2024-05-14 23:37:38 +02:00
implicitfield
90a46cdc98 Ports: Add libfuse
This is essentially the de facto way to interface with FUSE, and as
such, pretty much every port that uses FUSE in any way will depend on
this. Of all the examples that we compile, 'hello', 'hello_ll' and
'passthrough' have been verified to work.
2024-05-14 22:30:39 +02:00
implicitfield
c44a8fa57c LibC: Implement mkfifoat(2) 2024-05-14 22:30:39 +02:00
implicitfield
4574a8c334 Kernel+LibC+LibCore: Implement mknodat(2) 2024-05-14 22:30:39 +02:00
implicitfield
05cf1327ed Kernel: Make utimensat ignore the dirfd when given an absolute path 2024-05-14 22:30:39 +02:00
Xexxa
bda914868b Base: Add more emoji
🫩 - U+1FAE9 FACE WITH BAGS UNDER EYES
🫟 - U+1FADF SPLATTER
🪉 - U+1FA89 HARP
🫆 - U+1FAC6 FINGERPRINT
🫜 - U+1FADC ROOT VEGETABLE
🪾 - U+1FABE LEAFLESS TREE
🪏 - U+1FA8F SHOVEL
🇨🇶 - U+1F1E8_U+1F1F6 CQ SARK
2024-05-14 16:16:20 -04:00
Sönke Holz
53a1c25638 LibCoredump: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Sönke Holz
3059ac71f3 HackStudio: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Sönke Holz
fe12a413a1 Kernel: Use AK::unwind_stack_from_frame_pointer 2024-05-14 14:02:06 -06:00
Sönke Holz
b6cc95c38e AK: Add a function for frame pointer-based stack unwinding
Instead of duplicating stack unwinding code everywhere, introduce a new
AK helper to unwind the stack in a generic way.
2024-05-14 14:02:06 -06:00
Kristoffer Ellersgaard Koch
aa3e13b707 nix-shell: Disable gcc hardening to be able to build toolchain
Currently, if building under `nix-shell Toolchain`, serenityOS'
gcc won't build because of hardening options added in nix,
more specifically the breaking format-security.
2024-05-14 13:57:25 -06:00
ptrcnull
13e44ab035 AK: Add stack size fixup for musl libc
Fixes #16681
2024-05-14 13:56:45 -06:00
Andreas Kling
ce7c925924 LibJS/Bytecode: Allow assignment expression to write directly to locals 2024-05-14 21:46:36 +02:00
Andreas Kling
d22a06d671 LibJS/Bytecode: Remove all the unreachable execute_impl() functions
There are no calls to these anywhere anymore.
2024-05-14 21:46:36 +02:00
Andreas Kling
6ca94bd0b1 LibJS/Bytecode: Rename GetVariable => GetBinding 2024-05-14 21:46:36 +02:00
Andreas Kling
b7c04f999a LibJS/Bytecode: Split SetVariable into four separate instructions
Instead of SetVariable having 2x2 modes for variable/lexical and
initialize/set, those 4 modes are now separate instructions, which
makes each instruction much less branchy.
2024-05-14 21:46:36 +02:00
Andreas Kling
640f195a70 LibJS/Bytecode: Sort ENUMERATE_BYTECODE_OPS list 2024-05-14 21:46:36 +02:00
Andreas Kling
9265385807 LibJS/Bytecode: Don't bother propagating completion values in functions
The last completion value in a function is not exposed to the language,
since functions always either return something, or undefined.

Given this, we can avoid emitting code that propagates the completion
value from various statements, as long as we know we're generating code
for a context where the completion value is not accessible. In practical
terms, this means that function code gets to do less completion
shuffling, while global and eval code has to keep doing it.
2024-05-14 21:46:36 +02:00
Andrew Kaster
6c5e09557d CMake: Enable ClangPlugins for Serenity builds if ENABLE_CLANG_PLUGINS 2024-05-14 12:46:05 -06:00
Andrew Kaster
d51c96d56d CMake: Export targets for Clang Plugins so they can be used by Serenity 2024-05-14 12:46:05 -06:00
Liav A.
5194ab59b5 Kernel/Memory: Make has_been_{r,w,x} flags clearly being set
Before of this change, actually setting the m_access to contain the
HasBeen{Readeable,Writable,Executable} bits was done by the method of
Region set_access_bit which added ORing with (access << 4) when enabling
a certain access bit to achieve this.

Now this is changed and when calling set_{readeable,writable,executable}
methods, they will set an appropriate SetOnce flag that could be checked
later.
2024-05-14 12:41:51 -06:00
Liav A.
15ddc1f17a Kernel+Userland: Reject W->X prot region transition after a prctl call
We add a prctl option which would be called once after the dynamic
loader has finished to do text relocations before calling the actual
program entry point.

This change makes it much more obvious when we are allowed to change
a region protection access from being writable to executable.
The dynamic loader should be able to do this, but after a certain point
it is obvious that such mechanism should be disabled.
2024-05-14 12:41:51 -06:00
Liav A.
e756567341 Kernel+Userland: Convert process syscall region enforce flag to SetOnce
This flag is set only once, and should never reset once it has been set,
making it an ideal SetOnce use-case.
It also simplifies the expected conditions for the enabling prctl call,
as we don't expect a boolean flag, but rather the specific prctl option
will always set (enable) Process' AddressSpace syscall region enforcing.
2024-05-14 12:41:51 -06:00
Liav A.
2cb86c1309 Kernel/Storage: Remove ATA IDE support
Nobody uses this functionality. I used this code on my old 2007 ICH7
test machine about a year ago, but bare metal is a small aspect of the
project, so it's safe to assume that nobody really tests this piece of
code.
Therefore, let's drop this for good and focus on more modern hardware.
2024-05-14 12:38:05 -06:00
Liav A.
f474d0c316 LibCompress: Remove Gzip compress_file & decompress_file methods
The gzip utility was the last user of these methods, but now is using
the more comfortable Stream mechanism so we can just remove this code.
2024-05-14 12:35:25 -06:00
Liav A
5b34b4af14 Utilities: Merge the gunzip utility with gzip
Now both /bin/zcat and /bin/gunzip are symlinks to /bin/gzip, and we
essentially running it in decompression mode through these symlinks.

This ensures we don't maintain 2 versions of code to decompress Gzipped
data anymore, and handle the use case of gzipped-streaming input only
once in the codebase.
2024-05-14 12:35:25 -06:00
Lucas CHOLLET
cd486a7040 image: Support exporting GIF files 2024-05-14 12:33:53 -06:00
Lucas CHOLLET
f43bf1086b LibGfx/GIF: Add a spec link 2024-05-14 12:33:53 -06:00
Lucas CHOLLET
2513a1b83f LibGfx: Add a GIF writer
This version is really barebone as it does not support colors (only
black and white) or animated images.
2024-05-14 12:33:53 -06:00
Lucas CHOLLET
54f33b43c6 LibCompress: Add an LZW compressor 2024-05-14 12:33:53 -06:00
Lucas CHOLLET
ff33fa7e8b LibCompress/Lzw: Name a magic variable 2024-05-14 12:33:53 -06:00
Lucas CHOLLET
945e09e46d LibCompress/Lzw: Move shareable code to a base class 2024-05-14 12:33:53 -06:00
Lucas CHOLLET
70a3f1f02b LibCompress: Rename LZWDecoder => LzwDecompressor
This is more idiomatic for LibCompress' decoders.
2024-05-14 12:33:53 -06:00
Lucas CHOLLET
11f53ba9cc LibCompress: Rename LZWDecoder.h => Lzw.h 2024-05-14 12:33:53 -06:00
Andrew Kaster
60b3436ea3 LibWeb: Support loading FontFaces constructed with binary data 2024-05-14 12:31:10 -06:00
Shannon Booth
452ffa56dc LibWeb: Implement BaseAudioContext.createDynamicsCompressor 2024-05-14 13:45:43 -04:00