A small x86-64 kernel. Stage 0 goes from real mode to long mode inside the boot sector.
3build/boot.bin: boot/boot.asm | build
4 $(NASM) -f bin -l build/boot.lst $< -o $@
Fail the build unless the sector is exactly 512 bytesSep 19
5 @test $$(wc -c < $@) -eq 512 || (echo "boot sector is not 512 bytes" && false)
7build:
8 mkdir -p build
10run: build/boot.bin
11 qemu-system-x86_64 -drive format=raw,file=build/boot.bin
13clean:
14 rm -rf build
16.PHONY: run clean