Hardware manual
should show where the configuration file(s) reside. In Debian there are 4 options for use of this configuration
file:
Don't use this file at all. At each boot, the serial driver alone detects the ports and setserial doesn't
ever run. ("kernel" option)
1.
Save what setserial reports when the system is first shutdown and put it in the configuration file.
After that, don't ever make any changes to the configuration file, even if someone has made changes
by running the setserial command on the command line and then shuts down the system.
("autosave-once" option)
2.
At every shutdown, save whatever setserial detects to the configuration file. ("autosave" option)3.
Manually edit the configuration file to set the configuration. Don't ever do any automatic saves to it.
("manual" option)
4.
In olden days (perhaps before 2000), there wasn't any configuration file and the configuration was manually
set (hard coded) inside the shell script that ran setserial. See Edit a script (prior to version 2.15).
Probing
You probe for a port with setserial only when you suspect that it has been enabled (by PnP methods, the
BIOS, jumpers, etc.). Otherwise setserial probing will never find it since its address doesn't exist. A
problem is where the software looks for a port at specified I/O addresses. Prior to probing with "setserial", one
may run the "scanport" (Debian) command to check all possible ports in one scan. It makes crude guesses as
to what is on some ports but doesn't determine the IRQ. It's a fast first start. It may hang your PC but so far it's
worked fine for me. Note that non-Debian distributions don't seem to supply "scanport". Is there another scan
program?
With appropriate options, setserial can probe (at a given I/O address) for a serial port but you must guess
the I/O address. If you ask it to probe for /dev/ttyS2 for example, it will only probe at the address it thinks
ttyS2 is at (2F8). If you tell setserial that ttyS2 is at a different address, then it will probe at that address, etc.
See Probing
The purpose of such probing is to see if there is a uart there, and if so, what its IRQ is. Use setserial
mainly as a last resort as there are faster ways to attempt it such as wvdialconf to detect modems, looking at
very early boot-time messages, or using pnpdump --dumpregs, or lspci -vv. But if you want to detect
hardware with setserial use for example :
setserial /dev/ttyS2 -v autoconfig
If the resulting message shows a uart type such as 16550A, then you're OK. If instead it shows "unknown"
for the uart type, then there is supposedly no serial port at all at that I/O address. Some cheap serial ports don't
identify themselves correctly so if you see "unknown" you still might have a serial port there.
Besides auto-probing for a uart type, setserial can auto-probe for IRQ's but this doesn't always work right
either. In one case it first gave the wrong irq but when the command was repeated it found the correct irq. In
versions of setserial >= 2.15, the results of your last probe test could be automatically saved and put into a
distribution-specific configuration file such as /etc/serial.conf or /etc/sysconfig/serial or
/var/lib/setserial/autoserial.conf for Debian. This will be used next time you start Linux.
It may be that two serial ports both have the same IO address set in the hardware. Of course this is not
normally permitted for the ISA bus but it sometimes happens anyway. Probing detects one serial port when
actually there are two. However if they have different IRQs, then the probe for IRQs may show IRQ = 0. For
me, it only did this if I first used setserial to give the IRQ a fictitious value.
Serial HOWTO
Configuration file 44