From: Theodore Ts'o (tytso@athena.mit.edu)
Date: 04/12/93


From: Theodore Ts'o <tytso@athena.mit.edu>
Subject: Re: Configuring Serial Ports
Date: 13 Apr 1993 00:23:27 -0400


   From: cs416530@lux.latrobe.edu.au (Matthew I Gillard)
   Date: Mon, 12 Apr 1993 14:29:14 GMT

   Lastly, I put my modem on COM 1 and the same error happened. It is like
   where ever I put my modem, UNIX doesn't think that COM port exists.

This should be a FAQ:

Q. Help! My serial ports don't work! I haven't bothered collecting
any data about why they might not be working! What should I do?

A. First of all, you need to collect some data. :-)

Watch as Linux boots, and look at the messages printed by the kernel.
You will see a message of the form

Serial driver version 3.91 with XXXX options enabled.

MAKE SURE YOU INCLUDE WHAT VERSION OF LINUX YOU ARE RUNNING, WHICH
VERSION OF THE SERIAL DRIVER YOU HAVE RUNNING, AND WHAT OPTIONS ARE
ENABLED IN ANY BUG REPORT!!!!!

Then, you will see some a line for each serial line configured by the
kernel. They will be of the form:

tty01 at 0x03F8 (irq = 4) is a 16550A

MAKE SURE YOU INCLUDE ALL SUCH LINES IN ANY BUG REPORT, TOO!!!!

If your problem is that you are not seeing any serial ports configured
during the boot process, then look to see what options the kernel was
compiled with when it printed the "Serial Driver version X.XX ...."
message. If it included the AUTO_IRQ option, then the problem might be
that you are unlucky enough to have hardware which doesn't work well
with the automatic IRQ dection software. Try recompiling the kernel
with AUTO_IRQ turned off (you can do this by typing "make config", and
reconfiguring the compile options, and try again).

If it did not include the AUTO_IRQ option, then the lines printed out
may have had an erroneous IRQ assignment; you will need to fix that
either by recompiling the kernel and modifying the rs_table[] in the
kernel/chr_drv/serial.c file, or you will need to use the setserial
program.

The setserial program can also be used when the kernel just completely
fails to configure the serial line no matter what. A common case where
this might happen is with the Rockwell chipset internal modems, which
have a strange/buggy implementation of the 16550A which fails the UART
test done by the serial line. Using the setserial command is very
simple; here is an example:

/etc/setserial /dev/ttys0 uart 16550A port 0x3f8 irq 4

If you want to save all of the trouble of reconfiguring your kernel, you
can just put an /etc/setserial line in your /etc/rc file, and simply
adjust all of the serial port paramaters at runtime.

                                        - Ted