; second stage boot loader C startup cpu 8086 bits 16 section .startup ; memory reserved at the top of the kernel segment for the stack STACKSZ equ 4096 extern kmain extern _bss_start extern _bss_size global _start _start: ; TODO floppy off if necessary ; move stack to the top of the kernel segment xor ax, ax mov sp, ax mov ds, ax mov es, ax mov ss, ax ; zero .bss mov di, _bss_start mov cx, _bss_size shr cx, 1 rep stosw call kmain hang: hlt jmp hang ; vi:set ts=8 sts=8 sw=8 ft=nasm: