I/O APIC Keyboard IRQ1 keeps firing
Posted: Sat Jun 05, 2010 3:21 pm
Hello Everyone,
I'm attempting to switch from using the legacy PIC to the fancy I/O APIC and right now I've got the LAPIC set up correctly with the timer interrupt firing properly. However, when I set up the I/O APIC to fire IRQ1 for the keyboard I get hundreds of IRQ1s. They just keep coming.
To setup the I/O APIC for IRQ1 I set the table entry #1 (0x12 - 0x13 offset) to 0x0000000000000021.
Anyway, is there some EOI register on the I/O APIC ?
When I set up the IRQ1 through the PIC I only got an interrupt when I actually pressed a key. Weird. Any help is appreciated. Thanks.
I'm attempting to switch from using the legacy PIC to the fancy I/O APIC and right now I've got the LAPIC set up correctly with the timer interrupt firing properly. However, when I set up the I/O APIC to fire IRQ1 for the keyboard I get hundreds of IRQ1s. They just keep coming.
To setup the I/O APIC for IRQ1 I set the table entry #1 (0x12 - 0x13 offset) to 0x0000000000000021.
Anyway, is there some EOI register on the I/O APIC ?
Code: Select all
void __declspec(naked) KBDHandler()
{
__asm pushad;
__asm cli;
scancode = inportb(0x60);
kprintf("%X", scancode); // Print scancode
(*(dword*)(g_LAPIC_Base + 0x0B)) = 0; // Send EOI
__asm sti;
__asm popad;
__asm iretd;
}