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 {
|
2020-07-18 00:50:26 -07:00
|
|
|
IDT.breakpoint.set_handler_fn(breakpoint_handler);
|
2020-07-17 16:51:24 -07:00
|
|
|
IDT.load();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-18 00:50:26 -07:00
|
|
|
extern "x86-interrupt" fn breakpoint_handler(_: &mut InterruptStackFrame) {
|
2020-07-21 13:48:39 -07:00
|
|
|
log::info!("Breakpoint reached!");
|
2020-07-17 16:51:24 -07:00
|
|
|
}
|