Skip to content

Commit

Permalink
double fault handlerのstack indexを設定
Browse files Browse the repository at this point in the history
  • Loading branch information
AtsukiTak committed Oct 14, 2019
1 parent 5875f18 commit 562badd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/interrupts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
//! `x86-interrupt` 呼び出し規約はまだ安定化されていないので、 `#![feature(abi_x86_interrupt)]` を
//! `lib.rs` フィアルの先頭に追加する必要がある。
use crate::println;
use crate::{gdt::tss, println};
use lazy_static::lazy_static;
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame};

Expand All @@ -63,7 +63,12 @@ lazy_static! {
static ref IDT: InterruptDescriptorTable = {
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)
// double fault handler が呼び出されたときに使用する
// スタック領域を設定。
.set_stack_index(tss::DOUBLE_FAULT_IST_INDEX);
}
idt
};
}
Expand Down

0 comments on commit 562badd

Please sign in to comment.