15 lines
385 B
Rust
15 lines
385 B
Rust
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};
|
|
|
|
static mut IDT: InterruptDescriptorTable = InterruptDescriptorTable::new();
|
|
|
|
pub fn load() {
|
|
unsafe {
|
|
IDT.breakpoint.set_handler_fn(breakpoint_handler);
|
|
IDT.load();
|
|
}
|
|
}
|
|
|
|
extern "x86-interrupt" fn breakpoint_handler(_: InterruptStackFrame) {
|
|
log::info!("Breakpoint reached!");
|
|
}
|