some general cleanup & moving the halt to the next point in main()

This commit is contained in:
2024-10-03 16:43:10 -04:00
parent d2194ab835
commit 768260540f

View File

@@ -86,8 +86,6 @@ main:
call PrintString call PrintString
add sp, 0x2 add sp, 0x2
ERROR STEVIA_DEBUG_HALT
; get system memory map ; get system memory map
call GetMemoryMap call GetMemoryMap
@@ -96,6 +94,8 @@ main:
call PrintString call PrintString
add sp, 0x2 add sp, 0x2
ERROR STEVIA_DEBUG_HALT
; enter unreal mode ; enter unreal mode
call EnterUnrealMode call EnterUnrealMode
@@ -527,10 +527,10 @@ read_disk_raw:
mov ah, 0x42 mov ah, 0x42
mov dl, byte [fat32_ebpb + FAT32_ebpb_t.drive_number_8] mov dl, byte [fat32_ebpb + FAT32_ebpb_t.drive_number_8]
int 0x13 int 0x13
jnc read_disk_raw.endf jnc read_disk_raw.endp
ERROR STAGE2_MBR_DISK_READ_ERROR ERROR STAGE2_MBR_DISK_READ_ERROR
.endf: .endp:
pop si pop si
ret ret
@@ -549,7 +549,6 @@ PrintString:
not cx ; the inverse of a neg number = abs(x) - 1 not cx ; the inverse of a neg number = abs(x) - 1
dec cx ; CX contains the length of the string - nul byte at end dec cx ; CX contains the length of the string - nul byte at end
.print: .print:
mov si, [bp + 4] ; source string mov si, [bp + 4] ; source string
.print_L0: .print_L0:
@@ -571,7 +570,7 @@ PrintString:
; void PrintCharacter(char c); ; void PrintCharacter(char c);
PrintCharacter: PrintCharacter:
__CDECL16_ENTRY __CDECL16_ENTRY
.func_bios: .func:
mov ax, [bp + 4] ; c mov ax, [bp + 4] ; c
mov dx, 0x00ff mov dx, 0x00ff
and ax, dx and ax, dx
@@ -579,7 +578,6 @@ PrintCharacter:
mov ah, 0x0E ; INT 0x10, AH=0x0E call mov ah, 0x0E ; INT 0x10, AH=0x0E call
mov bx, 0x0007 ; BH = page no. BL =Text attribute 0x07 is lightgrey font on black background mov bx, 0x0007 ; BH = page no. BL =Text attribute 0x07 is lightgrey font on black background
int 0x10 ; call video interrupt int 0x10 ; call video interrupt
.endp: .endp:
__CDECL16_EXIT __CDECL16_EXIT
ret ret
@@ -658,6 +656,7 @@ SetTextMode:
popf popf
__CDECL16_EXIT __CDECL16_EXIT
ret ret
; See memory.inc for a brief description of E820 mmap function ; See memory.inc for a brief description of E820 mmap function
GetMemoryMap: GetMemoryMap:
__CDECL16_ENTRY __CDECL16_ENTRY