What is the purpose of having interrupts in computers?

interrupts done to improve processing efficiency


Explain what is meant by: Program interrupt, Timer interrupt, 1/O interrupt, and Hardware failure interrupt.

Program by condition occurs during execution of the instruction e.g., arithmetic overflow, division by zero.
Timer by a timer within the processor to allow the operating system to perform function on a regular basis
I/O by an I/O controller, to signal normal operation or to signal error condition
Hardware failure by a failure such as power failure

Program Flow of Control (without Interrupts)

Suppose that the processor is transferring data to a printer. After, each write operation, the processor must pause and remain idle until the printer catches up (wasting time of processor with no memory use).

The user program contains series of system calls in form of WRITE calls interleaved with code processing segments,2,3 without use of I/O.

The I/O program consists of:

Untitled


Program Flow of Control with Interrupts & short I/O wait