From 23f0b60b755c2f4458b14747edfd49176e0e4f50 Mon Sep 17 00:00:00 2001 From: Aaron P <19561067+aaronzper@users.noreply.github.com> Date: Wed, 4 Jun 2025 21:56:13 -0400 Subject: [PATCH 1/2] Document physical memory mapping size --- api/src/config.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/api/src/config.rs b/api/src/config.rs index 5de0db3e..a5434351 100644 --- a/api/src/config.rs +++ b/api/src/config.rs @@ -386,10 +386,16 @@ pub struct Mappings { pub boot_info: Mapping, /// Specifies the mapping of the frame buffer memory region. pub framebuffer: Mapping, - /// The bootloader supports to map the whole physical memory into the virtual address + /// The bootloader supports mapping the whole physical memory into the virtual address /// space at some offset. This is useful for accessing and modifying the page tables set /// up by the bootloader. /// + /// This mapping will go from physical address `0x0` to whichever is larger: + /// - The end of the last region in the BIOS/UEFI memory map + /// - The address `0x1_0000_0000` (such that at least 4 GiB of physical memory are always mapped). + /// This is to ensure that useful MMIO regions (local APIC, I/O APIC, PCI bars) are + /// accessible to the kernel even if less physical memory than that is on the system. + /// /// Defaults to `None`, i.e. no mapping of the physical memory. pub physical_memory: Option, /// As an alternative to mapping the whole physical memory (see [`Self::physical_memory`]), From aee3504410eb3da2091fbe824d58bb50af6ff2a2 Mon Sep 17 00:00:00 2001 From: Aaron <19561067+aaronzper@users.noreply.github.com> Date: Thu, 5 Jun 2025 12:07:45 -0400 Subject: [PATCH 2/2] Update api/src/config.rs with Clippy formatting Co-authored-by: Tom Dohrmann --- api/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/src/config.rs b/api/src/config.rs index a5434351..c0f574bd 100644 --- a/api/src/config.rs +++ b/api/src/config.rs @@ -393,8 +393,8 @@ pub struct Mappings { /// This mapping will go from physical address `0x0` to whichever is larger: /// - The end of the last region in the BIOS/UEFI memory map /// - The address `0x1_0000_0000` (such that at least 4 GiB of physical memory are always mapped). - /// This is to ensure that useful MMIO regions (local APIC, I/O APIC, PCI bars) are - /// accessible to the kernel even if less physical memory than that is on the system. + /// This is to ensure that useful MMIO regions (local APIC, I/O APIC, PCI bars) are + /// accessible to the kernel even if less physical memory than that is on the system. /// /// Defaults to `None`, i.e. no mapping of the physical memory. pub physical_memory: Option,