fixed bss init in mbr

This commit is contained in:
2024-10-13 17:52:09 -04:00
parent 736aad85e5
commit 35e9aec059

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