summaryrefslogtreecommitdiff
path: root/kernel/src/interrupts/idt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/src/interrupts/idt.rs')
-rw-r--r--kernel/src/interrupts/idt.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/kernel/src/interrupts/idt.rs b/kernel/src/interrupts/idt.rs
index 8cd01d0..3eb9724 100644
--- a/kernel/src/interrupts/idt.rs
+++ b/kernel/src/interrupts/idt.rs
@@ -5,8 +5,14 @@ use x86_64::structures::idt::InterruptDescriptorTable;
lazy_static! {
static ref IDT: InterruptDescriptorTable = {
let mut idt = InterruptDescriptorTable::new();
+ for i in 32..255 {
+ idt[i].set_handler_fn(dummy_handler);
+ }
+
idt.breakpoint
.set_handler_fn(exception_handlers::breakpoint_handler);
+ idt.divide_by_zero
+ .set_handler_fn(exception_handlers::div_zero_handler);
idt.segment_not_present
.set_handler_fn(exception_handlers::segment_not_present_handler);
idt.general_protection_fault
@@ -25,6 +31,12 @@ lazy_static! {
};
}
+pub extern "x86-interrupt" fn dummy_handler(
+ stack_frame: &mut x86_64::structures::idt::InterruptStackFrame,
+) {
+ panic!("unhandled interrupt recieved");
+}
+
pub fn init() {
IDT.load()
}