Basic Input-Output Services and the System Bus
A key concept for this discussion is the bus.
So, just what is a bus? In computer terms, it has
a similar meaning as your local county public transit, as it is used to move
something from one place to another. The county transit bus
moves people; a computer bus moves information.
information is transmitted along the bus
as electric signals. If you have ever opened up a computer,
you probably saw that there is one central printed circuit board with the
CPU, the expansion cards,
and several chips sticking out of it. The electronic connections between these
parts is referred to as a bus.
The signals that move along a computer bus
comes in two basic forms: control and
data. Control signals do just that: they control things. Data signals are just
that: data. I will
get to how this happens and what each part does as we move along.
In todays PC computer
market, there are several buses, many of which have the same functions but
approach things quite differently. In this section, I am going to talk about the
different bus types, what goes on between
the different devices on the bus,
and what the main components are that communicate along the
Despite differences in bus
types, certain aspects of the hardware are common among
all PCs. The Basic Input Output System (BIOS), interrupts,
Direct Memory Access
channels, and base
addresses are just a few. Although once the kernel
is loaded, Linux almost never needs the system
BIOS. However, understanding the function and purpose of the BIOS is useful in understanding the
process that the computer goes through when booting. That is, from the time you hit the power switch to
when Linux has full control of the hardware.
is the mechanism DOS
uses to access the hardware. DOS (or a DOS
application) makes BIOS
calls that then transfer the data to and from the devices. Except for the
first few moments of the boot
process and the last moment of a shutdown, Linux may never use it
The standard BIOS
for PCs is the IBM BIOS, but that's simply because "PC" is
an IBM standard. However, "standard" does not mean "most common," as there are
several other BIOS
vendors, such as Phoenix and AMI.
DOS or a DOS
independent calls to the BIOS
to transfer data. The BIOS then translates this into device
dependent instructions. For example, DOS
(or the application) requests that the hard disk
read a certain block of data. The application
does not care what kind of hard disk hardware there
is, nor should it. It is the BIOS's job to make that translation to something the
specific hard disk can understand.
In Linux, on the other hand, a special
program called a device driver handles the
functions of the BIOS.
As we talked about in the section on the kernel,
device drivers are sets of
routines that directly access the hardware, just as the BIOS
The fact that Linux
by-passes the BIOS
and goes directly to the hardware is one reason why some hardware will work under
DOS but not under Linux. In some instances, the BIOS
has been specially designed for the machine on
which it runs. Because of this, it can speak the same dialect of "machine language" that
the rest of the hardware speaks. However, because UNIX
does not speak the same dialect, things get
lost in the translation.
The Intel 80x86 family of processors has an
I/O space that is
distinct from memory space. What this means is that memory (or RAM) is treated
differently than I/O.
Other machine architectures, such as the Motorola 68000 family, see accessing
memory and I/O
same thing. Although the addresses for I/O
devices appears as "normal" memory addresses
and the CPU
is performing a read or write as it would to RAM,
the result is completely different.
When accessing memory, either for a read or write, the CPU
utilizes the same address
lines as it does when accessing RAM.
The difference lies in the M/IO# line on the CPU.
For those not familiar with digital electronics, this can also be described as the
"Memory/Not IO" line. That is, if the line is high (there is a signal on the line),
the CPU addresses memory. If it is low (no signal), it addresses
an I/O device.
Although the Linux operating system
is much different from DOS,
it still must access the
hardware in the same fashion. There are assembly language instructions that allow
system (or any program for that matter) to access the hardware correctly. By
passing these commands the base address
of the I/O
device, the CPU
knows to keep the M/IO# line low and therefore access
the device and not memory.
You can often see the base address of each device on the
system when you boot. The hardware screen shows you the devices
it recognizes along with certain values such as the base address, the
vector, and the DMA channel. You can also see this same
information by looking in the /var/log/messages and several files in the /proc file
If your motherboard only uses 10 address
lines, devices on the motherboard that have an I/O address
(such as the DMA
controller and PIC) will appear at their normal address, as well as at
"image" addresses. This is because the higher 6 bits are ignored, so any
which the lower 10 bits match will show up as an "image" address.
Because 6 bits are
ignored, there are 63 possible "image" addresses (64 minus the one for the
These image addresses may cause conflicts with hardware that have
I/O addresses higher than 0x3FF (1023), which is the highest possible with
only 10 address
Therefore, if your motherboard only has 10 bits of I/O
addresses, you shouldn't put devices at
addresses higher than 0x3FF.
When you install, it is vital that no two devices have
overlapping (or identical) base addresses. Though you can share interrupts
channels on some
machines, you can never share base addresses. If you attempt to read a device
that has an
overlapping base address,
you may get information from both devices.
If you are installing a
board whose default base address
is the same as the one already on the system, you must change one
address before they both will work. Additionally, you are almost always asked
for the base address
of a card when you install it. Therefore, you will need to keep track of
See the section on troubleshooting for tips on maintaining a notebook with this
kind of information.
The table below
contains a list of the more common devices and the base address
ranges that they use.
Table - Common Hex Addresses
Motherboard devices (DMA Controller, PIC, timer chip, etc.)
Fixed disk controller (WD10xx)
Parallel port 2
Serial port 2
Parallel port 1
Monochrome display and parallel port 2
EGA or VGA adapter
CGA, EGA, or VGA adapter
Floppy disk controller
Serial port 1