Motherboards and BIOS
We know the external data bus and the address bus connects the CPU to the RAM in order to run programs and transfer data. However, the computer has many more components that also need to talk to the RAM and CPU. To achieve this the external data bus and the address bus is connected to all types of components and devices such as keyboard, mice, hard drive, video card, sound card and many different types of ports.
Contents |
BIOS
Each device in the computer uses the external data bus and address bus through a controller chip. The keyboard uses a chip called intel 8042 keyboard controller.
The 8042 chip is also used to control the mouse.
BIOS is software that consists of many small programs that know how to talk to many different types of controller chips for different types of devices. This software is loaded into the 384K of the first megabyte of memory space to be accessed by the CPU. Many devices have their own ROM chips that have their software locally. ROM is hardware and BIOS is software. BIOS can be upgraded and changed.
Each device responds to certain unique patterns built into them. These are called I/O address which are transferred over the Address bus. The IO/MEM wire of the CPU charges this wire to indicate that the bus is being used for as address bus and not as data bus. During the address bus usage only 16 wires are used but during the data bus transfer all 20 wires are used.
The CPU lights up the IO/MEM wire and puts a pattern on the address bus. This pattern is seen by all devices but only the Hard Drive controller recognizes the pattern because it responds to 16 different patterns build into its ROM chip. The hard drive puts information on the data bus and sends it off to the CPU.
All devices have I/O address either preset or they are set when the device is installed. All I/O address are 16 bit addresses and only used by a single device.
The CPU can now talk to any device on the computer. However, can the devices talk to the CPU?
Interrupts
I/O addressing is two way but it must be started by the CPU. If a device needs to get the attention of the CPU it must put a charge on a wire called the INT. The CPU will stop and give attention to the device. To monitor and control all the interrupts, a chip is used 8259. 8259 is hooked to the INT wire which is connected to all devices on the motherboard, including the CPU. Now when a device needs attention it will send a signal to 8259, 8259 will light up the INT wire and the CPU will then talk to the 8259 via the address bus to find out which device needs attention. 8259 will tell the CPU which interrupt was lit up from the interrupt table. After this the CPU will figure out which program to use from the BIOS to talk to the device.
IRQ2 was reserved by IBM to be used for its 3270 card. Every device needs an IRQ with an exception of a few. Joystick does not need an IRQ. You program has to keep checking the joystick to make sure a button has not been pressed.
Serial is a physical port but COM port is just the I/O address and IRQ assigned to it.
DMA
Some devices want to bypass the CPU and MCC and get the information from memory quickly. To accommodate these devices a DMA chip 8237 was introduced to keep all DMA devices in order. The 8237 uses the external bus and passes all the information the device needs. the 8237 chip linked to the CPU via the HRQ wire which informs the CPU that the data bus will be busy. The 8237 has 4 wires called DRQ (DMA requests) which lead to the DRAM refresh circuity and expansion slots.
Bus Mastering
Some devices bypass the CPU and the 8237 DMA chip and access the memory directly, this is called bus mastering.
Chipsets
You have seen motherboards with chipsets like Intel chipset, VIA and Opti. What this means is that they have consolidated all the chips into a set and gave it a different number. So you might not see a 8259 chip but still have all the IRQs.