loader: initial loader code

This commit is contained in:
Loïc Grégoire
2026-07-16 19:48:01 -04:00
parent 26ec72fb36
commit a79c7a07cb
35 changed files with 1197 additions and 548 deletions
+45
View File
@@ -0,0 +1,45 @@
/// Represents the system memory map.
pub const MemMap = struct {
/// A memory map entry.
pub const Entry = struct {
pub const Type = enum {
Free,
Reserved,
LoaderReclaimable,
AcpiNvs,
AcpiReclaimable,
};
type: Type,
base: usize,
size: usize,
};
entry_count: usize,
entries: [128]Entry,
};
pub const Framebuffer = struct {
address: usize,
width: u32,
height: u32,
pitch: u32,
bpp: u8,
};
pub const KernelAddress = struct { physical_base: usize, virtual_base: usize };
/// RSDP on ACPI machines
rsdp: ?usize,
/// Kernel command-line arguments
cmdline: ?[]const u8,
/// Memory map
memory_map: MemMap,
/// Framebuffer info, if available
framebuffer: ?Framebuffer,
/// Kernel address
kernel_address: KernelAddress,