Commit graph

46623 commits

Author SHA1 Message Date
Timon Kruiper 0f3e1668bb Kernel/aarch64: Execute first userspace process
This adds the necessary code to init.cpp to be able to execute the first
userspace process. To do this, first the filesystem code is initialized,
which will use the ramdisk embedded into the kernel image. Then the
first userspace process, /bin/SystemServer is executed. :^)

The ramdisk code is used as it is useful for the bring-up of the aarch64
port, however once the kernel has support for better ram-based
filesystems, the ramdisk code will be removed again.
2023-02-08 18:19:48 +00:00
Timon Kruiper 3b65fd64fc Kernel/aarch64: Embed disk image into kernel binary
This allows us to actually boot to userspace in the next commit! :^)
2023-02-08 18:19:48 +00:00
Timon Kruiper da89cd948f Kernel/aarch64: Do not dump register state on every page fault
This became very spammy, and is not needed anymore since we now
correctly handle page faults.
2023-02-08 18:19:48 +00:00
Timon Kruiper 3106a72a72 Kernel/aarch64: Make register dump output a bit nicer 2023-02-08 18:19:48 +00:00
Timon Kruiper a9f7267cbd Meta: Allow creating disk image without installing kernel into it
This change allows for creating smaller disk images, which is useful for
creating a disk image that will be put into ram.
2023-02-08 18:19:48 +00:00
Timon Kruiper cf5b02e3a4 Kernel/aarch64: Dump ESR_EL1 in dump_registers and remove backtracing 2023-02-08 18:19:48 +00:00
Timon Kruiper 3295137224 Kernel: Add optional userspace backtrace to Process::crash
This is very useful for debugging the initial userspace applications, as
the CrashReporter is not yet running.
2023-02-08 18:19:48 +00:00
Timon Kruiper 3611427ce2 Kernel/aarch64: Return correct values from RegisterState accessors 2023-02-08 18:19:48 +00:00
Timon Kruiper 5aba83e6ba Kernel/aarch64: Add TimeManagement fallback entropy source to Random.cpp
The emulated aarch64 CPU does not contain the RNG cpu feature, so the
random number generator was not seeded. This commit adds a fallback to
use TimeManagement as a entropy source, such that get_good_random_bytes
works, which is needed for running the first userspace application on
aarch64.
2023-02-08 18:19:48 +00:00
Timon Kruiper 5781d58fe8 Kernel/aarch64: Implement set_exec_state in ThreadRegisters
This sets up the correct ThreadRegisters state when a process is
exec'ed, which happens when the first userspace application is executed.
Also changes Processor.cpp to get the stack pointer from the
ThreadRegisters.
2023-02-08 18:19:48 +00:00
Timon Kruiper 8960662e57 Kernel/aarch64: Set exception origin mode to SP_EL0 for userspace thread 2023-02-08 18:19:48 +00:00
Timon Kruiper 3f05748c0c Kernel/aarch64: Store Saved Program Status Register in ThreadRegisters
This allows us to set the Mode field of the Saved Program Status
Register (EL1) to EL0t when a userspace process is created.
2023-02-08 18:19:48 +00:00
Timon Kruiper 816076f71a Kernel: Share CrashHandler.cpp between aarch64 and x86_64
This file contains no architecture specific code, so can be moved to the
Kernel/ directory, and thus shared between aarch64 and x86_64.
2023-02-08 18:19:48 +00:00
Timon Kruiper 7ba9bc6338 Kernel/aarch64: Remove static from dump_registers
This allows the function to be called from other translation units, in
particular this allows the CrashHandler.cpp file to be shared between
aarch64 and x86_64.
2023-02-08 18:19:48 +00:00
Timon Kruiper 5cb37038a3 Kernel/aarch64: Set kernel_load_base and correctly calculate symbol addr
Setting the kernel_load_base variable caused backtracking to regress, so
to have proper backtracing the calculation of the symbol address in
KSyms.cpp needs to keep into account that the aarch64 kernel is linked
at a high virtual memory address.
2023-02-08 18:19:48 +00:00
Timon Kruiper c7802cef25 Kernel/aarch64: Handle exceptions from lower exception level (EL)
When we execute in userspace, the exception level is EL0, so to handle
exceptions, such as interrupts, and syscalls, we need to add handlers to
vector_table.S. For now we only support running userspace applications
in AArch64 mode, so this commit only adds the handlers for that mode.
2023-02-08 18:19:48 +00:00
Timon Kruiper 7be7324287 Kernel/aarch64: Set correct ExecutionMode of PageFault
Adds a helper to aarch64/Registers.h to factor out the exception class
encoding.
2023-02-08 18:19:48 +00:00
Timon Kruiper ecf45e191e Kernel/aarch64: Handle instruction aborts
To detect instruction aborts, a helper to Registers.h is added, and used
in Interrupts.cpp. Additionally, the PageFault class gets a setter to
set the PageFaults m_is_instruction_fetch bool, and is also used in
Interrupts.cpp.
2023-02-08 18:19:48 +00:00
Timon Kruiper daf7f43135 LibELF: Add EM_AARCH64 as expected architecture for ELF validation 2023-02-08 18:19:48 +00:00
Timon Kruiper 163e3ac90b Kernel/aarch64: Set Access Permission EL0 bit for userspace mappings
This bit was not set, which was causing Permission Faults when executing
in userspace.
2023-02-08 18:19:48 +00:00
Timon Kruiper 187723776a Revert "Kernel/Storage: Remove the ramdisk implementation"
This reverts commit 4e0f85432a as the
ramdisk code is useful for the bring-up of the aarch64 port. Once the
kernel supports better ram-based filesystems, this code will be removed
again.
2023-02-08 18:19:48 +00:00
Tim Schumacher 4d68dcfca0 LibGfx: Port DDSLoader to AK::Stream
Functionality for checking image size in advance has been removed, as
this would require a SeekableStream and we now check for read errors
everywhere anyways.
2023-02-08 17:55:36 +00:00
Tim Schumacher 7d70f6d7c8 LibCrypto: Do a simple copy for buffered GHash bytes
Using a Stream to copy over a single span is kind of overkill.
2023-02-08 17:53:19 +00:00
Tim Schumacher 220fbcaa7e AK: Remove the fallible constructor from FixedMemoryStream 2023-02-08 17:44:32 +00:00
Tim Schumacher 8b2f23d016 AK: Remove the fallible constructor from LittleEndianOutputBitStream 2023-02-08 17:44:32 +00:00
Tim Schumacher 0fee97916b AK: Remove the fallbile constructor from BigEndianOutputBitStream 2023-02-08 17:44:32 +00:00
Tim Schumacher 261d62438f AK: Remove the fallible constructor from LittleEndianInputBitStream 2023-02-08 17:44:32 +00:00
Tim Schumacher fa09152e23 AK: Remove the fallible constructor from BigEndianInputBitStream 2023-02-08 17:44:32 +00:00
Nico Weber 839bec14af LibGfx: Validate type of cicpTag in ICC Profile
This should've really been part of e8bbb3d915.
2023-02-08 17:18:54 +00:00
Evan Smal cb3216cb45 js: Remove DeprecatedString usage in load_json_impl() 2023-02-08 16:48:32 +00:00
Evan Smal ff5a8a21e8 js: Use const where possible in parse_and_run() 2023-02-08 16:48:32 +00:00
Evan Smal 698bcf4b4e js: Convert s_history_path to String and propagate errors 2023-02-08 16:48:32 +00:00
Evan Smal d18a7ca2dc js: Use Core::Stream::File in place of POSIX in write_to_file() 2023-02-08 16:48:32 +00:00
Evan Smal f871dc097b js: Use String in prompt_for_level() and read_next_piece() 2023-02-08 16:48:32 +00:00
Nico Weber e8bbb3d915 LibGfx+icc: Read cicpType
This is a very new tag used for HDR content. The only files I know that
use it are the jpegs on https://ccameron-chromium.github.io/hdr-jpeg/
But they have an invalid ICC creation date, so `icc` can't process them.
(Commenting out the check for that does allow to print them.)

If the CIPC tag is present, it takes precedence about the actual data
in the profile and from what I understand, the ICC profile is
basically ignored. See https://www.color.org/events/HDR_experts.xalter
for background, in particular
https://www.color.org/hdr/02-Luke_Wallis.pdf (but the other talks
are very interesting too).

(PNG also has a cICP chunk that's supposed to take precedence over
iCCP.)
2023-02-08 16:41:58 +00:00
Nico Weber a434b89521 LibGfx: Add another profile ID to ICC quirk list 2023-02-08 16:37:47 +00:00
Nico Weber 21cc0c0cb2 LibGfx: Add ICC v2 tags to tag list 2023-02-08 16:36:31 +00:00
Nico Weber 8bd64f001c LibGfx+icc: Read signatureType
This isn't used by any mandatory tags, and it's not terribly useful.
But jpegs exported by Lightroom Classic write the 'tech' tag, and
it seems nice to be able to dump its contents.

signatureType stores a single u32 which for different tags with this
type means different things.

In each case, the value is one from a short table of valid values,
suggesting this should be a per-tag enum class instead of a
per-tag DistinctFourCC, per the comment at the top of DistincFourCC.h.
On the other hand, 3 of the 4 tables have an explicit "It is possible
that the ICC will define other signature values in the future" note,
which suggests the FourCC might actually be the way to go.

For now, just punt on that and manually dump the u32 in fourcc style
in icc.cpp and don't add any to_string() methods that return a readable
string based on the contents of these tables.
2023-02-08 16:35:57 +00:00
Nico Weber cbcf8471a6 LibGfx+icc: Read namedColor2Type
This is the type of namedColor2Tag, which is a required tag in
NamedColor profiles.

The implementation is pretty basic for now and only exposes the
numbers stored in the file directly (after endian conversion).
2023-02-08 16:34:24 +00:00
Cubic Love 1ce34805f8 Settings: Improve default window size
Before, one icon was hidden out of sight and there was a scrollbar.
This small fix displays two neat rows of five icons.
2023-02-08 11:28:20 +01:00
Aliaksandr Kalenik 83b0613c68 LibWeb: Null check nearest_sibling in generate_missing_parents
Caught by AddressSanitizer.
2023-02-07 17:04:38 +01:00
Aliaksandr Kalenik f43f4feb1e LibWeb: Table wrappers should not be ignored in auto height calculation
Though table wrappers are anonymous block containers (because
TableWrapper is inherited from BlockContainer) with no lines they
should not be skipped in block auto height calculation.
2023-02-07 17:04:38 +01:00
Andreas Kling 9e5fd95e44 SpaceAnalyzer: "Open Containing Folder" => "Reveal in File Manager"
Also "Open Folder" => "Open in File Manager".
2023-02-07 17:01:55 +01:00
Andreas Kling f103f3af60 TextEditor: "Open Containing Folder" => "Reveal in File Manager" 2023-02-07 17:01:55 +01:00
Andreas Kling 2bc8cbfe8f LibGUI: Add 9 and 11 to the list of suggested sizes in FontPicker 2023-02-07 17:01:55 +01:00
Zaggy1024 3a1efbb9e4 SoundPlayer: Remove AutoSlider for the seek bar in favor of Slider 2023-02-07 14:36:58 +00:00
Zaggy1024 9e61e48b31 VideoPlayer: Pause while the user is dragging the seek bar 2023-02-07 14:36:58 +00:00
Zaggy1024 d9a73bbc96 LibGUI: Add callbacks for Slider drags starting and ending 2023-02-07 14:36:58 +00:00
Zaggy1024 fa98c43c0d LibGUI: Make sliders start a drag when jumping to the cursor
This allows users to seek to any position in VideoPlayer, then continue
adjusting the playback timestamp while holding left mouse.
2023-02-07 14:36:58 +00:00
Kenneth Myhra 944191560a Ports: Update qemu to 7.2.0 2023-02-07 13:35:49 +00:00