#[repr(C, packed(1))]pub struct KernelArgs {Show 25 fields
pub magic: u32,
pub abi_version: u32,
pub kernel_base: u64,
pub kernel_size: u64,
pub acpi_rsdp_base: u64,
pub memory_map_base: u64,
pub memory_map_size: u64,
pub framebuffer_addr: u64,
pub hhdm_offset: u64,
pub cmdline_ptr: u64,
pub cmdline_len: u64,
pub modules_base: u64,
pub modules_size: u64,
pub framebuffer_width: u32,
pub framebuffer_height: u32,
pub framebuffer_stride: u32,
pub framebuffer_bpp: u16,
pub framebuffer_red_mask_size: u8,
pub framebuffer_red_mask_shift: u8,
pub framebuffer_green_mask_size: u8,
pub framebuffer_green_mask_shift: u8,
pub framebuffer_blue_mask_size: u8,
pub framebuffer_blue_mask_shift: u8,
pub bss_virt_base: u64,
pub bss_virt_size: u64,
}Expand description
Bootloader-to-kernel handoff structure (ABI v2, 136 bytes).
Field layout is ordered to avoid internal padding:
- u64 fields first (8-byte aligned)
- u32 fields next
- u16 field
- u8 fields last
§Field groups
§Identity (8 bytes)
magic: must equalSTRAT9_BOOT_MAGIC(0x5354_3942)abi_version: must equalSTRAT9_BOOT_ABI_VERSION(currently3)
§Kernel memory (16 bytes)
kernel_base: physical address of the kernel ELF imagekernel_size: size of the kernel image in bytes
§ACPI (8 bytes)
acpi_rsdp_base: physical address of the RSDP
§Memory map (16 bytes)
memory_map_base: physical address of theMemoryRegionarraymemory_map_size: total size of the memory map in bytes
§Framebuffer (8 bytes + masks)
framebuffer_addr: virtual address (0xFFFF_DEAD_0000_0000)
§HHDM (8 bytes)
hhdm_offset: Higher Half Direct Map offset
§Environment (16 bytes)
cmdline_ptr: physical address of key=value stringcmdline_len: length of the string in bytes
§Modules (16 bytes)
modules_base: physical address of theModuleTablemodules_size: total size of the module table in bytes
Fields§
§magic: u32§abi_version: u32§kernel_base: u64§kernel_size: u64§acpi_rsdp_base: u64§memory_map_base: u64§memory_map_size: u64§framebuffer_addr: u64§hhdm_offset: u64§cmdline_ptr: u64§cmdline_len: u64§modules_base: u64§modules_size: u64§framebuffer_width: u32§framebuffer_height: u32§framebuffer_stride: u32§framebuffer_bpp: u16§framebuffer_red_mask_size: u8§framebuffer_red_mask_shift: u8§framebuffer_green_mask_size: u8§framebuffer_green_mask_shift: u8§framebuffer_blue_mask_size: u8§framebuffer_blue_mask_shift: u8§bss_virt_base: u64§bss_virt_size: u64Implementations§
Source§impl KernelArgs
impl KernelArgs
Sourcepub unsafe fn memory_regions(&self) -> Result<&[MemoryRegion], &'static str>
pub unsafe fn memory_regions(&self) -> Result<&[MemoryRegion], &'static str>
Read the memory map, rejecting malformed lengths instead of truncating.
§Safety
Any range that passes the numeric checks must be readable through the current identity mapping, initialized and immutable for the returned slice’s lifetime. These checks cannot establish physical memory ownership.
Sourcepub fn cmdline_bytes(&self) -> &[u8]
pub fn cmdline_bytes(&self) -> &[u8]
Environment string as bytes (null-terminated key=value pairs).
Sourcepub fn cmdline_str(&self) -> &str
pub fn cmdline_str(&self) -> &str
Environment string as &str (without null terminator).
Sourcepub unsafe fn modules(&self) -> Result<&[ModuleEntry], &'static str>
pub unsafe fn modules(&self) -> Result<&[ModuleEntry], &'static str>
Read the fixed-capacity module table after checking its advertised extent.
§Safety
If the numeric extent checks succeed, the first MODULE_TABLE_SIZE bytes must be readable through the current identity mapping, initialized and immutable for the returned slice’s lifetime. Module payloads are not read.