Add a simple handler function for the breakpoint exception

This commit is contained in:
Philipp Oppermann
2017-04-18 15:14:27 +02:00
parent c2d22af1c7
commit 3bbc2a0bdc
2 changed files with 9 additions and 1 deletions

View File

@@ -1,5 +1,12 @@
use x86_64::structures::idt::Idt;
use x86_64::structures::idt::{Idt, ExceptionStackFrame};
pub fn init() {
let mut idt = Idt::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

@@ -5,6 +5,7 @@
#![feature(unique)]
#![feature(allocator_api)]
#![feature(global_allocator)]
#![feature(abi_x86_interrupt)]
#![no_std]