Create a static IDT with a page fault handler function

This commit is contained in:
Philipp Oppermann
2016-05-28 15:26:20 +02:00
parent b84c5822df
commit c65b16f42d

View File

@@ -1 +1,20 @@
mod idt; mod idt;
lazy_static! {
static ref IDT: idt::Idt = {
let mut idt = idt::Idt::new();
idt.set_handler(14, page_fault_handler);
idt
};
}
pub fn init() {
IDT.load();
}
extern "C" fn page_fault_handler() -> ! {
println!("EXCEPTION: PAGE FAULT");
loop {}
}