diff --git a/src/lib.rs b/src/lib.rs index 820e6253..ff0e91cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,21 +23,19 @@ use bootloader::BootInfo; const KERNEL_SIZE: usize = 4 << 20; // 4 MB pub fn init(boot_info: &'static BootInfo) { - use x86_64::instructions::read_rip; - let virt_addr = read_rip(); sys::vga::init(); sys::gdt::init(); sys::idt::init(); sys::pic::init(); // Enable interrupts sys::serial::init(); + sys::keyboard::init(); sys::time::init(); let v = option_env!("MOROS_VERSION").unwrap_or(env!("CARGO_PKG_VERSION")); log!("SYS MOROS v{}", v); sys::mem::init(boot_info); - sys::keyboard::init(); // Must not run before MEM sys::acpi::init(); // Require MEM sys::cpu::init(); sys::rng::init(); diff --git a/src/sys/mem.rs b/src/sys/mem.rs index f494df01..539558ab 100644 --- a/src/sys/mem.rs +++ b/src/sys/mem.rs @@ -15,6 +15,7 @@ static MEMORY_SIZE: AtomicU64 = AtomicU64::new(0); static ALLOCATED_FRAMES: AtomicUsize = AtomicUsize::new(0); pub fn init(boot_info: &'static BootInfo) { + sys::idt::set_irq_mask(1); // Mask keyboard interrupt //interrupts::without_interrupts(|| { let mut memory_size = 0; let mut last_end_addr = 0; @@ -60,6 +61,7 @@ pub fn init(boot_info: &'static BootInfo) { sys::allocator::init_heap().expect("heap initialization failed"); //}); + sys::idt::clear_irq_mask(1); } pub fn mapper() -> &'static mut OffsetPageTable<'static> {