Okay, now i have my source.
Lets see.. Here?s how i check and set the bits in the "kbd_status" byte... (u can?t turn them of yet..)
Code:
;----------------------;
; Keyboard IRQ ;
;----------------------;
keyboard_isr:
push eax
;-----------------------------------;
; get the scancode and statusbyte ;
;-----------------------------------;
xor eax, eax
in al, 0x60
mov ah, byte [kbd_special] ; for ctrl+alt+del etc..
;------------------------------;
; check if key was released ;
;------------------------------;
test al, 0x80
jz .key_down
or ah, 10000000b
;............... some code..............
;----------------------------------------------;
; a key was pressed, check for special keys ;
;----------------------------------------------;
.key_down:
and ah, 01111111b
;............... some code..............
.check_caps:
cmp al, 58
jnz .check_num
or byte [kbd_status], 00000100b
jmp .end
.check_num:
cmp al, 69
jnz .check_scroll
or byte [kbd_status], 00000010b
jmp .end
.check_scroll:
cmp al, 70
jnz .end
or byte [kbd_status], 00000001b
jmp .end
;.............. some more code...................
.end:
mov [kbd_raw_buffer], al
mov [kbd_special], ah
movzx eax, [kbd_status] ; to check if the statusbyte was correct..
call print_hex32
; call update_leds
mov al, 0x20
out 0x20, al
pop eax
ret
the (current) update_leds function
Code:
;------------------------------;
; Update the keyboard LED?s ;
;------------------------------;
update_leds:
push ax
.l1:
in al, 0x64
and al, 0x02
jnz .l1
mov al, 0xED
out 0x60, al
.l2:
in al, 0x64
and al, 02
jnz .l2
mov al,[kbd_status]
out 0x60, al
pop ax
ret
Do you have any links to information about "advanced" keyboard programming? Becasue i would also like to know how to test the type of keyboard, know how to set diffrent "scan-modes(?) etc.
/ Christoffer