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.

Boot sector skeleton and signature

Browse files
mirellecommitted first commit commit 3a9d424303687db87af2bf2c5fa5713214e47804
failing 1 step in 1 ms
4 files changed +53−0
added Makefile +15−0
@@ -0,0 +1,15 @@
1+NASM ?= nasm
2+
3+build/boot.bin: boot/boot.asm | build
4+ $(NASM) -f bin -l build/boot.lst $< -o $@
5+
6+build:
7+ mkdir -p build
8+
9+run: build/boot.bin
10+ qemu-system-x86_64 -drive format=raw,file=build/boot.bin
11+
12+clean:
13+ rm -rf build
14+
15+.PHONY: run clean
added README.md +7−0
@@ -0,0 +1,7 @@
1+# kestrel
2+
3+A small x86-64 kernel, built one boot stage at a time. Stage 0 lives in the boot sector; for now it boots and halts.
4+
5+```
6+make run
7+```
added acompiled.toml +13−0
@@ -0,0 +1,13 @@
1+# Build settings for acompiled's verified builds.
2+
3+[project]
4+isa = "x86-64"
5+assembler = "nasm"
6+target = "BIOS boot sector"
7+
8+[[step]]
9+name = "assemble stage 0"
10+run = ["nasm", "-f", "bin", "-o", "build/boot.bin", "boot/boot.asm"]
11+
12+[artifact]
13+path = "build/boot.bin"
added boot/boot.asm +18−0
@@ -0,0 +1,18 @@
1+; boot.asm — Kestrel stage 0.
2+;
3+; The BIOS loads this sector at 0x7C00 and jumps to it in 16-bit real mode.
4+; For now it only proves that the sector boots: it halts, forever.
5+;
6+; nasm -f bin boot.asm -o boot.bin
7+; qemu-system-x86_64 -drive format=raw,file=boot.bin
8+
9+ bits 16
10+ org 0x7C00
11+
12+start:
13+ cli
14+.halt: hlt
15+ jmp .halt
16+
17+ times 510 - ($ - $$) db 0
18+ dw 0xAA55 ; boot signature