Google Search

Monday, November 2, 2015

INTERRUPTS

Virtually all computers provide a mechanism by which other modules (I/O, memory)
may interrupt the normal sequencing of the processor. Table 1.1 lists the most
common classes of interrupts.

Interrupts are provided primarily as a way to improve processor utilization.
For example, most I/O devices are much slower than the processor. Suppose that
the processor is transferring data to a printer using the instruction cycle scheme of
. After each write operation, the processor must pause and remain idle
until the printer catches up. The length of this pause may be on the order of many
thousands or even millions of instruction cycles. Clearly, this is a very wasteful use
of the processor.

To give a specific example, consider a PC that operates at 1 GHz, which would
allow roughly 10 9 instructions per second. 2 A typical hard disk has a rotational
speed of 7200 revolutions per minute for a half-track rotation time of 4 ms, which is
4 million times slower than the processor.

A sequence of instructions,  to prepare for the actual
I/O operation. This may include copying the data to be output into a special
buffer and preparing the parameters for a device command.

• The actual I/O command. Without the use of interrupts, once this command
is issued, the program must wait for the I/O device to perform the requested
function (or periodically check the status, or poll, the I/O device). The program
might wait by simply repeatedly performing a test operation to determine if
the I/O operation is done.

• A sequence of instructions, to complete the operation.
This may include setting a flag indicating the success or failure of the operation.


Program => Generated by some condition that occurs as a result of an instruction execution, such as
arithmetic overflow, division by zero, attempt to execute an illegal machine instruction,
and reference outside a user’s allowed memory space.

Timer => Generated by a timer within the processor. This allows the operating system to perform
certain functions on a regular basis.

I/O =>  Generated by an I/O controller, to signal normal completion of an operation or to signal
a variety of error conditions.

Hardware failure => Generated by a failure, such as power failure or memory parity error.

No comments:

Post a Comment