Create a new IDT

This commit is contained in:
Philipp Oppermann
2019-01-25 13:49:09 +01:00
parent ade6c99885
commit 9448b0e025
2 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,11 @@
use x86_64::structures::idt::InterruptDescriptorTable;
use crate::println;
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable};
pub fn init_idt() {
let mut idt = InterruptDescriptorTable::new();
idt.breakpoint.set_handler_fn(breakpoint_handler);
}
extern "x86-interrupt" fn breakpoint_handler(stack_frame: &mut ExceptionStackFrame) {
println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame);
}

View File

@@ -1,4 +1,5 @@
#![cfg_attr(not(test), no_std)]
#![feature(abi_x86_interrupt)]
pub mod interrupts;
pub mod serial;