0% found this document useful (0 votes)
16 views

Interrupt Driven Io

Uploaded by

deviumak1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Interrupt Driven Io

Uploaded by

deviumak1989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Basic Operations of

Interrupt

1. CPU issues read command.


2. I/O module gets data from peripheral whilst CPU does other work.
3. I/O module interrupts CPU.
4. CPU requests data.
5. I/O module transfers data.

Interrupt Processing
1. A device driver initiates an I/O request on behalf
of a process.
2. The device driver signals the I/O controller for the
proper device, which initiates the requested I/O.
3. The device signals the I/O controller that is ready
to retrieve input, the output is complete or that an
error has been generated.
4. The CPU receives the interrupt signal on the
interrupt-request line and transfer control over the
interrupt handler routine.
5. The interrupt handler determines the cause of the
interrupt, performs the necessary processing and
executes a “return from” interrupt instruction.
6. The CPU returns to the execution state prior to the
interrupt being signaled.
7. The CPU continues processing until the cycle
begins again.
Advantages & Disadvantages of
Interrupt Drive I/O
Advantages - fast
- efficient
Disadvantages - can be tricky to write if using a low level language
- can be tough to get various pieces to work well together
- usually done by the hardware manufacturer / OS maker, e.g.
Microsoft

Design Issues
There are 2 main problems for interrupt I/O, which are:

• There are multiple I/O modules, how should the processor determine the device that
issued the interrupt signal?
• How does the processor decide which module to process when multiple interrupts
have occurred?

There are 4 main ways to counter these problems, which are:

• Multiple Interrupt Lines


• Software Poll
• Daisy Chain (Hardware Poll, Vectored)
• Bus Arbitration (Vectored)

These are known as the 4 general categories of techniques that are commonly used in I/O
interrupt.
Multiple Interrupt Lines
As the name suggests, we provide multiple interrupt lines between the processor and the I/O
modules. This allows multiple modules to be handled at the same time. However, it is not
practical to assign many bus lines and processor pins to interrupt lines. One of the reasons is
that there might be more than one I/O module attached to a single line. This defeats the
purpose of this technique. The 3 techniques of the latter are usually used together with this
technique to rectify its’ problems.
Software Poll
Whenever an interrupt is detected by the processor, it branches to an interrupt service routine
which will poll each and every I/O module to determine the exact interrupting module. The
processor raises a poll which could be in the form of a command line. Consequently, the
address of the respective I/O module which is interacted by the poll will be placed on the
address line. The module will respond positively if it is responsible for setting the interrupt.
On the other hand, every I/O module has an addressable status register. This register can be
read by the processor to determine the interrupting module. After that, the processor is then
branched to a specific device-service routine. The downside to this techniques is that it is
time consuming.
Daisy Chain (Hardware Poll, Vectored)
This is actually a hardware poll. The interrupt acknowledge line is daisy chained to all the
modules. Whenever there is an interrupt, the processor send out an interrupt acknowledge
which will propagate throughout the series of I/O modules. This process will continue until it
reaches a requesting module. The module will respond by placing a word on the data lines.
The word is known as vector. This vector can either be the address of the module or a
specific identifier. The processor subsequently directs the module to its’ specific device-
service routine based on its’ vector. This technique is also known as the vectored interrupt. It
completely removes the need for interrupt-service routine.
Bus Arbitration (Vectored)
The last method which also utilizes vectored interrupts is bus arbitration. This method
involves the I/O module gaining control over the bus before requesting for the interrupt. This
is limited to only one module at a time. The processor sends an acknowledge signal whenever
it detects an interrupt. The requesting module then places its’ vector on the data lines.
However, when there are multiple interrupts at a single time, there will be a need to assign
priorities. These 4 methods have their own way of assigning priorities:

• Multiple Interrupt Lines: The processor picks the interrupt line with highest priority.
• Software Poll: The priority is determined by the order in which the modules are
polled.
• Daisy Chain (Hardware Poll, Vectored): The priority is determined by the order in
which the modules are polled.
• Bus Arbitration (Vectored): Employs a priority scheme.

You might also like