; boot.asm — Kestrel stage 0. ; ; The BIOS loads this sector at 0x7C00 and jumps to it in 16-bit real mode. ; We set up flat segments and a stack, enable A20, and halt. ; ; nasm -f bin boot.asm -o boot.bin ; qemu-system-x86_64 -drive format=raw,file=boot.bin bits 16 org 0x7C00 start: cli xor ax, ax mov ds, ax mov es, ax mov ss, ax mov sp, 0x7C00 cld in al, 0x92 ; fast A20 gate or al, 2 out 0x92, al .halt: hlt jmp .halt times 510 - ($ - $$) db 0 dw 0xAA55 ; boot signature