Operating System Design/Processes/Interrupt

< Operating System Design < Processes

Many pieces of hardware send interrupt signals to the CPU. When the CPU notices that signal, it does a hardware interrupt ‒ the CPU performs a context switch, saving some information about what it was doing, then jumps to execute the "interrupt handler" associated with that particular hardware interrupt. For example, when a user type into a keyboard, the keyboard sends a key interrupt. The CPU then executes code for a key interrupt, which typically displays a character on a screen or performs a task.

Perhaps the most important interrupt for operating system design is the "timer interrupt", which is emitted at regular intervals by a timer chip.

A software interrupt, also called a processor generated interrupt, is generated by the processor executing a specific instruction. Common processor-generated-interrupts are the divide-by-zero exception and the general-fault or page-fault exception. Software interrupts cause a context switch to an interrupt handler similar to a hardware interrupt.

Some interrupt handler software might reset the machine, or just display the error, but most interrupt handlers do one of 3 things:

Further Reading

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.