mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-30 06:48:22 +00:00
loader: initial loader code
This commit is contained in:
@@ -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,
|
||||
Reference in New Issue
Block a user