Responds to keyboard

but I'm doing something wrong with responding to the interrupt it only
works once
This commit is contained in:
greg
2015-11-15 03:38:37 -08:00
parent 91632e8e99
commit 5c82d2835d
2 changed files with 11 additions and 4 deletions

View File

@@ -60,11 +60,13 @@ pub extern fn rust_main() {
timer = 0;
}
if count > 200 && count < 300 {
/*
if count > 200 && count % 3 == 0 {
unsafe {
call_interrupt();
}
}
*/
}
loop {}

View File

@@ -24,7 +24,7 @@ long_mode_start:
hlt
spin_loop_64:
mov rcx, 0xffff_fff
mov rcx, 0xffff_ff
.loop:
dec rcx
cmp rcx, 0
@@ -71,7 +71,7 @@ get_rdtsc:
ret
call_interrupt:
int 5
int 9
ret
sample_handler:
@@ -98,7 +98,7 @@ sample_handler:
call spin_loop_64
iretq
%define int_num 5
%define int_num 9
setup_IDT:
lidt [idt64.pointer]
mov rax, sample_handler
@@ -112,6 +112,11 @@ setup_IDT:
ret
setup_PIC:
mov al, 0xfd
out byte 0x21, al
mov al, 0xff
out byte 0xa1, al
sti
ret
idt64: