forked from koniifer/ableos
fixed segments, timer doesn't double-fault anymore
This commit is contained in:
parent
cc714be94e
commit
11b492d6ce
|
@ -10,7 +10,7 @@ use x86_64::{
|
||||||
pub const DOUBLE_FAULT_IX: u16 = 0;
|
pub const DOUBLE_FAULT_IX: u16 = 0;
|
||||||
|
|
||||||
pub unsafe fn init() {
|
pub unsafe fn init() {
|
||||||
use x86_64::instructions::segmentation::{Segment, CS, DS};
|
use x86_64::instructions::segmentation::{Segment, CS, DS, ES, SS};
|
||||||
use x86_64::instructions::tables::load_tss;
|
use x86_64::instructions::tables::load_tss;
|
||||||
|
|
||||||
log::info!("Initialising GDT");
|
log::info!("Initialising GDT");
|
||||||
|
@ -18,6 +18,8 @@ pub unsafe fn init() {
|
||||||
unsafe {
|
unsafe {
|
||||||
CS::set_reg(GDT.1.kcode);
|
CS::set_reg(GDT.1.kcode);
|
||||||
DS::set_reg(GDT.1.kdata);
|
DS::set_reg(GDT.1.kdata);
|
||||||
|
ES::set_reg(GDT.1.kdata);
|
||||||
|
SS::set_reg(GDT.1.kdata);
|
||||||
load_tss(GDT.1.tss);
|
load_tss(GDT.1.tss);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ extern "x86-interrupt" fn page_fault(
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "x86-interrupt" fn timer(_: InterruptStackFrame) {
|
extern "x86-interrupt" fn timer(_: InterruptStackFrame) {
|
||||||
panic!("make timer not double fault");
|
|
||||||
unsafe { LAPIC.lock().end_of_interrupt() };
|
unsafe { LAPIC.lock().end_of_interrupt() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue