FreeBSD Handbook : Serial Communications : Terminals : Cables and Ports
Previous: Uses and Types of Terminals
Next: Configuration

14.2.2. Cables and Ports

To connect a terminal to your FreeBSD system, you need the right kind of cable and a serial port to which to connect it. This section tells you what to do. If you are already familiar with your terminal and the cable it requires, skip to Configuration.

14.2.2.1. Cables

Because terminals use serial ports, you need to use serial---also known as RS-232C---cables to connect the terminal to the FreeBSD system.

There are a couple of kinds of serial cables. Which one you'll use depends on the terminal you want to connect:

Also, the serial port on both the terminal and your FreeBSD system must have connectors that will fit the cable you are using.

Null-modem cables

A null-modem cable passes some signals straight through, like ``signal ground,'' but switches other signals. For example, the ``send data'' pin on one end goes to the ``receive data'' pin on the other end.

If you like making your own cables, here is a table showing a recommended way to construct a null-modem cable for use with terminals. This table shows the RS-232C signal names and the pin numbers on a DB-25 connector.

   Signal     Pin#                        Pin#      Signal
   TxD        2  -----------------------  3         RxD
   RxD        3  -----------------------  2         TxD
   DTR        20 -----------------------  6         DSR
   DSR        6  -----------------------  20        DTR
   SG         7  -----------------------  7         SG
   DCD        8  ----------------------+  4         RTS*
  *RTS        4  +                     +  5         CTS*
  *CTS        5  +----------------------  8         DCD

* Connect pins 4 to 5 internally in the connector hood, and then to
  pin 8 in the remote hood.

Standard RS-232C Cables

A standard serial cable passes all the RS-232C signals straight-through. That is, the ``send data'' pin on one end of the cable goes to the ``send data'' pin on the other end. This is the type of cable to connect a modem to your FreeBSD system, and the type of cable needed for some terminals.

14.2.2.2. Ports

Serial ports are the devices through which data is transferred between the FreeBSD host computer and the terminal. This section describes the kinds of ports that exist and how they are addressed in FreeBSD.

Kinds of Ports

Several kinds of serial ports exist. Before you purchase or construct a cable, you need to make sure it will fit the ports on your terminal and on the FreeBSD system.

Most terminals will have DB25 ports. Personal computers, including PCs running FreeBSD, will have DB25 or DB9 ports. If you have a multiport serial card for your PC, you may have RJ-12 or RJ-45 ports.

See the documentation that accompanied the hardware for specifications on the kind of port in use. A visual inspection of the port often works, too.

Port Names

In FreeBSD, you access each serial port through an entry in the /dev directory. There are two different kinds of entries:

See the sio(4) manual page for more information.

If you have connected a terminal to the first serial port (COM1 in DOS parlance), then you want to use /dev/ttyd0 to refer to the terminal. If it is on the second serial port (also known as COM2), it is /dev/ttyd1, and so forth.

Note that you may have to configure your kernel to support each serial port, especially if you have a multiport serial card. See Configuring the FreeBSD Kernel for more information.


FreeBSD Handbook : Serial Communications : Terminals : Cables and Ports
Previous: Uses and Types of Terminals
Next: Configuration