initial apic implementaion (Commented out / NOT WORKING)
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
use libk::drivers::apic::enable_apic;
|
||||
use libk::drivers::pic::ChainedPics;
|
||||
use libk::prelude::*;
|
||||
use x86_64::registers::control::Cr2;
|
||||
use x86_64::structures::idt::{InterruptDescriptorTable, InterruptStackFrame, PageFaultErrorCode};
|
||||
|
||||
use pic8259::ChainedPics;
|
||||
use spin::{Lazy, Mutex};
|
||||
|
||||
use super::gdt;
|
||||
@@ -21,8 +22,8 @@ static IDT: Lazy<InterruptDescriptorTable> = Lazy::new(|| {
|
||||
.set_handler_fn(general_protection_fault_handler);
|
||||
idt.page_fault.set_handler_fn(page_fault_handler);
|
||||
|
||||
idt[InterruptIndex::Timer.as_u8()].set_handler_fn(timer_interrupt_handler);
|
||||
idt[InterruptIndex::Keyboard.as_u8()].set_handler_fn(keyboard_interrupt_handler);
|
||||
// idt[InterruptIndex::Timer.as_u8()].set_handler_fn(timer_interrupt_handler);
|
||||
// idt[InterruptIndex::Keyboard.as_u8()].set_handler_fn(keyboard_interrupt_handler);
|
||||
idt
|
||||
});
|
||||
|
||||
@@ -51,6 +52,8 @@ impl InterruptIndex {
|
||||
|
||||
pub fn init_idt() {
|
||||
IDT.load();
|
||||
// enable_apic();
|
||||
// TODO: fix apic
|
||||
unsafe {
|
||||
PICS.lock().initialize();
|
||||
PICS.lock().write_masks(0xfc, 0xff);
|
||||
|
||||
Reference in New Issue
Block a user