src/kernel/interrupts/irqs.c
/**
 * Each of the IRQ ISRs point to this function, rather than the 'isr_faultHandler' in 'isrs.c'.
 * The IRQ Controllers need to be told when you are done servicing them, 
 * so you need to send them an "End of Interrupt" command (0x20). 
 * There are two 8259 chips: 
 *      - The first exists at 0x20, 
 *      - the second exists at 0xA0.
 * If the second controller (an IRQ from 8 to 15) gets an interrupt, 
 * you need to acknowledge the interrupt at BOTH controllers, 
 * otherwise, you only send an EOI command to the first controller. 
 * If you don't send an EOI, you won't raise any more IRQs.
 */
Each of the IRQ ISRs point to this function, rather than the 'isr_faultHandler' in 'isrs.c'.
The IRQ Controllers need to be told when you are done servicing them,
so you need to send them an "End of Interrupt" command (0x20).
There are two 8259 chips:
- The first exists at 0x20,
- the second exists at 0xA0.
If the second controller (an IRQ from 8 to 15) gets an interrupt,
you need to acknowledge the interrupt at BOTH controllers,
otherwise, you only send an EOI command to the first controller.
If you don't send an EOI, you won't raise any more IRQs.
Each of the IRQ ISRs point to this function rather than the ' isr_faultHandler ' in ' isrs . c ' . The IRQ Controllers need to be told when you are done servicing them so you need to send them an " End of Interrupt " command ( 0x20 ) . There are two 8259 chips : - The first exists at 0x20 - the second exists at 0xA0 . If the second controller ( an IRQ from 8 to 15 ) gets an interrupt you need to acknowledge the interrupt at BOTH controllers otherwise you only send an EOI command to the first controller . If you don ' t send an EOI you won ' t raise any more IRQs .
void irq_faultHandler(regs_t *r) {
    void (*handler)(regs_t *r);
    handler = irq_routines[r->int_no - 32];
    if (handler)
        handler(r);
    if (r->int_no >= 40)
        outportb(0xA0, 0x20);
    outportb(0x20, 0x20);
}
void irq_faultHandler ( regs_t * r ) { void ( * handler ) ( regs_t * r ) ; handler = irq_routines [ r -> int_no - 32 ] ; if ( handler ) handler ( r ) ; if ( r -> int_no >= 40 ) outportb ( 0xA0 , 0x20 ) ; outportb ( 0x20 , 0x20 ) ; }
Each of the IRQ ISRs point to this function, rather than the 'isr_faultHandler' in 'isrs.c'.
Each of the IRQ ISRs point to this function rather than the ' isr_faultHandler ' in ' isrs . c ' .
// Blank function pointer // If the IRQ has a custom handler, call it /**
     * If the IDT entry that was invoked was greater than 40 (meaning IRQ8 - 15),
     * then we need to send an EOI to the slave controller 
     */