diff --git a/kernel/cpu/irq.c b/kernel/cpu/irq.c index 7df356ca..3046b555 100644 --- a/kernel/cpu/irq.c +++ b/kernel/cpu/irq.c @@ -11,6 +11,7 @@ #include #include #include +#include /* Programmable interrupt controller */ #define PIC1 0x20 @@ -153,10 +154,13 @@ void irq_install(void) { * they were set to level triggered in expectation * of an IO APIC taking over... */ + if (!args_present("noelcr")) { #if 0 - outportb(0x4D0, 0x00); + outportb(0x4D0, 0x00); #endif - outportb(0x4D1, (1 << (10-8)) | (1 << (11-8))); + uint8_t val = inportb(0x4D1); + outportb(0x4D1, val | (1 << (10-8)) | (1 << (11-8))); + } } void irq_ack(size_t irq_no) { diff --git a/kernel/main.c b/kernel/main.c index 20c396b9..10514de5 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -94,8 +94,6 @@ int kmain(struct multiboot *mboot, uint32_t mboot_mag, uintptr_t esp) { /* Initialize core modules */ gdt_install(); /* Global descriptor table */ idt_install(); /* IDT */ - isrs_install(); /* Interrupt service requests */ - irq_install(); /* Hardware interrupt requests */ uintptr_t last_mod = (uintptr_t)&end; if (mboot_ptr->flags & MULTIBOOT_FLAG_MODS) { @@ -168,6 +166,9 @@ int kmain(struct multiboot *mboot, uint32_t mboot_mag, uintptr_t esp) { args_parse(cmdline); } + isrs_install(); /* Interrupt service requests */ + irq_install(); /* Hardware interrupt requests */ + vfs_install(); tasking_install(); /* Multi-tasking */ timer_install(); /* PIC driver */