Abstract:
In general an interrupt is a hardware mechanic or flag that forces a break or pause in the currently running software to force some high priority software to be ran
Maskable vs Non-Maskable Interrupts:
A Non-Maskable Interrupt is an interrupt that you can NOT ignore. It forces the system to stop and deal with the interrupt
Operating System Level
A context switch will occur to take us from user mode to kernel mode, only when an interrupt is generated, indicating there is I/O activity to be serviced by the processor.
This leads to a minimal amount of busy-waiting

Interrupt Handling in Linux
Look at the /proc/interrupts file
- An interrupt handler is registered with the
request_irq()function - Required parameters include the interrupt number, the handler function, and the associated device name
- While the system is servicing one interrupt, another interrupt may arrive concurrently, Some interrupt handlers may be interrupted, i.e. , they are re-entrant. Others may not eb interrupted.
•The OS has an interrupt vector table, listing the entry point of the interrupt handler for each interrupt •When an interrupt occurs, the processor automatically switches mode and jumps to the appropriate interrupt handler routine •It’s a bit like a function call - the old context is saved automatically and the interrupt handler executes in a fresh stack frame (normally on a different stack altogether) •After the interrupt, it’s possible to return to the old context (if appropriate) or somewhere else
System Timer
The timer hardware sends an interrupt at a configurable interval, known as a jiffy in Linux
every time the timer interrupt occurs the value of the variable ‘jiffies’ is incremented.
•grep "jiffies:" /proc/timer_list | head -n 1
The interrupt handler for the timer is responsible for preemptive multi-tasking - ensuring the OS can execute many tasks concurrently
Older OSs used cooperative multi-tasking - tasks had to cede control back to the OS when requested