Interrupts Interrupts go back to computer industry pioneers Eckert and Mauchly. Interrupts were first used to signal arithmetic overflow on the UNIVAC I and later to alert a UNIVAC 1103 to start online data collection for a wind tunnel. After the success of the first commercial computer, the UNIVAC 1101 in 1953, the first commercial computer to have interrupts, the 1103, was brought out. Interrupts were first used for I/O by A.L. Leiner in the National Bureau of Standards DYSEAC in 1959. As stated above, interrupts were invented to detect arithmetic errors and signal real-time events, but have since then been handed a flock of difficult duties. Here are 11 examples: I/O device request Invoking an operating system service from a user program Tracing instruction execution Breakpoint (programmer-requested interrupt) Arithmetic overflow or underflow Page fault (not in main memory) Misaligned memory access (if alignment is required) Memory-protection violation Using an undefined instruction Hardware malfunctions Power failure Every event on the IBM 360 and 80X86 is called an interrupt, while every event on the 680X0 is called an exception. VAX divides the events into interrupts or exceptions. IBM 360 VAX Motorola 680X0 Intel 80X86 _______________________________________________________________________________ I/O device | input/output | Device |Exception (level |Vectored | interruption | interrupt |0...7 autovector |interrupt _______________________________________________________________________________ Invoking | Supervisor | Exception |Exception |Interrupt operating | call | (change mode|(unimplemented |(INT system from | interruption | supervision |instruction)-on |instruction) user program| | trap) |Macintosh | _______________________________________________________________________________ Tracing | NA | Exception |Exception(trace) |Interrupt instruction | |(trace fault)| |(single-step execution | | | |trap) _______________________________________________________________________________ Breakpoint | NA | Exception |Exception(illegal)|Interrupt | | (breakpoint |instruction or |(breakpoint | | fault) |breakpoint) |trap) _______________________________________________________________________________ Page fault | NA(only in | Exception |Exception(memory |Interrupt (not in main| 370) | |management unit |(page fault) memory) | | |errors) | _______________________________________________________________________________ Arithmetic | Program Inter.| Exception |Exception(floating|Interrupt overflow or | (overflow or | (integer |point coprocessor |(overflow trap underflow | underflow) | overflow) |errors) |or math unit) _______________________________________________________________________________ Misaligned | Program inter.| NA |Exception(address |NA memory | (Specification| |error) | access | exception) | | | _______________________________________________________________________________ Memory | Program inter.| Exception |Exception(bus |Interrupt protection | (protection | (access |error) |(protection violations | exception) | violation | |exception) _______________________________________________________________________________ Using | Program inter.| Exception |Exception(illegal |Interrupt undefined | (operation | (opcode |instruction) |(invalid opcode) instructions| exception) | fault) | | _______________________________________________________________________________ Hardware | Machine-check |Exception |Exception(bus |NA malfunction | interruption |(machine |error) | | |abort) | | _______________________________________________________________________________ Power | Machine-check |Urgent |NA |Nonmaskable failure | interruption |interrupt | |interrupt _______________________________________________________________________________ Names of 11 interrupt classes on four computer families The first four classes are "software" interrupts, and the remaining 7 are "hardware". In today's computers, one expects about an interrupt once every 18,000 instructions. About 60% are software, the remaining 40% hardware. About 1/3 of all interrupts are I/0 interrupts. The events can be characterized on five independent axes: 1. Synchronous versus asynchronous. If the event occurs at the same place every time the program is executed with the same data and memory allocation, the event is synchronous. With the exception of hardware malfunctions, asynchronous events are caused by devices external to the processor and memory. 2. User request versus coerced. If the user task directly asks for it, it is a user-requested event. 3. User maskable versus user nonmaskable. If it can be masked or disabled by a user task, the event is user maskable. 4. Within versus between instructions. This classification depends on whether the event prevents instruction completion by occurring in the middle of execution--no matter how short--or whether it is recognized between instructions. 5. Resume versus terminate. If the program's execution stops after the interrupt, it is a terminating event. _______________________________________________________________________________ Synchron vs User req. User maskable Within vs Resume asynchronous vs coerced vs nonmask between vs term _______________________________________________________________________________ I/O Device Asynchronous Coerced Nonmaskable Between Resume _______________________________________________________________________________ Call op. sys Synchronous Request Nonmaskable Between Resume _______________________________________________________________________________ Tracing Synchronous Request Maskable Between Resume _______________________________________________________________________________ Breakpoint Synchronous Request Maskable Between Resume _______________________________________________________________________________ Page Fault Synchronous Coerced Nonmaskable Within Resume _______________________________________________________________________________ Integer over. Synchronous Coerced Maskable Within Resume _______________________________________________________________________________ Misaligned Synchronous Coerced Maskable Within Terminate _______________________________________________________________________________ Memory prot. Synchronous Coerced Nonmaskable Within Terminate _______________________________________________________________________________ Undefined inst. Synchronous Coerced Nonmaskable Within Terminate _______________________________________________________________________________ Hardware mal. Asynchronous Coerced Nonmaskable Within Terminate _______________________________________________________________________________ Power Fail Asynchronous Coerced Nonmaskable Within Terminate _______________________________________________________________________________