mirror of
https://github.com/phil-opp/blog_os.git
synced 2025-12-16 14:27:49 +00:00
Catch double faults on a separate stack
This commit is contained in:
@@ -107,9 +107,10 @@ impl EntryOptions {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
|
||||||
pub fn set_stack_index(&mut self, index: u16) -> &mut Self {
|
pub fn set_stack_index(&mut self, index: u16) -> &mut Self {
|
||||||
self.0.set_range(0..3, index);
|
// The hardware IST index starts at 1, but our software IST index
|
||||||
|
// starts at 0. Therefore we need to add 1 here.
|
||||||
|
self.0.set_range(0..3, index + 1);
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,8 @@ lazy_static! {
|
|||||||
idt.set_handler(0, handler!(divide_by_zero_handler));
|
idt.set_handler(0, handler!(divide_by_zero_handler));
|
||||||
idt.set_handler(3, handler!(breakpoint_handler));
|
idt.set_handler(3, handler!(breakpoint_handler));
|
||||||
idt.set_handler(6, handler!(invalid_opcode_handler));
|
idt.set_handler(6, handler!(invalid_opcode_handler));
|
||||||
idt.set_handler(8, handler_with_error_code!(double_fault_handler));
|
idt.set_handler(8, handler_with_error_code!(double_fault_handler))
|
||||||
|
.set_stack_index(DOUBLE_FAULT_IST_INDEX as u16);
|
||||||
idt.set_handler(14, handler_with_error_code!(page_fault_handler));
|
idt.set_handler(14, handler_with_error_code!(page_fault_handler));
|
||||||
|
|
||||||
idt
|
idt
|
||||||
|
|||||||
Reference in New Issue
Block a user