Interrupt service routine
In Computer Science the term Interrupt service routine is used when discussing the internal operations of operating systems.[1]
Modern computers are designed to execute multiple computer programs, at a time. In the mid to late 20th century computers generally only ran one program at a time. But, even then, to make the management of software practical computer programmers were taught to avoid specifically programming that particularly addressed the computer's hardware. Programmers were taught to rely on interfaces between their programs and the computer's hardware. The computer's manufacturer would provide a special purpose program that handled that particular computer's hardware. This special purpose program is the computer's operating system, although in the days when a computer only ran a single program at a time it was sometimes called the monitor.
When a computer is turned on the operating system always has to be the first program to be loaded. The process of loading an operating system is called "booting the system".
In the early days of computing, when computers ran just one program at a time it would be the job of the operating system, or monitor, to load that user program. Once it was loaded it would direct the computer to start executing the first instruction in the user program. The user program would continue to execute its instructions, one at a time.
Badly written programs, programs with an "endless loop", could sit there, indefinitely, not doing anything, requiring a manual reboot.
Well behaved programs would always return control to the operating system. Well behaved programs generate output and need input. Generating output, to a printer, or computer screen, or computer file on a disk is a hardware operation, and requires handing control back to the operating system. User programs would format the data to be output, and then invoke a system call. Calling system calls looked just like calling a subroutine. The manufacturer's manual would describe the parameters the system call required. The operating system would handle the hardware details required to perform the operation on its particular hardware -- and then return control back to the program, possibly with a return code to inform the program as to whether the operation was successful. Similarly, programs invoked system calls to request input.
Hardware devices, like printers, disks, modems, monitors, mice, microphones, cameras all operate more slowly than the computer's CPU can execute. So the CPU can return control to the user program, while it waits for the external device to interrupt it.
References
[edit | edit source]- ↑
Valentin Rothberg (2015-11-08). "Interrupt Handling in Linux" (PDF). University of Erlangen, Germany. Archived from the original (PDF) on 2022-12-26. Retrieved 2026-09-13.
When the processor receives an interrupt signal, it may temporarily switch control to an interrupt service routine (ISR) and the suspended process (i.e., the previously running program) will be resumed as soon as the interrupt is being served.