2.2. Select a serial port

2.2.1. Serial port names

Linux names its serial ports in the UNIX tradition. The first serial port has the file name /dev/ttyS0, the second serial port has the file name /dev/ttyS1, and so on.

This differs from the IBM PC tradition. The first serial port is named COM1:, the second serial port is named COM2:, and so on. Up to four serial ports can be present on a IBM PC/AT computer and its successors.

Most boot loaders have yet another naming scheme. The first serial port is numbered 0, the second serial port is numbered 1, and so on.

If your distribution of Linux uses the devfs device manager then the serial ports have yet another name. The first serial port is /dev/tts/0, the second serial port is /dev/tts/1, and so on.

The result is that the first serial port is labeled COM1: on the chassis of the IBM PC; is known as /dev/ttyS0 to Linux; is known as /dev/tts/0 to Linux's running devfs; and is known as port 0 to many boot loaders.

The examples in this HOWTO use this first serial port, as that is the serial port which most readers will wish to use.

2.2.2. Cannot share interrupt used for console's serial port

When used for a console the serial port cannot share an interrupt with another device. The IBM PC devices are usually installed as shown in Table 2-2. If you use the serial port /dev/ttyS0 for the console then you should avoid sharing interrupt 4 by not installing a serial port /dev/ttyS2 in your PC. If /dev/ttyS2 cannot be physically removed then disable it using the setserial command, as shown in Figure 2-1.

Note that the interrupt-sharing constraint appears to apply to all computer architectures, not just Intel Architecture 32.