Keyboard handler works

You do have you make sure to read from 0x60 to make further interrupts
happen. Also I'm told this might be unreliable because you actually have
to make sure you're draining all the bytes, and this assumes only one
byte
This commit is contained in:
greg
2015-11-15 13:37:41 -08:00
parent 5c82d2835d
commit 3f1f180f97

View File

@@ -75,6 +75,13 @@ call_interrupt:
ret
sample_handler:
%define END_OF_INTERRUPT 0x20
%define PIC1_COMMAND 0x20
%define PIC1_DATA 0x21
%define PIC2_COMMAND 0xa0
%define PIC2_DATA 0xa1
;mov word [0xb8000], 0x4f72
push rax
push rcx
@@ -83,10 +90,19 @@ sample_handler:
push r9
push r10
push r11
pushfq
in al, 0x60 ;;thorw this away
cld
call rust_interrupt_handler
call spin_loop_64
mov al, END_OF_INTERRUPT
out PIC1_COMMAND, al
out PIC2_COMMAND, al
popfq
pop r11
pop r10
pop r9
@@ -95,7 +111,6 @@ sample_handler:
pop rcx
pop rax
call spin_loop_64
iretq
%define int_num 9