IRQs
Re:IRQs
all you need to do is create dead handlers for all 16 of them, and change the handlers for the ones you need.
-- Stu --
Re:IRQs
Here's some code from my operating system "Giggle":
Code: Select all
/* enable_irq()
* sends command to PIC to enable an IRQ
*/
void enable_irq(int irq)
{
ocw1 &= ~(1 << irq); /* enable propriate bit with shifting to left
invert the thing to enable the interrupt
use AND operation to leave the other bits
as they are
*/
if (irq < 8)
outb(PIC1 + 1, ocw1&0xFF); /* AND with 0xFF to clear the high 8
bits because we send to PIC1
*/
else
outb(PIC2 + 1, ocw1 >> 8); /* move high 8 bits to low 8 bits
since we send to PIC2
*/
}
/* disable_irq()
* sends a command to PIC to disable an IRQ
*/
void disable_irq(int irq)
{
ocw1 |= (1 << irq); /* shift left to disable the propriate bit
OR to not change the mask
*/
if (irq < 8)
outb(PIC1 + 1, ocw1&0xFF); /* AND with 0xFF to clear the
high 8 bits since we send to PIC1
*/
else
outb(PIC2 + 1, ocw1 >> 8); /* move high 8 bits to low 8 bits since
we send to PIC2
*/
}
Re:IRQs
an IRQ is a hardware triggered ISR.
basically is software fired interrupt routine, irq is hardware triggered interrupt routine.
there is 16 IRQ's, the top 8 are cascaded through one of the bottom 8.. i forget which. there is info int he faq on this
basically is software fired interrupt routine, irq is hardware triggered interrupt routine.
there is 16 IRQ's, the top 8 are cascaded through one of the bottom 8.. i forget which. there is info int he faq on this
-- Stu --
Re:IRQs
As Tim was saying, an ISR is the actual code that handles interrupts.
IRQ's are the actual hardware triggers themselves. An interrupt is simply a mechanism whereby a piece of hardware can notify the OS that an operation has completed, for example a disk transfer or communications request.
Don't get confused with interrupts that are used for system calls, they are similar but are not generated for hardware.
IRQ's are the actual hardware triggers themselves. An interrupt is simply a mechanism whereby a piece of hardware can notify the OS that an operation has completed, for example a disk transfer or communications request.
Don't get confused with interrupts that are used for system calls, they are similar but are not generated for hardware.