A small x86-64 kernel. Stage 0 goes from real mode to long mode inside the boot sector.
Fast A20 through port 0x92
Browse files
failing
1 step in 1 ms
1 file changed
+12−1
@@ -1,7 +1,7 @@
11 ; boot.asm — Kestrel stage 0.
22 ;
33 ; 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.
4+; We set up flat segments and a stack, enable A20, and halt.
55 ;
66 ; nasm -f bin boot.asm -o boot.bin
77 ; qemu-system-x86_64 -drive format=raw,file=boot.bin
@@ -11,6 +11,17 @@
1111
1212 start:
1313 cli
14+ xor ax, ax
15+ mov ds, ax
16+ mov es, ax
17+ mov ss, ax
18+ mov sp, 0x7C00
19+ cld
20+
21+ in al, 0x92 ; fast A20 gate
22+ or al, 2
23+ out 0x92, al
24+
1425 .halt: hlt
1526 jmp .halt
1627