mirror of
https://github.com/XunilGroup/XunilOS.git
synced 2026-04-25 11:49:03 +02:00
serial writer always centering and assuming, added a margin for correct displaying. Added the IDT and GDT tables, and the TSS so double faults cant happen. Handled all of these interrupts using functions. Serial console is now topleft and panic messages are formatted correctly from there. core PI constant is now used instead of our own.
24 lines
603 B
Rust
24 lines
603 B
Rust
use crate::arch::x86_64::{
|
|
gdt,
|
|
interrupts::{breakpoint_handler, double_fault_handler},
|
|
};
|
|
use lazy_static::lazy_static;
|
|
use x86_64::structures::idt::InterruptDescriptorTable;
|
|
|
|
lazy_static! {
|
|
static ref IDT: InterruptDescriptorTable = {
|
|
let mut idt = InterruptDescriptorTable::new();
|
|
idt.breakpoint.set_handler_fn(breakpoint_handler);
|
|
unsafe {
|
|
idt.double_fault
|
|
.set_handler_fn(double_fault_handler)
|
|
.set_stack_index(gdt::DOUBLE_FAULT_IST_INDEX);
|
|
}
|
|
idt
|
|
};
|
|
}
|
|
|
|
pub fn init_idt_x86_64() {
|
|
IDT.load();
|
|
}
|