load stage2 high to leave the low RAM for the kernel
[eightysix] / boot / boot2.asm
1 ; second stage boot loader C startup
2         cpu 8086
3         bits 16
4         section .startup
5
6 extern bootmain
7 extern _stage2_start_seg
8 extern _bss_start_off
9 extern _bss_size
10
11 global _start
12 _start:
13         ; TODO floppy off if necessary
14
15         ; zero .bss
16         mov di, _bss_start_off
17         mov cx, _bss_size
18         shr cx, 1
19         rep stosw
20         xor ax, ax
21         mov es, ax
22
23         call bootmain
24
25 hang:   hlt
26         jmp hang
27
28 ; vi:set ts=8 sts=8 sw=8 ft=nasm: