convert MBR, VBR, & Stage2 to use a BSS section. #3

Merged
Nivirx merged 25 commits from bss-setup into trunk 2024-10-13 18:05:19 -04:00
Showing only changes of commit 35e9aec059 - Show all commits

View File

@@ -51,20 +51,13 @@ init:
; ;
; Zero BSS section ; Zero BSS section
;
mov cx, (end_bss - begin_bss) ; count = bss length mov cx, (end_bss - begin_bss) ; count = bss length
mov ax, begin_bss mov ax, begin_bss
shr ax, 4 mov di, ax ; es:di is dest
mov es, ax ; es = begining of bss section
xor ax, ax xor ax, ax
mov di, ax ; dst = 0
cld cld
rep stosb ; zero bss section rep stosb ; zero bss section
xor ax, ax
mov ss, ax ; Set Stack Segment to 0 mov ss, ax ; Set Stack Segment to 0
mov sp, stack_top ; Setup stack mov sp, stack_top ; Setup stack
mov bp, sp ; base ptr = stack ptr mov bp, sp ; base ptr = stack ptr