crossing-the-boundary/chapters/01-freestanding
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Saoirse Josetta 3763ea66c9
Some checks failed
CI / fmt + clippy (push) Failing after 6s
CI / build + test (push) Failing after 9s
add additional comments to multiboot_header.asm
2026-11-23 07:15:26 -05:00
..
.cargo initial commit 2026-11-22 09:33:26 -05:00
kernel add additional comments to multiboot_header.asm 2026-11-23 07:15:26 -05:00
Cargo.lock initial commit 2026-11-22 09:33:26 -05:00
Cargo.toml initial commit 2026-11-22 09:33:26 -05:00
justfile initial commit 2026-11-22 09:33:26 -05:00
README.md initial commit 2026-11-22 09:33:26 -05:00
rust-toolchain.toml initial commit 2026-11-22 09:33:26 -05:00
rustfmt.toml initial commit 2026-11-22 09:33:26 -05:00

chapter 1: freestanding

companion code for crossing the boundary, chapter 1: freestanding

a kernel that GRUB boots over multiboot2. the boot code checks the CPU, maps the first 1 GiB both where GRUB loaded it and i nthe top 2 GiB, switches to long mode, and then jumps to the rust entry point. rust brings up the serial console, reports what GRUB handed over, and greets you!

what's here

  • multiboot2 boot with GRUB 2, into a higher-half kernel. the boot information is read with the multiboot2 crate
  • a 16550 serial console
  • a panic handler
  • an in-kernel test harness

building

see the root README for the tools needed.

just run                       # boot in QEMU
just run cmdline="hello=world" # boot with a kernel command line
just debug                     # boot halted, waiting for GDB on :1234
just test                      # run the kernel test harness
just check                     # rustfmt + clippy
just                           # list every recipe