diff --git a/src/idt/mod.rs b/src/idt/mod.rs index 929a5e1..20acec1 100644 --- a/src/idt/mod.rs +++ b/src/idt/mod.rs @@ -2,7 +2,7 @@ use core::mem::size_of; use core::ffi::c_void; use crate::{print, println}; -use crate::io::outb; +use crate::io::{outb, inb}; use crate::keyboard::handle_keypress; const IDT_ENTRY_AMOUT: usize = 256; @@ -236,11 +236,13 @@ extern "C" fn exception_handler(reg: Regs) { #[no_mangle] extern "C" fn irq_handler(reg: Regs) { - if reg.int_no == 1 { - handle_keypress(); + match reg.int_no { + 1 => { handle_keypress(); } + 12 => { inb(0x60); } + _ => { } } - if reg.int_no >= 40 { + if reg.int_no >= 8 { outb(0xA0, 0x20); } outb(0x20, 0x20);