Enabling Interrupts Causes ISR 12
Posted: Tue Jun 07, 2016 4:19 pm
I think the title is self-explanatory. After executing sti, I receive ISR 12.
http://wiki.osdev.org/I_Can%27t_Get_Interrupts_Working says that I need to check if I remapped the PIC. However, it seems to be fine:
What other information could I attach to help someone help me fix this issue?
http://wiki.osdev.org/I_Can%27t_Get_Interrupts_Working says that I need to check if I remapped the PIC. However, it seems to be fine:
Code: Select all
#include <asm.h>
#define PIC_1_CTRL 0x20
#define PIC_2_CTRL 0xA0
#define PIC_1_DATA 0x21
#define PIC_2_DATA 0xA1
void pic_initialize()
{
// IWC 1 - Enable initialization
outb (PIC_1_CTRL, 0x11);
outb (PIC_2_CTRL, 0x11);
// ICW 2 - Map IRQ interrupt numbers
outb (PIC_1_DATA, 0x20); // IRQs 0-7 mapped to interrupts 32-39
outb (PIC_2_DATA, 0x28); // IRQs 8-15 mapped to interrupts 40-47
// ICW 3 - Cascade PICs on IR line 2
outb (PIC_1_DATA, 0x4);
outb (PIC_2_DATA, 0x2);
// ICW 4 - Turn on x86 mode
outb (PIC_1_DATA, 1);
outb (PIC_2_DATA, 1);
// Null out data registers
outb (PIC_1_DATA, 0);
outb (PIC_2_DATA, 0);
// mask everything to show that this isn't an incorrectly mapped IRQ
outb (PIC_1_DATA, 0xFF);
outb (PIC_2_DATA, 0xFF);
}