mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37:49 +00:00
Create a static IDT with a page fault handler function
This commit is contained in:
@@ -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 {}
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user