_ _ _
| | | | | |
| |__| | __ _ _ __ __| | _____ _____ _ __
| __ |/ _` | '_ \ / _` |/ _ \ \ / / _ \ '__|
| | | | (_| | | | | (_| | (_) \ V / __/ |
|_| |_|\__,_|_| |_|\__,_|\___/ \_/ \___|_|
A simple and extensible boot protocol
- One contiguous area of memory makes it easy to hand it around.
- Easy to parse using on contiguous array of records.
- Centered around the memory map
- No callbacks, no state.
struct HandoverRequest
{
uint32_t tag;
uint32_t flags;
uint64_t more;
};
struct HandoverPayload
{
uint32_t magic, agent, size, count;
HandoverRecord records[];
};
struct HandoverRecord
{
uint32_t tag;
uint32_t flags;
uint64_t start;
uint64_t size;
uint64_t more;
};
Except what stated bellow the machine state is undefined.
- rdi: will contain the 0xc001b001 magic number
- rsi: will contain the address of the handover payload in the kernel space
Paging is enabled and the following ranges are mapped
- Some LOADER regions are mapped to the same physical memory address for the initial spinup
- The first 4gio at 0xffffffff80000000 refered as I/O space
- KERNEL, STACK and SELF regions are mapped at 0xffff800000000000 and are refered as kernel space.
Free for general use
The handover structure
CPU stack
Kernel region where the kernel code reside
Memory allocated by the loaded and reclaimable by the kernel.
This might include page-tables so make sure the create your own before freeing this
Loaded file
ACPI RSDP
Flatten device tree blob
Framebuffer
Kernel command line
End marker
- C - handover.h