Added print_hex SR & refactor

pull/10/head
E. Almqvist 4 years ago
parent 1758888b27
commit e779668334
  1. 22
      src/bootloader.asm
  2. 5
      src/elib/bios_disk.asm
  3. 10
      src/elib/io.asm

@ -6,14 +6,16 @@
mov bx, info_string ; Print version info mov bx, info_string ; Print version info
call println call println
mov bx, hex_test_string ; Hex print test (not needed but fun) ; Read from disk
call print mov bp, 0x8000
mov sp, bp ; move the stack away so that it does not get overwritten
pusha mov bx, 0x9000
mov dx, 0x002e ; test the conversion mov dh, 2 ; read 2 sectors
call hex_to_ascii call disk_read ; read
call println
popa mov dx, [0x9000]
call print_hex
jmp $ ; inf loop jmp $ ; inf loop
@ -22,12 +24,14 @@
%include "equ/ASCII.asm" %include "equ/ASCII.asm"
; SRs ; SRs
%include "elib/io.asm"
%include "elib/convert.asm" %include "elib/convert.asm"
%include "elib/io.asm"
%include "elib/bios_disk.asm"
welcome_string: db "e Operating-System (eOS)", ASCII_END welcome_string: db "e Operating-System (eOS)", ASCII_END
info_string: db "Version 2021 0.0", ASCII_END info_string: db "Version 2021 0.0", ASCII_END
hex_test_string: db "Hex printing test: ", ASCII_END read_test_string: db "Disk read: ", ASCII_END
times 510-($-$$) db 0 times 510-($-$$) db 0
db 0x55, 0xaa ; magic BIOS numbers db 0x55, 0xaa ; magic BIOS numbers

@ -28,11 +28,8 @@ read_error:
mov bx, read_error_string mov bx, read_error_string
call println call println
pusha
mov dh, ah mov dh, ah
call hex_to_ascii call print_hex
call println
popa
disk_loop: disk_loop:
jmp $ jmp $

@ -40,3 +40,13 @@ println:
popa popa
ret ret
; Subroutine to print a hex value
print_hex:
pusha
call hex_to_ascii
call print
popa
ret

Loading…
Cancel
Save