Files
nt-lite/code/public/ntlite/boot_info.h
T

74 lines
2.1 KiB
C

// Public NTLite boot info ABI declarations shared between kernel, drivers, and user mode.
#pragma once
// Boot information ABI shared between bootx64.efi and kernel.exe.
// The bootloader fills this structure immediately before ExitBootServices so the kernel starts with a firmware-free view of memory and devices.
#include <stdint.h>
#include <ntlite/memory_map.h>
#define BOOT_INFO_MAGIC 0x424F4F54494E464FULL // 'BOOTINFO'
#define MAX_BOOT_MODULES 32
#define BOOT_TIME_FLAG_VALID 0x0001u
#define BOOT_TIME_FLAG_TZ_KNOWN 0x0002u
#define BOOT_TIME_FLAG_UEFI 0x0004u
#define BOOT_TIME_FLAG_FALLBACK 0x0008u
#define BOOT_TIME_FLAG_RTC 0x0010u
#define BOOT_TIME_UNSPECIFIED_TZ 2047
typedef struct BOOT_TIME {
uint16_t Year;
uint8_t Month;
uint8_t Day;
uint8_t Hour;
uint8_t Minute;
uint8_t Second;
uint8_t Daylight;
uint32_t Nanosecond;
int16_t TimeZoneMinutes;
uint16_t Flags;
uint32_t Reserved;
} BOOT_TIME;
typedef struct BOOT_MODULE {
char Name[32]; // e.g. "hal.dll", "ata.sys"
uintptr_t VirtBase; // Virtual address (mapped)
uintptr_t PhysBase; // Raw physical address (file)
size_t ImageSize; // File size / Image size
} BOOT_MODULE;
typedef struct BOOT_INFO {
uint64_t Magic;
// Physical memory.
MEMORY_MAP MemoryMap;
// GOP framebuffer.
uintptr_t FramebufferBase;
uint32_t FramebufferWidth;
uint32_t FramebufferHeight;
uint32_t FramebufferStride; // pixels per row
// Loaded modules.
BOOT_MODULE Modules[MAX_BOOT_MODULES];
uint32_t ModuleCount;
uint32_t _pad1;
char CommandLine[64];
// ACPI RSDP physical address (for APIC, HPET).
uintptr_t RsdpPhysical;
// Direct physical window base - always 0xFFFF880000000000.
uintptr_t PhysicalMapBase;
// Reserved low-memory page for the AP startup trampoline, or zero.
uintptr_t ApTrampolinePhys;
// From boot.ini.
uint32_t Debug;
// Firmware wall-clock snapshot taken before ExitBootServices.
BOOT_TIME BootTime;
} BOOT_INFO;