mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Create a new IDT
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
use x86_64::structures::idt::InterruptDescriptorTable;
|
use crate::println;
|
||||||
|
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable};
|
||||||
|
|
||||||
pub fn init_idt() {
|
pub fn init_idt() {
|
||||||
let mut idt = InterruptDescriptorTable::new();
|
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#![cfg_attr(not(test), no_std)]
|
#![cfg_attr(not(test), no_std)]
|
||||||
|
#![feature(abi_x86_interrupt)]
|
||||||
|
|
||||||
pub mod interrupts;
|
pub mod interrupts;
|
||||||
pub mod serial;
|
pub mod serial;
|
||||||
|
|||||||
Reference in New Issue
Block a user