What's an interrupt?
The key to handling hardware events in a timely manner is for the hardware to generate an interrupt. An interrupt is simply a pause in, or interruption of, whatever the processor was doing, along with a request to do something
else.
Interrupts on multicore systems
On a multicore system, each interrupt is directed to one (and only one) CPU, although it doesn't matter which. How this happens
is under control of the programmable interrupt controller chip(s) on the board. When you initialize the PICs in your system's
startup, you can program them to deliver the interrupts to whichever CPU you want to; on some PICs you can even get the interrupt
to rotate between the CPUs each time it goes off.
Attaching and detaching interrupts
In order to install an ISR, the software must tell the OS that it wishes to associate the ISR with a particular source of
interrupts, which can be a hardware Interrupt Request line (IRQ) or one of several software interrupts. The actual number of interrupts depends on the hardware configuration
supplied by the board's manufacturer. For the interrupt assignments for specific boards, see the sample build files in ${QNX_TARGET}/${PROCESSOR}/boot/build.
Interrupt Service Routine (ISR)
In our example above, the function serint() is the ISR. In general, an ISR is responsible for:
Running out of interrupt events
If you're working with interrupts, you might see an Out of Interrupt Events error. This happens when the system is no longer able to run user code and is stuck in the kernel, most frequently because:
Problems with shared interrupts
It's possible for different devices to share an interrupt (for example if you've run out of hardware interrupt lines), but
we don't recommend you do this with hardware that will be generating a lot of interrupts. We also recommend you not share
interrupts with drivers that you don't have complete source control over, because you need to be sure that the drivers process
interrupts properly.
Advanced topics
Now that we've seen the basics of handling interrupts, let's take a look at some more details and some advanced topics.