From 9b22a6965579ea1867aea291d910c96f386b518b Mon Sep 17 00:00:00 2001 From: Brett Weiland Date: Tue, 24 Aug 2021 14:09:29 -0500 Subject: major backup 8.24.21 --- src/bootloader/bios_functions/bios_disk.asm | 40 -------------------- src/bootloader/bios_functions/print.asm | 58 ----------------------------- 2 files changed, 98 deletions(-) delete mode 100644 src/bootloader/bios_functions/bios_disk.asm delete mode 100644 src/bootloader/bios_functions/print.asm (limited to 'src/bootloader/bios_functions') diff --git a/src/bootloader/bios_functions/bios_disk.asm b/src/bootloader/bios_functions/bios_disk.asm deleted file mode 100644 index 195057a..0000000 --- a/src/bootloader/bios_functions/bios_disk.asm +++ /dev/null @@ -1,40 +0,0 @@ -bios_disk: -.load_sectors: -pusha -mov es, dx - -; TODO when our kernel gets to big to fit in one track, we need to just switch over to LHS with extended bios functions. - -mov ah, 0x02 ; read disc sectors -mov ch, 0x00 ; track 0 -mov dh, 0x00 ; head 0 -mov dl, [stage0.boot_device] - -int 0x13 - -jc .failed - -mov ah, 0 -popa -ret - -.failed: -debug: -mov bx, .loadsectors_error -mov cx, 0 -call bios_print - -push 0 -mov al, ah -mov ah, 0 ; you need to clean up the bios print function! -push ax -mov cx, 1 -mov bx, sp -call bios_print - - -mov ah, 1 -popa -ret - -.loadsectors_error: db "Error loading sectors: ", 0 diff --git a/src/bootloader/bios_functions/print.asm b/src/bootloader/bios_functions/print.asm deleted file mode 100644 index 303fa8f..0000000 --- a/src/bootloader/bios_functions/print.asm +++ /dev/null @@ -1,58 +0,0 @@ -;TODO fix null problem, allow passing value insted of pointer -bios_print: -pusha -mov ah, 0x0e - -.print_loop: -mov al, [bx] -cmp al, 0 -je .fini - -test cx, cx ; if cx is zero, ascii, otherwise hex string -jne .print_hex -int 0x10 -.print_hex_ret: -inc bx -jmp .print_loop - -.fini: -mov al, 0xd -int 0x10 -mov al, 0xa -int 0x10 -popa -ret - - -.print_hex: -mov al, '0' -int 0x10 - -mov al, 'x' -int 0x10 - -mov al, [bx] -shr al, 4 -call .bios_print_nibble - -mov al, [bx] -and al, 0x0f -call .bios_print_nibble - -mov al, ' ' -int 0x10 - -jmp .print_hex_ret - - -.bios_print_nibble: -cmp al, 9 -ja .print_hex_letter -add al, 0x30 -int 0x10 -ret - -.print_hex_letter: -add al, 0x57 -int 0x10 -ret -- cgit v1.2.3