I'm making a small kernel for my OS (working in PMode).
I'm trying to make a keyboard driver.
Could you help me and answer why this code isn't working?
Code: Select all
mov word[ds:(9*4) ], keyboard_handler
mov word[ds:(9*4)+2], 0
jmp $
keyboard_handler:
pusha
in al, 0x60
call write_byte_as_hex
mov bl, '|'
call Putch32
mov al, 0x20
out 0x20, al
popa
iret
hex_chars: db '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
write_byte_as_hex:
pusha
and ax, 0xFF
push ax
mov bx, ax
shr bx, 4
mov bl, [hex_chars+bx]
call Putch32
pop bx
and bx, 0xF
mov bl, [hex_chars+bx]
call Putch32
popa
ret
Thanks!