Commit graph

8916 commits

Author SHA1 Message Date
Sönke Holz
053d1cb79c Kernel: Add a helper to get devicetree resources 2024-12-10 16:25:46 +01:00
Sönke Holz
7d41d5191b LibDeviceTree: Rename DeviceTreeNodeView to Node
The class is in the DeviceTree namespace, so the prefix is redundant.
Calling it a 'View' is also somewhat misleading, as it is not simply a
cheap-to-copy reference to the underlying memory but is instead marked
as AK_MAKE_NONCOPYABLE.
2024-12-10 16:25:46 +01:00
Sönke Holz
39c20b612b Kernel/aarch64: Add a platform init function for the virt machine 2024-12-07 16:56:12 +01:00
Sönke Holz
64ec4fab48 Kernel/aarch64: Rename RPi::UART to PL011 and move it out of the RPi dir
This PL011 driver doesn't have any RPi-specific code anymore.
Also change the documentation references to refer to the generic PL011
manual instead and adapt some register definitions.

Some definitions were previously named unused/unsupported. They were
mostly related to some hardware flow control lines and IrDA which the Pi
UARTs don't support.
2024-12-07 16:56:12 +01:00
Sönke Holz
9a58408fe7 Kernel/aarch64: Don't use RPi::MMIO for RPi::UART
Instead calculate the address in the platform init function.
2024-12-07 16:56:12 +01:00
Sönke Holz
e67330971c Kernel/aarch64: Use a platform init function for most of the RPi code
This required making the `debug_output` console configurable at runtime
by introducing a `DebugConsole` struct, which simply contains a callback
for printing a single character.
We should probably use something like this abstraction for all
architectures in the future.
2024-12-07 16:56:12 +01:00
Sönke Holz
d6d5379445 Kernel: Introduce a new abstraction for platform-specific init code
This new abstraction provides a simple solution for handling early
driver initialization without requiring some kind of dependency
management for devicetree drivers, which would otherwise be necessary.
2024-12-07 16:56:12 +01:00
Sönke Holz
b499279162 LibELF+Kernel: Don't define SERENITY_PAGE_SIZE in ELFABI.h
ELFABI.h gets included during the toolchain build, so we shouldn't
include AK headers from that file.
SERENITY_PAGE_SIZE also isn't really related to ELF ABI, so move it to
the serenity_limits.h header.
2024-12-03 20:57:24 +01:00
Sönke Holz
c385e8beb1 EFIPrekernel: Don't depend on install_libc_headers
This target was removed in 175f9dc5c3, but the dependency on it wasn't
removed from faeb9ff521 before PR #24995 was merged.
This should make everything build again.
2024-12-01 13:53:02 +01:00
Sönke Holz
faeb9ff521 EFIPrekernel: Add basic skeleton 2024-12-01 13:20:45 +01:00
Sönke Holz
9e306b858a Kernel: Add Kernel_shared_object as a BYPRODUCT of the POST_BUILD step 2024-12-01 13:20:45 +01:00
Sönke Holz
e02bebfcd4 Kernel: Generate Kernel_shared_object on all architectures
This file will be linked to the EFIPrekernel.
2024-12-01 13:20:45 +01:00
Sönke Holz
ccf7533b45 EFIPrekernel: Make dbgln usable
This simply makes dbgln use the EFI Simple Text Output Protocol.
2024-12-01 13:20:45 +01:00
Sönke Holz
ef79054505 EFIPrekernel: Add basic kmalloc implementation 2024-12-01 13:20:45 +01:00
Sönke Holz
9d6cd9b992 EFIPrekernel: Add linker script 2024-12-01 13:20:45 +01:00
Sönke Holz
f5540e1f81 Prekernel: Make the UBSan print_location stub halt on all architectures 2024-12-01 13:20:45 +01:00
implicitfield
0e368bb71a Kernel/Ext2FS: Add full support for large inodes
128-byte inodes are more-or-less deprecated since they store timestamps
as unsigned 32-bit integer offsets from the UNIX epoch. Large inodes, on
the other hand, contain records that may specify a different epoch, and
are thus less susceptible to overflows. These very same records also
have the capability to store timestamps with nanosecond precision, which
this commit adds full support for as well.
2024-11-29 10:59:24 -05:00
implicitfield
2a205768b6 Kernel/Ext2FS: Backport a missing large inode member 2024-11-29 10:59:24 -05:00
implicitfield
e7baffaba0 Ext2FS: Serialize timestamps as signed offsets
The header would have you believe these are unsigned, but they should
really be treated as signed.
2024-11-29 10:59:24 -05:00
Timothy Flynn
965e1baa8c LibWeb+UI: Detect and handle left vs. right modifier keys
Our handling of left vs. right modifiers keys (shift, ctrl, etc.) was
largely not to spec. This patch adds explicit UIEvents::KeyCode values
for these keys, and updates the UI to match native key events to these
keys (as best as we are able).

(cherry picked from commit 4fcaeabe1a6acd9f4d5fd811a36f2e86748b2a72;
amended to make the rest of the system build and to keep `Mod_AltGr`
around in addition to adding it as a key)

Co-authored-by: Nico Weber <thakis@chromium.org>
2024-11-28 15:15:36 -05:00
Hendiadyoin1
be91f5c12f Kernel: Use TypedMapping<T volatile[]> in the RTL8168NetworkAdapter 2024-11-27 22:16:45 +01:00
Hendiadyoin1
72024008c0 Kernel: Use TypedMapping<T volatile[]> in the E1000[E]NetworkAdapters 2024-11-27 22:16:45 +01:00
Hendiadyoin1
c90111a8bc Kernel: Add support for Arrays to TypedMapping
This is quite useful, as it is a common pattern that a Kernel allocated
DMA buffer is just a simple array of some type.
2024-11-27 22:16:45 +01:00
Hendiadyoin1
16a5c8a181 Kernel: Remove unused ScatterGatherList.h include from VirtIO/Queue.h 2024-11-27 22:16:45 +01:00
Timothy Flynn
f1ad3f7969 LibWeb: Define a helper constant for the platform word-jumping key
On Linux/Windows, the ctrl key is used in conjunction with arrow keys to
jump word-by-word in text documents. On macOS, the option key is used
(which is mapped to the alt key code).

(cherry picked from commit feecf89d65b3f76a4fe090daa01928439efb9fce;
amended to fix minor conflict)
2024-11-26 16:03:32 -05:00
Timothy Flynn
02fae575ca LibWeb: Define a helper constant for the platform ctrl-ish key
For all intents and purposes, the cmd (super) key on macOS should be
treated as the ctrl key.

(cherry picked from commit 71b25e3e5a70937f1e2031b94541c04a68d28efa;
amended to fix minor conflict)
2024-11-26 16:03:32 -05:00
Sönke Holz
d523ea93d6 Kernel/aarch64: Don't use u32 for PageDirectory.h definitions
VMSAv8-64 translation descriptors are 64-bit.
2024-11-24 23:34:53 +01:00
implicitfield
9d6ef8989d Prekernel/CMake: Remove a stale BYPRODUCTS entry
This rule hasn't actually generated a `Prekernel` file since d068af89,
so this wasn't doing anything other than causing this target to be
re-ran all the time.
2024-11-23 23:50:17 -05:00
implicitfield
175f9dc5c3 LibC: Symlink headers into the sysroot at configure-time
This removes the need to have the install_libc_headers target, since
LibC's headers will now get installed before anything gets built. By
extension, this also prevents said target from re-running on every
build.
2024-11-23 23:50:17 -05:00
Sönke Holz
b6d7cf10e5 Kernel/aarch64: Use MM APIs for MMIO
This causes serial output to stop working before MM is completely
initialized, as MMIO is not usable before that.
2024-11-23 19:29:50 +01:00
Sönke Holz
fd395e5705 Kernel/MM: Only return true in is_initialized if completely initialized 2024-11-23 19:29:50 +01:00
Sönke Holz
dc045cf670 Prekernel: Remove the Pentium M PAE force enable quirk
We don't support i686 anymore.
2024-11-23 19:29:50 +01:00
Sönke Holz
c12c58d771 Kernel/aarch64: Add MemoryType support 2024-11-23 19:29:50 +01:00
Sönke Holz
071ac0b94f Kernel/x86: Remove a FIXME from PageDirectory.h
Yes, the page table entry format is very arch-specific.

This FIXME was added during initial aarch64 bringup.
2024-11-23 19:29:50 +01:00
Sönke Holz
3791da53b3 Kernel/MM: Remove Page{Directory,Table}::{is,set}_write_through
We never used this attribute, so remove it.
If we ever find a use for it, we should enable it with a new MemoryType
'WriteThrough' instead.
2024-11-23 19:29:50 +01:00
Sönke Holz
b3bae90e71 Kernel/x86: Set the WC PAT memory type for MemoryType::NonCacheable
This removes the old Region::set_write_combine function and replaces
all usages of it with setting the MemoryType to NonCacheable instead.
2024-11-23 19:29:50 +01:00
Sönke Holz
d3a0ae5c57 Kernel/MM: Replace Region::Cacheable with a more generic MemoryType enum
This replaces all usages of Cacheable::Yes with MemoryType::Normal and
Cacheable::No with either MemoryType::NonCacheable or MemoryType::IO,
depending on the context.

The Page{Directory,Table}::set_cache_disabled function therefore also
has been replaced with a more appropriate set_memory_type_function.
Adding a memory_type "getter" would not be as easy, as some
architectures may not support all memory types, so getting the memory
type again may be a lossy conversion. The is_cache_disabled function
was never used, so just simply remove it altogether.

There is no difference between MemoryType::NonCacheable and
MemoryType::IO on x86 for now.

Other architectures currently don't respect the MemoryType at all.
2024-11-23 19:29:50 +01:00
Sönke Holz
a60e6d2f5d Kernel/GPU: Make the ContiguousFramebufferConsole region non-cacheable
Framebuffers should never be cached.
2024-11-23 19:29:50 +01:00
Sönke Holz
8e54c6c97f Kernel/AHCI: Add missing Cacheable::No to cmd table region allocation
The other allocations of the AHCI Command Table in this file already had
that argument.
2024-11-23 19:29:50 +01:00
Sönke Holz
038cf3cc5c Kernel/MM: Make MMIO regions non-cacheable by default
Most MMIO regions should not be cacheable, as MMIO accesses
typically have side effects (and are therefore not idempotent).
2024-11-23 19:29:50 +01:00
Sönke Holz
ad312d57c6 Kernel/MM: Remove unnecessary 'Memory::' from some function signatures
The 'Memory::' prefixes looked out of place next to the other region
allocation functions.
2024-11-23 19:29:50 +01:00
Sönke Holz
d56cedf3cd Kernel/aarch64: Use generic kprintf.cpp 2024-11-23 19:29:50 +01:00
implicitfield
b765ee22d3 Kernel/FATFS: Fix a typo 2024-11-20 20:47:46 -05:00
implicitfield
70f29d064f Kernel/FATFS: Use last() and take_last() where possible 2024-11-20 20:47:46 -05:00
implicitfield
423e80d22f Kernel/FATFS: Handle the "." and ".." entries correctly in remove_child 2024-11-20 20:47:46 -05:00
implicitfield
c74ee7d36a Kernel/FATFS: Fill in first cluster metadata for new ".." entries 2024-11-20 20:47:46 -05:00
implicitfield
b83be2b754 Kernel/FATFS: Fix an off-by-one in create_sfn_from_lfn
With this change, we no longer crash after finding more than one period
in a filename.
2024-11-20 20:47:46 -05:00
implicitfield
ce871de432 Kernel/FATFS: Abstract out SFN helpers and make them usable in userspace 2024-11-20 20:47:46 -05:00
Sönke Holz
61244cdad5 Kernel/EFI: Add header for the RISC-V EFI boot protocol
These definitions are adapted from the UEFI spec to match our code
style.
2024-11-15 01:18:04 +01:00
Sönke Holz
5772348b99 Kernel/EFI: Add header for the "Media Access" protocols
These definitions are adapted from the UEFI spec to match our code
style.
2024-11-15 01:18:04 +01:00