mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 22:37: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() {
|
pub fn init() {
|
||||||
let mut idt = Idt::new();
|
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(unique)]
|
||||||
#![feature(allocator_api)]
|
#![feature(allocator_api)]
|
||||||
#![feature(global_allocator)]
|
#![feature(global_allocator)]
|
||||||
|
#![feature(abi_x86_interrupt)]
|
||||||
#![no_std]
|
#![no_std]
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user