BUS Configurations
Handling Interrupt Requests
Objectives:
To describe some of the main bus technologies and configurations, and to discuss
the plug-and-play systemDiscuss the function of buses
Describe the most common bus standards available
Outline how buses typically relate to one another in a modern PC
Outline the concept and the practicalities of the plug-and-play system
Lesson:
The processor in any PC is a powerful device that is essentially designed to do one task at a time.
However, PCs are used in such a way that it must appear as if the processor is doing several tasks at once.
So the processor switches between various tasks at exceptionally high speed and in this way gives the appearance of working on different jobs simultaneously.
Most of the different parts of the PC need to send information to and from the processor, and they must be able to get the processor's attention to do this.
The processor, in turn, has to balance the information transfers it gets from various
parts of the machine and make sure that they are handled in an organized way.There are two basic ways that the processor can do this:
polling
interrupting
With polling, the processor goes to all the devices in the PC in turn and checks if they have anything they need it to do.
This technique is not used by the processor in a regular PC because it wastes the processor's resources.
Constantly checking if devices need attention, particularly when the answer is often no, is highly inefficient.
Another problem with polling is that some devices need the processor's attention more than others but have to wait while it polls other, less needy, devices.
The other way that the processor can handle information transfers is to let the devices request them when they need them.
This is known as interrupting.
Devices in need of attention generate an interrupt, which essentially tells the processor to stop what it is doing and deal with the request to hand.
There are two types of interrupt:
software interrupts
hardware interrupts
Software interrupts are used by some programs.
Basically, in the course of its operation, a program can cause an interrupt to happen.
This interrupts the running program and invokes another, special, program to handle the event corresponding to the type of interrupt the running program has asserted.
Say, for example, the writer of an application program knows that at a certain point the program must send some information to the screen.
But the program doesn't need to know in detail just how to do that.
All the program must do is assert the proper type of interrupt, and the program invoked by that interrupt will then do the job.
Hardware interrupts are more common than software interrupts.
Hardware interrupts are fed to the processor using a special piece of hardware called an interrupt controller.
The standard for this device is the Intel 8259 interrupt controller.
This functionality may be incorporated within a chipset on modern motherboards.
The Intel 8259 interrupt controller has eight input lines that take interrupt requests (IRQs) from one of eight devices.
The controller then passes the request on to the processor, telling it which device made the request.
Interrupts are numbered from IRQ0 to IRQ7.
The original PC and XT had one controller and so supported only interrupt requests from 0 to 7.
Later, with the advent of IBM's AT machine, a second interrupt controller was added to the system to expand it.
However, the designers of this second controller didn't want to make the original interrupt controller obsolete, and so they cascaded the two together.
The first interrupt controller still had eight input lines and a single output line going to the processor.
The second one has eight new input lines but its output line doesn't feed into the processor.
Instead, it feeds into IRQ2 on the first controller.
If any of the input lines on the second controller become active, the output line from that controller triggers IRQ2 on the first controller.
Then IRQ2 signals the processor on behalf of the second interrupt controller.
Because IRQ2 is being used to cascade the second controller, any devices that used
it were sent over to IRQ9 instead.This was done by changing the wiring on the motherboard.
So any older devices that used IRQ2 now use IRQ9 and if any device is set to use IRQ2 on an AT or later system, it is really using IRQ9.
Devices designed to use IRQ2 as a primary setting are rare in modern PCs.
In most cases, IRQ2 is considered unusable, while IRQ9 is a regular, usable interrupt request line.
The devices that use interrupts trigger them by signalling over lines provided on the ISA system bus.
Most of the interrupts are provided to the system bus for use by devices.
Some of them, however, are used internally by the system and are not given wires on the system bus.
These interrupts - IRQO, IRQ1, IRQ2, IRQ8, and IRQ13- are never available to expansion cards.
The PCI bus handles interrupts differently to the ISA bus - it uses its own internal interrupt system.
If a PCI card needs to use a regular IRQ line, the BIOS will map the PCI interrupt to a regular system interrupt.
The PC processes device interrupts according to their priority level.
This is connected directly to the interrupt number.
On older machines with only one interrupt controller, the priority of the interrupts
is 0, 1, 2, 3, 4, 5, 6, 7.On newer machines with two cascaded interrupt controllers, interrupt priority is as follows:
0, 1, 8, 9, 10, 11, 12, 13, 14, 15, 3, 4, 5, 6, 7.
All of the interrupts that are normally used and referred to by a number are called maskable interrupts.
The processor is able to mask, or temporarily ignore, any interrupt if it needs to while it finishes a particular task.
In addition to maskable interrupts, a PC has a nonmaskable interrupt, known as an NMI.
The NMI cannot be ignored by the system unless it is turned off and is used for important tasks that need the processor's attention immediately.
When an NMI signal is received, the processor immediately drops what it was doing and attends to the NMI.
The NMI is used only for critical problem situations, as overuse can cause major
problems with the normal functioning of a PC.The most common use of NMI is to signal a parity error from the memory system.
Such an error must be dealt with immediately if data corruption is to be prevented.
Generally speaking, interrupts are single-device resources.
It is not really feasible for more than one device to use an interrupt at one time, because this can confuse the processor and cause it to respond to the wrong device.
Attempting to use two devices with the same IRQ will cause an IRQ conflict.
In certain specific circumstances it is possible have more than one device assigned to an IRQ line.
For example, if there are two devices in a machine that are used fairly rarely and
never simultaneously, then they can share an IRQ line.However, it is not advisable to use this strategy if it is in any way possible to give each device its own IRQ line.
In a PC with 16 interrupt request lines there is a standard or typical way of assigning devices to the various lines.
The default device for IRQ0 is the system timer.
The keyboard controller is typically assigned to IRQ1.
IRQ2 generally has no devices attached to it as it is used to cascade the second
interrupt controller in a PC.The typical use for IRQ3 is a second serial port (COM2), although it could be used for a fourth serial port (COM4), a modem, a sound card, a network card, or a tape accelerator card.
IRQ4 is most commonly used for a first serial port (COM1), but could be used for a third serial port (COM3), or any of the other devices that can be attached to IRQ3.
IRQ5 is primarily used for a sound card.
Alternative uses include a second parallel port (LPT2), a third serial port (COM3), a fourth serial port (COM4), a modem, a network card, a tape accelerator card, or a hard disk controller on an old PC/XT.
Floppy disk controllers are typically assigned to IRQ6, although tape accelerator cards can also be assigned here.
IRQ7 is commonly used for a first parallel port (LPT1).
Alternative uses include a second parallel port (LPT2), a third or fourth serial port (COM3 or COM4), a modem, a sound card, a network card, or a tape accelerator card.
IRQ8 is always used for the real-time clock.
Network cards, sound cards, SCSI host adapters, PCI devices, or any re-routed IRQ2 devices can be assigned to IRQ9.
IRQ10 is commonly used for network cards, sound cards, SCSI host adapters, secondary
IDE channels, quaternary IDE channels or PCI devices.A network card is often assigned to IRQ11.
Other common assignments include sound cards, SCSI host adapters, secondary, tertiary or quaternary IDE channels, VGA video cards, or PCI devices.
IRQ12 is generally used for a PS/2 mouse, but can also be used for network cards, sound cards, SCSI host adapters, VGA video cards, tertiary IDE devices or PCI devices.
The only device ever attached to IRQ13 is the Floating Point Unit (FPU/NPU/Math Coprocessor).
IRQ14 is typically used for a primary IDE channel, although it can also be used for a SCSI host adapter.
And IRQ15 is normally used for a secondary IDE channel, but it is not unknown for it to be used for network cards or SCSI host adapters.
Quiz Basic Elecricity Techonology HTML