The Bus, I/O and System Resources


SYSTEM RESOURCES - Very A+

By definition a resource is a supply or store of something. The system has a finite supply of the following resources, thus resource management is an important concept. Luckily (or not) the system tries to manage these for you – and it is (usually) pretty good at it.

  • IRQ – Interrupt requests
  • DMA – Direct memory access
  • I/O Addresses – Magic two-way portals

 

INTERRUPT REQUEST (IRQ)

Since the CPU has no control over when an input event may occur, IBM system designers designed PCs to be interrupt driven.

Interrupt driven means that when a peripheral device needs to send its data to the system, it must first notify the CPU that it has something for it. The CPU will then stop what it is doing and tend to the device that interrupted it.

So an Interrupt is like a doorbell for the CPU!

 

Bad News / Good News!

  • The CPU itself only has one doorbell (INTR pin). Another pin is used to acknowledge (by the CPU) that the doorbell has been rung (INTA pin).
  • We have multiple input devices - we need a doorbell manager! Introducing the 8259.

In the original PC, this IRQ manager was called the 8259 PIC (Programmable Interrupt Controller) chip. This chip could accept eight interrupt request (IRQ) wires, six of which were connected to peripheral devices through the ISA bus slots – another two were wired directly to the system.

IBM System designers soon realized that eight wasn't enough so they added a 2nd 8259 PIC. This chip is wired to (or cascades) the original PIC.

By cascading them in this manner we are left with a total of 15 useable interrupt lines.

 

IRQ summary

  • The good news – IRQs are more efficient than poling
  • The bad news - there are only 16 of 'em (numbered 0-15)
    • Historically not really able to share between devices
    • Conflicts can occur when more than one device tries to use the same IRQ.
    • New Technology Alert: PCI steering (an Operating System feature) allows up to 4 PCI devices to share a single interrupt.
    • USB allows 128 devices to share an interrupt!
  • These IRQs are called Maskable Interrupts. The system can take the time to tidy up before answering the doorbell – and then return to what it was doing.
  • NMI (Non Maskable Interrupts). The system immediately answers the doorbell. The system may not recover from these. Time to reboot! A memory parity error, bus, Math Coprocessor and other hardware errors would be examples of this.

 

A Standard IRQ table - Very A+

   Function    IRQ
   System timer    0
   Keyboard    1
   Cascade to 9    2
   COM2    3
   COM1    4
   Available (LPT2 or sound card)    5
   Floppy controller    6
   LPT1    7
   
   Real time clock    8
   Cascade from 2 (only 1 available)    9
   Available    10
   Available    11
   Available (PS/2 mouse)    12
   Math Coprocessor    13
   Primary IDE    14
   Secondary IDE    15

You should note that IRQs 0, 1, 8 and 13 connect to the devices they service directly and are not available to the bus system - thus they can not be made available to peripheral devices.

Notice also that devices can use either IRQ 2 OR IRQ 9 as designated interrupts. Because they cascade together, your devices may use one or the other but not both.

In addition to the numerical order of IRQs, there are important priority issues to consider. To resolve any conflicts due to simultaneous door-bell ringing, the following priorities are observed: 0, 1, 2, 8, 9, 10, 11, 12, 13, 14, 15, 3, 4, 5, 6, 7, 8.

 

DMA (Direct Memory Access)

Generally when a byte of data is moved either from one place to another in the system's main memory or from main memory to an I/O port, it is moved in two steps.

  • First the CPU reads the data from someplace and then stores it within itself in a register - you will recall a register is a temporary holding place within the CPU.
  • In the next step the CPU then moves the byte from within itself out to its final destination.

This is a bit inefficient. First, while the CPU is busy moving bytes it can’t be doing anything else. Second, it takes two steps, one to move bytes in and one to move bytes out.

System designers recognized this bottleneck early and added another special controller chip to the system's circuitry. This chip was the 8237 DMA (Direct Memory Access) Controller chip.

DMA allows I/O to memory and memory to memory moves without bothering the CPU. The CPU does do the "setup" and the data is sent via the ISA bus.

Standard DMA Table - Very A+

DMA Typical use
0 Available
1 8-bit sound
2 Floppy
3 ECP Printer
4 Cascade
5 16-bit sound
6 available
7 available

 

I/O Address - its two, two memories in one

Peripheral devices need a way "into" computer memory. Your PC uses the first 64K of memory address numbers as "portals" into and out of RAM. BEWARE - these memory addresses have "dual roles" depending on if they are acting as just normal memory or as I/O memory.

These are the addresses we see in the device manager. The device manager alerts us when more than one device tries to use the same I/O address space.

There are 64K of these ports, and each hardware device may use a range of them. Some are input only, some are output only and some are input/output depending on hardware. No two devices may share the same port, so ranges must not overlap.

I/O addresses to know and love - Very A+

The A+ test expects you to KNOW the following devices STANDARD BASE I/O address:

Device I/O Address IRQ (just for practice)
COM1 3F8h IRQ4
COM2 2F8h IRQ3
COM3 3E8h IRQ4
COM4 2E8h IRQ3
LPT1 378h IRQ7

LPT2

278h IRQ5

IDE1

1F0h IRQ14
IDE2 170h IRQ15

Can you think of a way to help you remember this?


Managing resources – The Device Manager - Very A+

The yellow exclamation point tells us that a device has conflicts.


The red X tells us that a device is disabled - When a recognized device has no resources allocated to it, Windows marks the device as disabled.


We may be able to change settings

 

Bus systems that move data around inside a PC include:

  • The processor and memory busses (external data bus - FSB)
  • 16-Bit ISA (industry standard architecture) bus
  • The PCI (peripheral component interconnect) bus
  • The AGP (accelerated graphics port)

The Extremely Simplified Bus

 

The way-back machine…

Historically we would need to add four more buses to our data-transportation list. These four buses include:

  • 8-Bit ISA bus
  • MCA (micro-channel architecture). Software configurable. 32-bit
  • EISA (extended industry standard architecture – pronounced "ee-suh"). Software configurable. 32-bit.
  • VESA (video electronics standards association – "vey-suh")

If we include buses that don’t stop at the edge of the case we can also include:

  • USB (universal serial bus)
  • SCSI (small computer systems interface)
  • Firewire (IEEE-1394)

And if we include special buses for mobile computers we would add:

  • PCMCIA (personal computer memory card international association – now thankfully just PC CARD) bus
  • Cardbus – (a revved up version of the PC bus)
  • Mini-PCI – (a shrunk down version of the PCI bus)

 

16-bit ISA

  • 16-bit data bus
  • 8-MHz (some 10MHz)
  • No bus mastering
  • Configured by Jumpers and Dip switches, Some are software configurable (PNP)

PCI

  • 32-bit or 64-bit
  • 33MHz or 66MHz
  • Bus mastering
  • Plug and play
  • Mini-PCI for portables

AGP

  • 32-bit
  • 66MHz
  • Bus Mastering
  • Plug and play
  • Voltage (1.5 – 3.3) and pro model differences. 6 different footprints.

 

In Depth:

AGP - "Accelerated Graphics Port" - a dedicated point-to-point channel so that the graphics controller can directly access main memory. The AGP channel is 32 bits wide and runs at 66 MHz. This translates into a total bandwidth of 266 MBps, double that of the PCI bandwidth of 133 MBps.

AGP also supports three optional faster modes (x 2, x 4 and x 8), with throughputs of 533 MBps, 1.07 GBps and 2 GBps.

In addition, AGP allows 3-D textures to be stored in main memory rather than video memory. This enables the card to utilize it’s own memory for processing the display output, resulting in faster video display.

AGP has a couple of important system requirements. The chipset must support AGP and the motherboard must be equipped with an AGP bus slot or must have a built-in AGP graphics system.

Note that there are at least 6 different footprints for AGP cards. One important change in AGP was the drop from 3.3V to 1.5V. Cards are keyed to prevent incorrect voltages and added features.

 

Additional busses - Very A+

CNR – Communications Network Riser

Because CPUs are getting faster and more powerful, some digital processing jobs can be implemented in main chipset and share CPU power.

The analog functions of the expansion component are then placed on a small (riser) card that is inserted into a special slot on the motherboard. /P>

Supports V.90 analog modem, multi-channel audio, phone-line based networking, and 10/100 Ethernet based networking.

Replaced AMR – Audio Modem Riser

 

Firewire - Very A+

Developed by Apple, Firewire (IEEE1394a) is a high-speed input/output technology for connecting peripheral devices to a computer or to each other.

  • Audio and video consumer electronic devices
  • Isochronous mode
    • Guaranteed real time delivery of data
    • Transmits packets of data at uniform time intervals filling up its bandwidth allotment
  • Cable length 4 meters (100 meters in 1394b)
  • Speed – 400Mbps (800Mbps in 1394b)
  • Hot swappable
  • Plug and play
  • Up to 45 watts on-bus power
  • 63 devices
  • Peer to peer technology – devices can transfer data independently
  • May be available on motherboard or expansion card

 

The end is near!


4, 6 and 9-pin cables. Only 6 and 9-pin carry power

USB - Very A+

The Universal Serial Bus is a connectivity standard enabling simple Plug and Play connections to devices such as modems, digital cameras, keyboards, and mice.

  • Audio and video consumer electronic devices
  • Asynchronous mode only
  • Cable length 5 meters (up to 75ft with powered repeaters)
  • Speed – 12Mbps plus a 1.5Mbps low speed channel (480Mbps in USB2.0)
  • Hot swappable
  • Plug and play
  • Up to 2.5 watts on-bus power
  • 127 devices
  • Master-slave technology – uses host to manage data transfer
  • May be available on motherboard or expansion card

 

The end is here!


A and B cables ends. B cable ends (the square ones) go on devices that do not have permanently attached cables. The A cable are for devices with permanently attached cables.


TO REVIEW – it seems like such a long time ago…

IRQ

When an I/O device wants notify the system that there is some data that needs to be "let in", it uses an interrupt request (or IRQ). An interrupt is like a doorbell for your system. Generally, each device must have its own doorbell.

Know: ALL standard IRQs

I/O

The system then lets the data in through a memory location called an I/O Address (or Port). A memory address from 0 to 64K can EITHER act as a standard memory location OR a Port, depending on the command that is used to access that location.

Know: the I/O addresses for all COM, LPT and IDE ports

DMA

Usually the CPU must move every bit of data from a location, into the CPU’s registers, and then to some other location – like into an I/O address. DMA (Direct Memory Access) uses a chip (a special-purpose processor) that facilitates this data movement. That way the CPU can work on more important things while data transfer is done in the "background".

Know: The DMA channel for the floppy controller

Edited (2003) By Vlad Magero