kernel_info/memory.rs
1//! # Memory Layout
2
3/// Where the kernel executes (VMA), matches your linker script.
4///
5/// # Kernel Build
6/// This information is sourced in the kernel's `build.rs` to configure
7/// the linker.
8pub const KERNEL_BASE: u64 = 0xffff_ffff_8000_0000;
9
10/// Where you place the bytes in *physical* memory (LMA) before paging.
11///
12/// # Kernel Build
13/// This information is sourced in the kernel's `build.rs` to configure
14/// the linker.
15pub const PHYS_LOAD: u64 = 0x0010_0000; // 1 MiB
16
17/// A simple Higher Half Direct Map (HHDM) base.
18/// Anything you map at [`HHDM_BASE`] + `pa` lets the kernel
19/// access physical memory via a fixed offset.
20pub const HHDM_BASE: u64 = 0xffff_8880_0000_0000;
21
22/// Keep a tiny identity map so the paging switch code remains executable
23/// right after CR3 reload (and to let you pass low pointers if you want).
24pub const IDENTITY_LOW_BYTES: u64 = 0x20_0000; // 2 MiB