/* in short: map irq 0-15 to int 32-47 */ void irq_remap(){ pic_init(); outb(PIC1_DATA, 0x20); // ICW2: Master PIC vector offset outb(PIC2_DATA, 0x28); // ICW2: Slave PIC vector offset outb(PIC1_DATA, 4); // ICW3: tell Master PIC that there is a slave PIC at IRQ2 (0000 0100) outb(PIC2_DATA, 2); // ICW3: tell Slave PIC its cascade identity (0000 0010) outb(PIC1_DATA, ICW4_8086); outb(PIC2_DATA, ICW4_8086); irq_clear_mask(); }
void irq_configure(void){ // Remap IRQ to avoid conflict with Intel Interrupts (thx IBM) pic_remap(MPIC_IRQ_OFFSET, SPIC_IRQ_OFFSET); irq_clear_mask(1); }
void keyboard_init() { irq_clear_mask(1); }