Skip to content

Commit

Permalink
Mask keyword interrupt instead of loading the module later
Browse files Browse the repository at this point in the history
  • Loading branch information
vinc committed Oct 18, 2024
1 parent e40526f commit 1dfe500
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 2 additions & 0 deletions src/sys/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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> {
Expand Down

0 comments on commit 1dfe500

Please sign in to comment.