mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Add a simple handler function for the breakpoint exception
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#![feature(unique)]
|
||||
#![feature(allocator_api)]
|
||||
#![feature(global_allocator)]
|
||||
#![feature(abi_x86_interrupt)]
|
||||
#![no_std]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user