Docsity

Interrupt Masks, Handler - Computer Architecture - Lecture Slides, Slides of Computer Architecture and Organization

Partial preview of the text

Download Interrupt Masks, Handler - Computer Architecture - Lecture Slides and more Slides Computer Architecture and Organization in PDF only on Docsity!

  • In an interrupt I/O system, deadlines put

restriction on how long interrupts may

remain disable.

  • The deadline establish a priority among

interrupt requests.

  • Devices with shorter deadlines should be

acknowledged first.

  • Daisy-chained acknowledge signal

partially solves the problem.

  • The solution is to allow high-priority devices to interrupt lower- priority handlers.
  • It is necessary that interrupts should be enabled at some time during interrupt handler execution.
  • Nested interrupts allow an interrupt handler to be interrupted.
  • Critical section is a code sequence in the

dandler during which a second interrupt

would interfere.

  • In SRC, interrupts must be remain

disabled until the IPC and II registers are

saved.

  • Also, the devices with lower-priority, are

disabled before enabling interrupts.

Steps in the Response of a Nested Interrupt Handler:

(1) Save the state changed by interrupt (IPC

and II);

(2) Disable lower priority interrupts;

(3) Reenable exception processing;

(4) Service interrupting device;

(2) Disable lower priority interrupts

(5) Disable exception processing;

Interrupt Masks for Executing Device j Handler

  • A priority interrupt scheme could be managed using device-enable bits.
  • Order the bits from left to right in order of increasing priority to form an interrupt mask.
  • The priority mask should be distinct from

individual enables.

  • The value of a mask of the preceding

priority form is determined by the interrupt-

level j of the current handler.

  • The interrupt-level mask should be

different from a simple collection of enable

bits.

For the devices of same priority:

  • A daisy-chained acknowledge is needed to arbitrate simultaneous requests.
  • Order of devices on the chain is not important within the group.
  • Priority Interrupt Mechanism is a separate

subsystem.

  • Many Commercial processors have a

priority mechanism built into their

exception response.

  • Example: Motorola MC

Problem statement:

Assume that three I/O devices are connected to

a 32-bit, 10 MIPS CPU.The first device is a hard

drive with a maximum transfer rate of 1MB/sec

using a 32-bit bus. The second device is a floppy

drive with a transfer rate of 25KB/sec over a 16-

bit bus, and the third device is a keyboard that

must be polled thirty times per second.

Assuming that the polling operation takes 20

instructions for each I/O device, determine the

percentage of CPU time required to poll each

device.

Solution for floppy drive:

For floppy disk :

Data transfer rate =25K/

half-words/sec.

Number of CPU = 12.5 * 2

instructions = 256000

required

The % of CPU time = ( 0.256 * 10

required for polling = 2.56%

Solution for Key board:

For the keyboard

The number of instructions = 30 * 20

required for polling = 600 inst./sec

Therefore,

% of CPU time = 600 / (10 * 106)

spent in polling =0.006%

Solution a:

Assume:

• The I/O requests are distributed evenly in

time.

• The average time that a device will have to

wait for the processor to poll is half the time

between polling attempts.

Therefore, to provide an average delay of 10 ms,

the processor will have to poll every 20 ms, or 50

times per second.

Solution b

If each polling attempt takes 10,

cycles, then the processor will spend

500,000 cycles polling each second.

% of CPU time = (0.5*

spent polling =0.5%