Interrupts
2024-12-05
You are expecting a visitor –
how do you know when to open the door?
You are moderating a discussion –
how do you make sure that everyone has time to speak?
I am giving an online presentation but forget to share my screen –
what can you do?
“Interrupts are an unpleasant fact of life; although they cannot be avoided, they should be hidden away, deep in the bowels of the operating system, so that as little of the operating system as possible knows about them.”
(Andrew S. Tanenbaum)
What reasons (sources) for an interrupt can you imagine?
Caution!
The terms interrupt, exception, or trap are used and defined slightly differently in the literature or documentation of the hardware manufacturers.
Faults
Error situation (error caused by an arithmetic operation)
Division by zero, floating point error, address errors, …
Trap or Software Interrupt
Triggered by a process \(\Rightarrow\) synchronous interrupt
Examples are the exception 0x80 to switch from user mode to kernel mode and the single-stepping mode during program test (debugging, trace)
How could we implement this timeout for process X?
Process X gets blocked until the message is acknowledged or the timeout expires
If the acknowledgement arrives, sender process X may continue
Disadvantage: Long idle times for process X arise
After process X sent the message it continues to operate normally
The \(\rightarrow\) context of the process is saved and a procedure for interrupt handling is called
In the example the procedure would send the message again
If the execution of the procedure has finished the process becomes reactivated
Subprograms without return value are typically called procedures. Subprograms with return value are called functions or methods.
Software instruction which causes an (intended) change of operation mode
\(\longrightarrow\) System calls
processor synchronous
An interrupt source generates an Interrupt Request (IRQ)
IRQs are received by a Programmable Interrupt Controller (PIC) (for ARM CPUs Vectored Interrupt Controller (VIC))
This controller determines the maximum number of different IRQs
It also manages and prioritizes the interrupts
Interrupts are strictly processed one after the other
Interrupts are never interrupted
Advantage: Simpler software design
Drawback: Priorities and time-critical reactions are ignored
The real-time operating systems QNX Neutrino and Windows CE 5.0 both support nested interrupts
http://www.qnx.com/developers/docs/660/topic/com.qnx.doc.neutrino.sys_arch/topic/kernel_Nested_interrupts.html
http://msdn.microsoft.com/de-de/library/ms892539.aspx
An interrupt request (IRQ) indicates an event and the operating system provides an event handler, the so called interrupt service routine (ISR)
Example: character transmission
You should now be able to answer the following questions:
Operating Systems - Interrupts - WS 24/25