serial(HW)


serial -- interface to serial ports

Description

The /dev/tty{1-15}[a-pA-P] device files provide access to the standard and optional serial ports of the computer using a clist-based serial driver (sio).

Each file corresponds to one of the serial ports (with or without modem control). Files are named according to the following conventions:

For example, with a four-port ISA expansion board installed at COM1 and a single port ISA board installed at COM2, you can access the following lines:

/dev/tty1a /dev/tty1A
/dev/tty1b /dev/tty1B
/dev/tty1c /dev/tty1C
/dev/tty1d /dev/tty1D
/dev/tty2a /dev/tty2A

The device names in the following table refer to the serial ports, with and without modem control. The table describes boards installed at COM1 through COM4. ``Minor'' is the minor device number for the port (see mknod(C)).

Serial lines
Board type Non-modem control Modem control
Minor Name Minor Name
COM1 0 tty1a 128 tty1A
COM2 8 tty2a 136 tty2A
COM3 4 tty3a 132 tty3A
COM4 12 tty4a 140 tty4A

 +-----------------------------------------------+
 |                 Serial lines                  |
 +-----------------------------------------------+
 +-----------+-------------------+---------------+
 |Board type | Non-modem control | Modem control |
 +-----------+---------+---------+-------+-------+
 |           |  Minor  |  Name   | Minor | Name  |
 +-----------+---------+---------+-------+-------+
 +-----------+---------+---------+-------+-------+
 |   COM1    |    0    |  tty1a  |  128  | tty1A |
 +-----------+---------+---------+-------+-------+
 |   COM2    |    8    |  tty2a  |  136  | tty2A |
 +-----------+---------+---------+-------+-------+
 |   COM3    |    4    |  tty3a  |  132  | tty3A |
 +-----------+---------+---------+-------+-------+
 |   COM4    |   12    |  tty4a  |  140  | tty4A |
 +-----------+---------+---------+-------+-------+

A dumb serial port board installed uses interrupt 4 if installed as COM1, and uses interrupt 3 if installed as COM2.

Access

The files may only be accessed if the corresponding serial interface card is installed and its I/O address configured correctly. Also, for multiport expansion cards, you must use the scoadmin serial program to create more than the default number of files. Unless you have added a serial board, only the port described in your hardware documentation (typically COM1 and COM2) may be used. You should also ensure that any ports on the system board are enabled and configured in the motherboard BIOS.

Serial communication

The serial ports can be used for a variety of serial communication purposes such as connecting login terminals to the computer, attaching printers, or forming a serial network with other computers. Note that a serial port may operate at most of the standard baud rates, and that the ports (on most computers and terminals) have a DTE (Data Terminal Equipment) configuration. The serial ports on most modems are configured as DCE (Data Circuit terminating Equipment). The following table defines how each pin is used for 25-pin and 9-pin connections (it is recommended that you check that the pin outs listed here correspond to those on your machine before attempting to make a connection):

25-pin 9-pin Description
1 - Shield
2 3 Transmit Data (TD or Tx; data out on DTE, data in on DCE)
3 2 Receive Data (RD or Rx; data in on DTE, data out on DCE)
4 7 Request To Send (RTS; out on DTE, in on DCE)
5 8 Clear To Send (CTS; in on DTE, out on DCE)
6 6 Data Set Ready (DSR; in on DTE, out on DCE)
7 5 Signal Ground (SG or Gnd)
8 1 Carrier Detect (CD or DCD; in on DTE, out on DCE)
20 4 Data Terminal Ready (DTR; out on DTE, in on DCE)
22 9 Ring Indicator (RI; in on DTE, out on DCE)

 +-------+-------+-----------------------------------------------------------+
 |25-pin | 9-pin | Description                                               |
 +-------+-------+-----------------------------------------------------------+
 |1      | -     | Shield                                                    |
 +-------+-------+-----------------------------------------------------------+
 |2      | 3     | Transmit Data (TD or Tx; data out on DTE, data in on DCE) |
 +-------+-------+-----------------------------------------------------------+
 |3      | 2     | Receive Data (RD or Rx; data in on DTE, data out on DCE)  |
 +-------+-------+-----------------------------------------------------------+
 |4      | 7     | Request To Send (RTS; out on DTE, in on DCE)              |
 +-------+-------+-----------------------------------------------------------+
 |5      | 8     | Clear To Send (CTS; in on DTE, out on DCE)                |
 +-------+-------+-----------------------------------------------------------+
 |6      | 6     | Data Set Ready (DSR; in on DTE, out on DCE)               |
 +-------+-------+-----------------------------------------------------------+
 |7      | 5     | Signal Ground (SG or Gnd)                                 |
 +-------+-------+-----------------------------------------------------------+
 |8      | 1     | Carrier Detect (CD or DCD; in on DTE, out on DCE)         |
 +-------+-------+-----------------------------------------------------------+
 |20     | 4     | Data Terminal Ready (DTR; out on DTE, in on DCE)          |
 +-------+-------+-----------------------------------------------------------+
 |22     | 9     | Ring Indicator (RI; in on DTE, out on DCE)                |
 +-------+-------+-----------------------------------------------------------+

When physically connecting two pieces of equipment using a serial cable, it is necessary to determine: Only TD, RD and Signal Ground need be connected for a terminal (or direct) connection that uses XON/XOFF flow control.

A port with modem control uses TD, RD, and Signal Ground in the same way as a non-modem control port. On a non-modem control port, RTS and DTR are asserted and CD is not monitored. With modem control, RTS and DTR are asserted, and the state of CD is monitored. No signal is transmitted on TD until CD is asserted from another source (such as a modem).

It is generally recommended that the Shield is only connected at the DTE end to prevent current (or ``hum'') loops being set up. Elimination of noise, and protection against electrical interference and lightning pulse overvoltage should be referred to a communications expert.

Modem connections

The RS 232D standard has the following 25-pin connections for linking DTE to DCE (the 9-pin equivalents are given in parentheses):

DTE   DCE
1 (-)   - (-)
2 (3) to 2 (3)
3 (2) to 3 (2)
4 (7) to 4 (7)
5 (8) to 5 (8)
6 (6) to 6 (6)
7 (5) to 7 (5)
8 (1) to 8 (1)
20 (4) to 20 (4)
22 (9) to 22 (9)

 +-------+----+--------+
 |DTE    |    | DCE    |
 +-------+----+--------+
 |1 (-)  |    | - (-)  |
 +-------+----+--------+
 |2 (3)  | to | 2 (3)  |
 +-------+----+--------+
 |3 (2)  | to | 3 (2)  |
 +-------+----+--------+
 |4 (7)  | to | 4 (7)  |
 +-------+----+--------+
 |5 (8)  | to | 5 (8)  |
 +-------+----+--------+
 |6 (6)  | to | 6 (6)  |
 +-------+----+--------+
 |7 (5)  | to | 7 (5)  |
 +-------+----+--------+
 |8 (1)  | to | 8 (1)  |
 +-------+----+--------+
 |20 (4) | to | 20 (4) |
 +-------+----+--------+
 |22 (9) | to | 22 (9) |
 +-------+----+--------+
RI is only used by some types of modem.

Null-modem connections

For direct connection linking DTE to DTE (computer to computer, DTE terminal to computer), the 25-pin connections (9-pin equivalents given in parentheses) are:

DTE   DTE
1 (-)   - (-)
2 (3) to 3 (2)
3 (2) to 2 (3)
4 (7) to 5 (8)
5 (8) to 4 (7)
6=8 (6=1) to 20 (4)
7 (5) to 7 (5)
20 (4) to 6=8 (6=1)

 +----------+----+-----------+
 |DTE       |    | DTE       |
 +----------+----+-----------+
 |1 (-)     |    | - (-)     |
 +----------+----+-----------+
 |2 (3)     | to | 3 (2)     |
 +----------+----+-----------+
 |3 (2)     | to | 2 (3)     |
 +----------+----+-----------+
 |4 (7)     | to | 5 (8)     |
 +----------+----+-----------+
 |5 (8)     | to | 4 (7)     |
 +----------+----+-----------+
 |6=8 (6=1) | to | 20 (4)    |
 +----------+----+-----------+
 |7 (5)     | to | 7 (5)     |
 +----------+----+-----------+
 |20 (4)    | to | 6=8 (6=1) |
 +----------+----+-----------+
The equals sign (=) denotes that the pins are to be linked within a connector.

DTR from each serial port is connected to CD and DSR on the other serial port. This simulates the assertion of these lines by a port configured as DCE.

Another way to achieve this is by connecting DTR, CD and DSR at the same end. This is often done when connecting DTE terminals to a DTE serial port. Shown below is an example for connecting a terminal which uses software flow control only (no modem control):

Computer (DTE)   Terminal (DTE)
- (-)   1 (-)
2 (3) to 3 (2)
3 (2) to 2 (3)
6=8=20 (6=1=4)   - (-)
7 (5) to 7 (5)

 +----------------+----+----------------+
 |Computer (DTE)  |    | Terminal (DTE) |
 +----------------+----+----------------+
 |- (-)           |    | 1 (-)          |
 +----------------+----+----------------+
 |2 (3)           | to | 3 (2)          |
 +----------------+----+----------------+
 |3 (2)           | to | 2 (3)          |
 +----------------+----+----------------+
 |6=8=20 (6=1=4)  |    | - (-)          |
 +----------------+----+----------------+
 |7 (5)           | to | 7 (5)          |
 +----------------+----+----------------+
Many terminal manufacturers recommend that DTR, CD, and DSR are not connected at the terminal end if a modem control protocol is not being used.

Printer connections with RTS/CTS flow control

To connect an RTS/CTS unidirectional protocol printer (the printer is assumed to be configured as DTE), the 25-pin connections (9-pin equivalents given in parentheses) are:

Computer (DTE)   Printer (DTE)
- (-)   1 (-)
2 (3) to 3 (2)
3 (2) to 2 (3)
4 (7) to 5 (8)
5 (8) to 4 (7)
6=20 (6=4)   - (-)
7 (5) to 7 (5)

 +----------------+----+---------------+
 |Computer (DTE)  |    | Printer (DTE) |
 +----------------+----+---------------+
 |- (-)           |    | 1 (-)         |
 +----------------+----+---------------+
 |2 (3)           | to | 3 (2)         |
 +----------------+----+---------------+
 |3 (2)           | to | 2 (3)         |
 +----------------+----+---------------+
 |4 (7)           | to | 5 (8)         |
 +----------------+----+---------------+
 |5 (8)           | to | 4 (7)         |
 +----------------+----+---------------+
 |6=20 (6=4)      |    | - (-)         |
 +----------------+----+---------------+
 |7 (5)           | to | 7 (5)         |
 +----------------+----+---------------+

If the printer is configured as DCE, the connections become:

Computer (DTE)   Printer (DCE)
- (-)   1 (-)
2 (3) to 2 (3)
3 (2) to 3 (2)
4 (7) to 4 (7)
5 (8) to 5 (8)
6=20 (6=4)   - (-)
7 (5) to 7 (5)

 +----------------+----+---------------+
 |Computer (DTE)  |    | Printer (DCE) |
 +----------------+----+---------------+
 |- (-)           |    | 1 (-)         |
 +----------------+----+---------------+
 |2 (3)           | to | 2 (3)         |
 +----------------+----+---------------+
 |3 (2)           | to | 3 (2)         |
 +----------------+----+---------------+
 |4 (7)           | to | 4 (7)         |
 +----------------+----+---------------+
 |5 (8)           | to | 5 (8)         |
 +----------------+----+---------------+
 |6=20 (6=4)      |    | - (-)         |
 +----------------+----+---------------+
 |7 (5)           | to | 7 (5)         |
 +----------------+----+---------------+

Printer connections with DTR handshaking

To connect a printer which uses DTR for handshaking (the printer is assumed to be configured as DTE), the 25-pin connections (9-pin equivalents given in parentheses) are:

Computer (DTE)   Printer (DTE)
- (-)   1 (-)
2 (3) to 3 (2)
3 (2) to 2 (3)
5 (8) to 20 (4)
6=20 (6=4)   - (-)
7 (5) to 7 (5)

 +----------------+----+---------------+
 |Computer (DTE)  |    | Printer (DTE) |
 +----------------+----+---------------+
 |- (-)           |    | 1 (-)         |
 +----------------+----+---------------+
 |2 (3)           | to | 3 (2)         |
 +----------------+----+---------------+
 |3 (2)           | to | 2 (3)         |
 +----------------+----+---------------+
 |5 (8)           | to | 20 (4)        |
 +----------------+----+---------------+
 |6=20 (6=4)      |    | - (-)         |
 +----------------+----+---------------+
 |7 (5)           | to | 7 (5)         |
 +----------------+----+---------------+
If the printer is configured as DCE, the connections become:

Computer (DTE)   Printer (DCE)
- (-)   1 (-)
2 (3) to 2 (3)
3 (2) to 3 (2)
5 (8) to 20 (4)
6=20 (6=4)   - (-)
7 (5) to 7 (5)

 +----------------+----+---------------+
 |Computer (DTE)  |    | Printer (DCE) |
 +----------------+----+---------------+
 |- (-)           |    | 1 (-)         |
 +----------------+----+---------------+
 |2 (3)           | to | 2 (3)         |
 +----------------+----+---------------+
 |3 (2)           | to | 3 (2)         |
 +----------------+----+---------------+
 |5 (8)           | to | 20 (4)        |
 +----------------+----+---------------+
 |6=20 (6=4)      |    | - (-)         |
 +----------------+----+---------------+
 |7 (5)           | to | 7 (5)         |
 +----------------+----+---------------+

Supported ioctls

See the termio(M) and termios(M) manual pages for a description of the ioctl(S) commands supported by the sio driver.

Diagnostics

The following error messages may be displayed on the console. See messages(M) for general information about kernel error messages, including a list of generic device driver errors.

WARNING: serial: Serial adapter (type=m, nports=n) not found
A serial adapter could not be found.

WARNING: serial: Garbage or loose cable on dev n, port shut down
Too many interrupts were received together. Check the connections on the port.

%serial 0x02F8-0x02FF  3  -  unit=1 type=Standard nports=1 base=8 16550A/16
In this message:

0x02F8-0x02FF
is the I/O port range

3
is the IRQ

unit=1
indicates the board number

type=Standard
indicates the board manufacturer

nports=1
indicates the number of ports on the board

base=8
indicates the starting minor number for the board

16550A/16
identifies the type of UARTs on the board
The unit number is always one less than the board number encoded in the device name. In this example, the board's sole port will be accessed through tty2a.

Limitations

If you log in via a modem control serial line, hanging up logs that line out and kills your background processes. See nohup(C) and csh(C).

You cannot use the same serial port with both modem and non-modem control at the same time. For example, you cannot use tty1a and tty1A simultaneously.

Files


/dev/tty{1-4}[a-p]
non-modem control device nodes for ISA serial ports

/dev/tty{1-4}[A-P]
modem control nodes for ISA serial ports

/dev/tty{5-15}[a-p]
non-modem control device nodes for PCI serial ports

/dev/tty{5-15}[A-P]
modem control device nodes for PCI serial ports

/etc/conf/pack.d/sio/space.c
hardware configuration tables

See also

cmos(ADM), csh(C), cu(C), getty(M), mkdev(ADM), mknod(C), nohup(C), open(S), stty(C), termio(M), termios(M), tty(M), uucp(C)
© 2007 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 05 June 2007