Set the stack_index for the double fault handler

This commit is contained in:
Philipp Oppermann
2019-01-25 14:01:29 +01:00
parent ff25a7d86c
commit d8edfccca4

View File

@@ -3,7 +3,7 @@
// for a Windows system. // for a Windows system.
#![cfg(not(windows))] #![cfg(not(windows))]
use crate::println; use crate::{gdt, println};
use lazy_static::lazy_static; use lazy_static::lazy_static;
use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable}; use x86_64::structures::idt::{ExceptionStackFrame, InterruptDescriptorTable};
@@ -12,6 +12,10 @@ lazy_static! {
let mut idt = InterruptDescriptorTable::new(); let mut idt = InterruptDescriptorTable::new();
idt.breakpoint.set_handler_fn(breakpoint_handler); idt.breakpoint.set_handler_fn(breakpoint_handler);
idt.double_fault.set_handler_fn(double_fault_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 idt
}; };
} }