Add printf facility for kernel to allow debug messages on phys. system

This commit is contained in:
Nero 2020-12-26 16:03:15 +00:00
parent 424e174523
commit c5afc6ec61
3 changed files with 87 additions and 13 deletions

View file

@ -46,9 +46,21 @@ dinit: ; copy previously set DPT to our data area
; int 13 stub
; place reserved for stack switches
int13: ;int 3
int13: ; debug output
push bx
push dx
push cx
push ax
call printf
db "int13 CALL AX=",2," CX=",2," DX=",2," BX=",2,0x0A,0x0D,0
; do the call
int 0x13
;int 3
jc .err
ret
.err: push ax
call printf
db "int13 ERR AX=",2,0x0A,0x0D,0
stc
ret
; restore DPT to default values if possible
@ -156,7 +168,9 @@ read: push ax
mov [dskseek+2], dx
; do the actual read
; set the operation code and back it up to the stack
; low level read and write
; call again to retry, no input registers
; read or write is configured in cx
_read: mov ch, 2
db 0x3D ; cmp ax, imm16: causes next instr to be skipped
_write: mov ch, 3