bootproof/src/arch/x86_64/idt.rs

17 lines
439 B
Rust
Raw Normal View History

use crate::graphics::tty::Tty;
use crate::println;
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(_: &mut InterruptStackFrame) {
println!("Breakpoint reached!");
2020-07-17 16:51:24 -07:00
}