6 IRQ Controller

21
Computer Hardware Computer Hardware Unit 20 Unit 20 2 nd nd  Year National Diploma  Year National Diploma

Transcript of 6 IRQ Controller

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 1/21

Computer HardwareComputer HardwareUnit 20Unit 20

22ndnd Year National Diploma Year National Diploma

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 2/21

Computer HardwareComputer Hardware

IRQ ControllerIRQ Controller

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 3/21

 Table of Contents Table of Contents

Simplified diagram of a modern DMA computerSimplified diagram of a modern DMA computer

IntroductionIntroduction

IRQsIRQs Interrupt ControllersInterrupt Controllers

Interrupt PrioritiesInterrupt Priorities

NonNon--Maskable Interrupts (NMI)Maskable Interrupts (NMI) Interrupt ConflictsInterrupt Conflicts

Summary of IRQsSummary of IRQs

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 4/21

Simplified diagram of a modern DMA computerSimplified diagram of a modern DMA computer

CPU

Memory

Controller 

I/O

Controller 

DMA

Controller 

IRQ

Controller 

I/O

Devices

Storage

Devices

RAM

L2

Cache

Control Bus

System Bus

I/O Bus

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 5/21

IntroductionIntroduction

When you install an expansion board in a slot, it When you install an expansion board in a slot, it

gets connected to the I/O bus.gets connected to the I/O bus.

 The board can therefore send and receive data The board can therefore send and receive datato and from the I/O device.to and from the I/O device.

But who regulates the traffic?But who regulates the traffic?

 Who gives clearance to the new controller to Who gives clearance to the new controller tosend data?send data?

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 6/21

IRQsIRQs (1 of 6)(1 of 6)

 To control data traffic on the I/O bus, the To control data traffic on the I/O bus, the

concept of concept of IRQ (IRQ (IInterruptnterrupt R R eeQQuest)uest) was was

created.created. A fundamental principle in the PC design. A fundamental principle in the PC design.

2 types of Interrupts:2 types of Interrupts:

Software InterruptsSoftware Interrupts

Used to call any number of BIOS routinesUsed to call any number of BIOS routines

Hardware InterruptsHardware Interrupts

IRQsIRQs

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 7/21

IRQsIRQs (2 of 6)(2 of 6)

 An interrupt is basically w hat it sounds like An interrupt is basically w hat it sounds like ²  ² aa

message from one part of the computer tomessage from one part of the computer to

another (normally to the system processor) thatanother (normally to the system processor) that

tells it that it needs to stop w hat it is doing, andtells it that it needs to stop w hat it is doing, and

do something else instead.do something else instead.

W e use our computers in a way that requires the W e use our computers in a way that requires the

processor to at leastprocessor to at least appear appear to do many things atto do many things atonce.once.

Example: Editing a document w hilst listening toExample: Editing a document w hilst listening to

music.music.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 8/21

IRQsIRQs (3 of 6)(3 of 6)

 The processor is able to do this by sharing its The processor is able to do this by sharing its

time among the various programs it is running time among the various programs it is running 

and the different devices that need its attention.and the different devices that need its attention.

It seems as if its doing many things at onceIt seems as if its doing many things at once

because it is able to switch between tasks in abecause it is able to switch between tasks in a

blindingly hig h speed.blindingly hig h speed.

Many of the different parts of the PC need toMany of the different parts of the PC need to

send information to and from the CPU.send information to and from the CPU.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 9/21

IRQsIRQs (4 of 6)(4 of 6)

 There are 2 basic ways that the processor could There are 2 basic ways that the processor could

use in order to give the different parts theuse in order to give the different parts the

attention they need:attention they need:

Polling Polling 

Interrupting Interrupting 

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 10/21

IRQsIRQs (5 of 6)(5 of 6)

PollingPolling

Processor takes turns going to each device andProcessor takes turns going to each device andasking if they have anything they need it to do.asking if they have anything they need it to do.

W aste of cycles because the processor could be W aste of cycles because the processor could bedoing something useful instead.doing something useful instead.

Different devices need the processor·s attention atDifferent devices need the processor·s attention at

differing rates; the mouse needs attention far lessdiffering rates; the mouse needs attention far lessfrequently than the hard disk.frequently than the hard disk.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 11/21

IRQsIRQs (6 of 6)(6 of 6)

InterruptingInterrupting

Different devices request attention from the CPUDifferent devices request attention from the CPU w hen it is needed. w hen it is needed.

When a device has data to transfer, it generates an When a device has data to transfer, it generates aninterrupt saying ´I need your attention nowµ.interrupt saying ´I need your attention nowµ.

 The processor stops w hat it is doing and deals with  The processor stops w hat it is doing and deals with 

the device that made the request for attention.the device that made the request for attention. It can actually handle many such requests at any oneIt can actually handle many such requests at any one

time. This is done using a priority level.time. This is done using a priority level.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 12/21

Interrupt ControllersInterrupt Controllers (1 of 3)(1 of 3)

Device interrupts are fed to the processor using Device interrupts are fed to the processor using 

a special piece of hardware called ana special piece of hardware called an interruptinterrupt

controllercontroller..

 The standard device for this is the Intel 8259 The standard device for this is the Intel 8259

interrupt controller. Nowadays, moderninterrupt controller. Nowadays, modern

motherboards incorporate this in the chipset.motherboards incorporate this in the chipset.

 The controller passes the request on to the The controller passes the request on to the

CPU, telling it w hich devices issued the request.CPU, telling it w hich devices issued the request.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 13/21

Interrupt ControllersInterrupt Controllers (2 of 3)(2 of 3)

 The original PC had 8 input lines connected to The original PC had 8 input lines connected to

the controller, and took requests from one of the controller, and took requests from one of 

eig ht different devices. (IRQ 0 to 7)eig ht different devices. (IRQ 0 to 7)

Starting with IBM AT, a second interruptStarting with IBM AT, a second interrupt

controller was added to the system to expand it.controller was added to the system to expand it.

2 interrupts were2 interrupts were c as c aded c as c aded together in order nottogether in order not

to change the single interrupt line going to theto change the single interrupt line going to the

processor.processor.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 14/21

Interrupt ControllersInterrupt Controllers (3 of 3)(3 of 3)

 The first interrupt controller still has 8 inputs and The first interrupt controller still has 8 inputs and

a single output going to the processor.a single output going to the processor.

 Th

e second oneh

as th

e same design, but it takes Th

e second oneh

as th

e same design, but it takes8 new inputs (doubling the number of interrupts)8 new inputs (doubling the number of interrupts)

and its output feeds into input line 2 of the firstand its output feeds into input line 2 of the first

controller.controller.

If any of the inputs on the second controllerIf any of the inputs on the second controller

become active, the output from the controllerbecome active, the output from the controller

triggers interrupt #2 on the first controller, w hich triggers interrupt #2 on the first controller, w hich 

then signals the processor.then signals the processor.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 15/21

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 16/21

NonNon--Maskable Interrupts (NMI)Maskable Interrupts (NMI) (1 of 2)(1 of 2)

 All of the regular interrupts that we normally use All of the regular interrupts that we normally use

and refer to by number are calledand refer to by number are called m askable m askable 

interrupts.interrupts.

 The processor is able to mask (or temporarily  The processor is able to mask (or temporarily 

ignore) any interrupt if it needs to, in order toignore) any interrupt if it needs to, in order to

finish something else that it is doing.finish something else that it is doing.

On the other hand, the PC has an NMI that canOn the other hand, the PC has an NMI that can

be used for serious. conditions that demand thebe used for serious. conditions that demand the

processor·s immediate attention.processor·s immediate attention.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 17/21

NonNon--Maskable Interrupts (NMI)Maskable Interrupts (NMI) (2 of 2)(2 of 2)

 The NMI cannot be ignored by the system unless The NMI cannot be ignored by the system unless

it is specifically shut off.it is specifically shut off.

When an NMI signal is received, t

he processor

 When an NMI signal is received, t

he processorimmediately drops w hatever it was doing andimmediately drops w hatever it was doing and

attends to it.attends to it.

 This could cause havoc. This is w hy it is used This could cause havoc. This is w hy it is used

only for critical problem situations, such asonly for critical problem situations, such as

serious hardware errors.serious hardware errors.

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 18/21

Interrupt ConflictsInterrupt Conflicts

In general, interrupts are singleIn general, interrupts are single--device resources.device resources.

If you attempt to use two devices with the sameIf you attempt to use two devices with the same

IRQ, an IRQ conflict will result.IRQ, an IRQ conflict will result. It is possible to share an IRQ among more thanIt is possible to share an IRQ among more than

one device, but only under limited conditions.one device, but only under limited conditions.

If youh

ave two devices th

at you seldom use, youIf youh

ave two devices th

at you seldom use, youmay be able to have them share an IRQ.may be able to have them share an IRQ.

Common examples include COM port conflictsCommon examples include COM port conflicts

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 19/21

Summary of IRQsSummary of IRQs (1 of 3)(1 of 3)

 The table below provides summary information The table below provides summary information

about the 16 IRQ levels in a typical PC:about the 16 IRQ levels in a typical PC:

IRQIRQ BusBusLine?Line?

PriorityPriority T ypical T ypicalDefault UseDefault Use

Other Common UsesOther Common Uses

00 NoNo 11 System TimerSystem Timer NoneNone

11 NoNo 22 KeyboardKeyboard

ControllerController

NoneNone

22 NoNo

(rerouted)(rerouted)

n/an/a None: Cascade forNone: Cascade for

IRQs 8IRQs 8--1515

Modems, Very old ( EG A)Modems, Very old ( EG A)

Graphics Cards, COM3, COM4Graphics Cards, COM3, COM4

33 8/168/16--bitbit 1111 COM2 (secondCOM2 (second

serial port)serial port)

COM4, modems, sound,COM4, modems, sound,

network & tape accelerator cardsnetwork & tape accelerator cards

44 8/168/16--bitbit 1212 COM1 (first serialCOM1 (first serial

port)port)

COM3, modems, sound,COM3, modems, sound,

network & tape accelerator cardsnetwork & tape accelerator cards

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 20/21

Summary of IRQsSummary of IRQs (2 of 3)(2 of 3)

IRQIRQ BusBus

Line?Line?

PriorityPriority T ypical T ypical

Default UseDefault Use

Other Common UsesOther Common Uses

55 8/168/16--bitbit 1313 Sound CardSound Card LPT2, LPT3, COM3, COM4,LPT2, LPT3, COM3, COM4,

modems, network and tapemodems, network and tape

accelerator cardsaccelerator cards

66 8/168/16--bitbit 1414 Floppy Disk  Floppy Disk 

ControllerController

 Tape accelerator cards Tape accelerator cards

77 8/168/16--bitbit 1515 LPT1(first parallelLPT1(first parallel

port)port)

LPT2, LPT3, COM3, COM4,LPT2, LPT3, COM3, COM4,

modems, network and tapemodems, network and tape

accelerator cardsaccelerator cards

88 NoNo 33 RealReal--time Clock time Clock NoneNone

99 1616--bit only bit only 44 NoneNone Network or sound cards, SCSINetwork or sound cards, SCSI

host adapters, PCI devices,host adapters, PCI devices,

rerouted IRQ2 devicesrerouted IRQ2 devices

1010 1616--bit only bit only 55 NoneNone Network or sound cards, SCSINetwork or sound cards, SCSI

host adapters, PCI deviceshost adapters, PCI devices

8/6/2019 6 IRQ Controller

http://slidepdf.com/reader/full/6-irq-controller 21/21

Summary of IRQsSummary of IRQs (3 of 3)(3 of 3)

IRQIRQ BusBus

Line?Line?

PriorityPriority T ypical T ypical

Default UseDefault Use

Other Common UsesOther Common Uses

1111 1616--bit only bit only 66 NoneNone Network or sound cards, SCSINetwork or sound cards, SCSI

host adapters, V G A video cards,host adapters, V G A video cards,

PCI devicesPCI devices

1212 1616--bit only bit only 77 PS/2 MousePS/2 Mouse Network or sound cards, SCSINetwork or sound cards, SCSI

host adapters, V G A video cards,host adapters, V G A video cards,

PCI devicesPCI devices

1313 NoNo 88 Floating PointFloating Point

Unit CoUnit Co--processorprocessor

NoneNone

1414 1616--bit only bit only 99 Primary IDE Primary IDE 

channelchannel

SCSI host adaptersSCSI host adapters

1515 1616--bit only bit only 1010 Secondary IDE Secondary IDE 

channelchannel

Network cards, SCSI hostNetwork cards, SCSI host

adaptersadapters