diff options
| author | Natasha Moongrave <natasha@256phi.eu> | 2026-02-18 20:11:20 +0100 |
|---|---|---|
| committer | Natasha Moongrave <natasha@256phi.eu> | 2026-02-18 20:11:20 +0100 |
| commit | a95f1b399f30fe4dc74b2c04392e12cd875fe7f5 (patch) | |
| tree | 12796972f8cbf16b92e668ccae689dfa49812643 | |
| parent | 8b5879660db9f5897800b46d8bc30444c0b17f16 (diff) | |
added handling for double stack extensions
| -rw-r--r-- | StrixKernel/src/interrupts.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/StrixKernel/src/interrupts.rs b/StrixKernel/src/interrupts.rs index 6c44f59..e55aa13 100644 --- a/StrixKernel/src/interrupts.rs +++ b/StrixKernel/src/interrupts.rs @@ -7,7 +7,8 @@ use lazy_static::lazy_static; lazy_static! { static ref IDT: InterruptDescriptorTable = { let mut idt = InterruptDescriptorTable::new(); - idt.breakpoint.set_handler_fn(breakpoint_handler); + idt.breakpoint.set_handler_fn(breakpoint_handler); // breakpoint exception handler + idt.double_fault.set_handler_fn(double_fault_handler); // double fault exception handler // IMPORTANT (if not implemented would cause a triple fault and thus a system reset which is bad) idt }; } @@ -16,12 +17,21 @@ pub fn init_idt() { IDT.load(); } +// Breakpoint exception extern "x86-interrupt" fn breakpoint_handler( stack_frame: InterruptStackFrame) { println!("EXCEPTION: BREAKPOINT\n{:#?}", stack_frame); } +// Double fault exception +extern "x86-interrupt" fn double_fault_handler( + stack_frame: InterruptStackFrame, _error_code: u64) -> ! +{ + panic!("EXCEPTION: DOUBLE FAULT\n{:#?}", stack_frame); +} + + // TESTS // #[test_case] |
