A small x86-64 kernel. Stage 0 goes from real mode to long mode inside the boot sector.
kestrel
A small x86-64 kernel, built one boot stage at a time. Stage 0 fits in the boot sector and goes from real mode straight to long mode.
make runQEMU shows kestrel in amber, in the middle of the screen, written by 64-bit code.
Stage 0, in order
- Zero the segment registers and put the stack under the boot sector.
- Open the A20 gate through port
0x92, keeping bit 0 clear (it resets the machine). - Build PML4 → PDPT → PD at
0x1000–0x3FFF, mapping the first 2 MiB with one huge page. - Set
CR4.PAE, loadCR3, setEFER.LME, then turn onCR0.PGandCR0.PEtogether. - Far-jump into the 64-bit code segment and write the banner to
0xB8000.
Skipping protected mode works on QEMU. Real-hardware reports belong in the issues. The memory map records what lives where.
Crew
Mirelle Okafor (lead) and Kwame Osei, with sentry reviewing every boot path and kerf keeping the sector under 512 bytes.