Hardware manual
using a menu or a configuration file. This high-level configuring may also be done manually with the stty
program. stty is also useful to view the current status if you're having problems. See the section Stty
8. Locating the Serial Port: IO address, IRQs
8.1 What Bus is my Serial Port On?
If you need to find a serial port it often helps if you know what bus it's on. If the serial port is on a card, you
may know what bus the card inserts into such as a PCI slot. But if the serial port is built into the motherboard
it may not be clear what bus it's on. For old motherboards that have ISA bus slots, it's likely on the ISA bus
and may not even be Plug-and-Play. But even if all your slots are PCI, the serial port is likely to be on either
an ISA bus or LPC bus (also called a "LPC interface"). LPC is common on laptop computers. Type "lspci" to
see if it shows "LPC". Unfortunately, the LPC bus has no standard Plug-and-Play method for low-level
configuring devices on it. But according to the specs, the BIOS is supposed to do such configuring (using
ACPI ??). To see if you have a LPC bus, type "lspci" and look for a LPC bridge or the like.
8.2 IO & IRQ Overview
For a serial port to work properly it first must be given both an IO address and an IRQ. For old hardware (of
mid 1990s), jumpers on a card or a saved BIOS setting does it. For newer hardware the BIOS or Linux must
set them at boot-time, and the new hardware doesn't remember how it was set once it's powered down.
Enabling the hardware (by using software) gives it both an IRQ and an IO address. Without an IO address, it
can't be used. Without an IRQ it will need to use inefficient polling methods for which one must set the IRQ
to 0 in the serial driver. Using digital signals sent to the hardware by the BIOS or Linux, it all should get
configured automatically (provided the BIOS has not been previously set up to disable it). So you only need to
read this if you're having problems or if you want to understand how it works.
The driver must of course know both the IO address and IRQ so that it can talk to the serial port chip. Modern
serial port drivers (kernel 2.4) try to determine this by PnP methods so one doesn't normally need to tell the
driver (by using "setserial"). A driver may also set an IO address or IRQ in the hardware. But unfortunately,
there is some PCI serial port hardware that the driver doesn't recognize so you might need to enable the port
yourself. See PCI: Enabling a disabled port
For the old ISA bus, the driver also probes likely serial port addresses to see if there are any serial ports there.
This works for the case of jumpers and sometimes works for a ISA PnP port when the driver doesn't do ISA
PnP (prior to kernel 2.4).
Locating the serial port by giving it an IRQ and IO address is low-level configuring. It's often automatically
done by the serial driver but sometimes you have to do it yourself. What follows repeats what was said above
but in more detail.
The low-level configuring consists of assigning an IO address, IRQ, and names (such as ttyS2) . This IO-IRQ
pair must be set in both the hardware and told to the serial driver. And the driver needs to call this pair a name
(such as ttyS2). We could call this "io-irq" configuring for short. The modern way to do this is for the driver
to use PnP methods to detect/set the IO/IRQ and then remember what it did. An easy way for a driver to do
this is for the driver to ask the kernel to enable the device and then the kernel tells the driver what IO/IRQ it
has used. The old way is using the "setserial" program to tell the driver. For jumpers, there is no PnP but the
driver might detect the port if the jumpers are set to the usual IO/IRQ. If you need to configure but don't
understand certain details it's easy to get into trouble.
Serial HOWTO
7. Configuring Overview 27