A small x86-64 kernel. Stage 0 goes from real mode to long mode inside the boot sector.
1# kestrel
3A 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.
5```
6make run
7```
9QEMU shows `kestrel` in the middle of the screen, written by 64-bit code.
11## Stage 0, in order
131. Zero the segment registers and put the stack under the boot sector.
142. Open the A20 gate through port `0x92`, keeping bit 0 clear (it resets the machine).
153. Build PML4 → PDPT → PD at `0x1000`–`0x3FFF`, mapping the first 2 MiB with one huge page.
164. Set `CR4.PAE`, load `CR3`, set `EFER.LME`, then turn on `CR0.PG` and `CR0.PE` together.
175. Far-jump into the 64-bit code segment and write the banner to `0xB8000`.
19Skipping protected mode works on QEMU. Real-hardware reports belong in the issues.