mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Create and load an IDT
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
use x86_64::structures::idt::{Idt, ExceptionStackFrame};
|
||||
|
||||
pub fn init() {
|
||||
lazy_static! {
|
||||
static ref IDT: Idt = {
|
||||
let mut idt = Idt::new();
|
||||
idt.breakpoint.set_handler_fn(breakpoint_handler);
|
||||
idt
|
||||
};
|
||||
}
|
||||
|
||||
pub fn init() {
|
||||
IDT.load();
|
||||
}
|
||||
|
||||
extern "x86-interrupt" fn breakpoint_handler(
|
||||
|
||||
Reference in New Issue
Block a user