From d8edfccca42b2c2c938a0875734427204a977098 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Fri, 25 Jan 2019 14:01:29 +0100 Subject: [PATCH] Set the stack_index for the double fault handler --- src/interrupts.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/interrupts.rs b/src/interrupts.rs index f29b4273..08a2a516 100644 --- a/src/interrupts.rs +++ b/src/interrupts.rs @@ -3,7 +3,7 @@ // for a Windows system. #![cfg(not(windows))] -use crate::println; +use crate::{gdt, println}; use lazy_static::lazy_static; use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable}; @@ -12,6 +12,10 @@ lazy_static! { let mut idt = InterruptDescriptorTable::new(); idt.breakpoint.set_handler_fn(breakpoint_handler); idt.double_fault.set_handler_fn(double_fault_handler); + unsafe { + idt.double_fault.set_handler_fn(double_fault_handler) + .set_stack_index(gdt::DOUBLE_FAULT_IST_INDEX); + } idt }; }