Exploiting Your Resources

Pages: 1 2 3 4 5

Input/Output (I/O) Addresses

Input/output addresses (usually called just I/O addresses for short, or sometimes port addresses) are resources used by virtually every device in the computer. Conceptually, they are very simple; they represent locations in memory that are designated for use by various devices to exchange information between themselves and the rest of the PC.

You can think of I/O addresses like a bunch of small two-way “mailboxes” in the system’s memory. Take for example a communications (COM) port that has a modem connected to it. When information is received by the modem, it needs to get this information into the PC. Where does it put the data it pulls off the phone line?

One answer to this problem is to give each device its own small area of memory to work with. This is called memory-mapped I/O. When the modem gets a byte of data it sends it over the COM port, and it shows up in the COM port’s designated I/O address space. When the CPU is ready to process the data, it knows where to look to find it. When it later wants to send information over the modem, it uses this address again (or another one near it). This is a very simple way of dealing with the problem of information exchange between devices, especially when there are many different devices talking to the CPU.

Unlike IRQs and DMA channels, which are of uniform size and normally assigned one per device, I/O addresses vary in size. The reason is simple: some devices (e.g., network cards) have much more information to move around than others (e.g., keyboards). The size of the I/O address is also in some cases dictated by the design of the card and (as usual) compatibility reasons with older devices. Most devices use an I/O address space of 4, 8 or 16 bytes; some use as few as 1 byte and others as many as 32 or more. The wide variance in the size of the I/O addresses can make it difficult to determine and resolve resource conflicts, because often I/O addresses are referred to only by the first byte of the I/O address.

For example, people may say to “put your network card at 360h”, which may seem not to conflict with your LPT1 parallel port at address 378h. In fact many network cards take up 32 bytes for I/O; this means they use up 360-37Fh, which totally overlaps with the parallel port (378-37Fh).

I/O addresses, like other system resources, are normally used only by single devices. Having multiple devices try to use the same address would cause information to get mixed up and overwritten, sort of like having two people share a mailbox (where none of the envelopes had anything printed on them.) One of the problems with I/O addresses and conflicts is simply keeping track of them all. They can be quite confusing to keep straight, particularly since different devices use different sized address spaces.

Here are some of the more interesting I/O addresses in use in the typical PC. Of particular interest are those where conflicts are likely to occur, due to a large number of devices using the address or offering it as an option:

  • 060h and 064h: These two addresses are used by the keyboard controller, which operates both the keyboard and the PS/2 style mouse (on devices that use it).
  • 130-14Fh and 140-15Fh: These addresses are sometimes offered as options for SCSI host adapters. Note that these options partially overlap (from 140-14Fh).
  • 220-22Fh: This is the default address for many sound cards. It is also an option for some SCSI host adapters (first 16 bytes).
  • 240-24Fh: This is an optional address for sound cards and network cards (first 16 bytes for NE2000 cards).
  • 260-26Fh and 270-27Fh: This is an optional address for sound cards and network cards. NE2000-compatible network cards take 32 bytes; if set to use this I/O address, they will conflict with several system devices as well as the I/O address for either LPT2 or LPT3 in the 270-27Fh area.
  • 280-28Fh: This is an optional address for sound cards and network cards (first 16 bytes for NE2000 cards).
  • 300-30Fh: This is the default for many network cards (NE2000 cards extend to 31Fh). 300-301h is also an option for the MIDI port on many sound cards.
  • 320-32Fh and 330-33Fh: This is a busy area in the I/O memory map. First, 330-331h is the default for the MIDI port on many sound cards. 320-33Fh is an option for some NE2000-compatible network cards and will conflict with the MIDI port at this setting. Some SCSI host adapters also offer 330-34Fh as an option. Finally, the old PC/XT hard disk controller also uses 320-323h.
  • 340-34Fh: Optional areas for several device types overlap here, including two options for SCSI host adapters (330-34Fh and 340-35Fh) as well as network cards.
  • 360-36Fh and 370-37Fh: This is another “high traffic” area. 378-37Fh is used on most systems for the first parallel port, and 376-377h is used for the secondary IDE controller’s slave drive. These can conflict with an NE2000-compatible network card placed at location 360h. Tape accelerator cards often default to 370h, which will also conflict with a network card placed at 360h).
  • 3B0-3BBh and 3C0-3DFh: These are used by VGA video adapters. They take all of the areas originally assigned for monochrome cards (3B0-3BBh), CGA adapters (3D0-3DFh) and EGA adapters (3C0-3CFh).
  • 3E8-3EFh: There is a potential conflict here in locations 3EE-3EFh if you are using a third serial port (COM3) and a tertiary IDE controller.
  • 3F0-3F7h: There is actually a “standard” resource conflict here: the floppy disk controller and the slave drive on the primary IDE controller “share” locations 3F6-3F7h. These devices are actually both present in many systems. Fortunately, this conflict (which exists for historical reasons) is fairly well known and compensated for, so it will not result in problems in a typical system. Note that some tape accelerator cards also offer the use of 3F0h as an option, which will conflict with the floppy disk controller.


Pages: « Prev   1 2 3 4 5   Next »

Be the first to discuss this article!