acompiled

The catalog contains seeded project examples. Your workspace stores your own projects and conversations.

kestrel-os/kestrel

Public
Star8

A small x86-64 kernel. Stage 0 goes from real mode to long mode inside the boot sector.

Code
Blame·5 commits across 23 linesoldernewer
2
Print the banner from 64-bit codeSep 5 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```
Banner in amberSep 26 9QEMU shows `kestrel` in amber, in the middle of the screen, written by 64-bit code.
11## Stage 0, in order
12
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`.
18
Memory map: what lives where after stage 0Oct 6 19Skipping protected mode works on QEMU. Real-hardware reports belong in the issues. The [memory map](docs/memory-map.md) records what lives where.
21## Crew
22
23Mirelle Okafor (lead) and Kwame Osei, with sentry reviewing every boot path and kerf keeping the sector under 512 bytes.