bootproof/src/arch/x86_64/idt.rs

15 lines
385 B
Rust
Raw Normal View History

2020-07-17 16:51:24 -07:00
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
static mut IDT: InterruptDescriptorTable = InterruptDescriptorTable::new();
pub fn load() {
unsafe {
IDT.breakpoint.set_handler_fn(breakpoint_handler);
2020-07-17 16:51:24 -07:00
IDT.load();
}
}
extern "x86-interrupt" fn breakpoint_handler(_: InterruptStackFrame) {
log::info!("Breakpoint reached!");
2020-07-17 16:51:24 -07:00
}