Contributed by &a.kelly; The original Unix systems did not have consoles. Instead,
people logged in and ran programs through terminals that were
connected to the computer's serial ports. It is quite similar
to using a modem and some terminal software to dial into a
remote system to do text-only work.
Today's PCs have consoles capable of high quality graphics,
but the ability to establish a login session on a serial port
still exists in nearly every Unix-style operating system
today; FreeBSD is no exception. By using a terminal attached
to a unused serial port, you can log in and run any text
program that you would normally run on the console or in an
Dumb terminals are specialized pieces of hardware that let
you connect to computers over serial lines. They are called
``dumb'' because they have only enough computational power
to display, send, and receive text. You cannot run any
programs on them. It is the computer to which you connect
them that has all the power to run text editors, compilers,
email, games, and so forth.
There are hundreds of kinds of dumb terminals made by
many manufacturers, including Digital Equipment
Corporation's VT-100 and Wyse's WY-75. Just about any kind
will work with FreeBSD. Some high-end terminals can even
display graphics, but only certain software packages can
take advantage of these advanced features.
Dumb terminals are popular in work environments where
workers do not need access to graphic applications such as
those provided by the X Window System.
If a has just
enough ability to display, send, and receive text, then
certainly any spare personal computer can be a dumb
terminal. All you need is the proper cable and some
X terminals are the most sophisticated kind of terminal
available. Instead of connecting to a serial port, they
usually connect to a network like Ethernet. Instead of
being relegated to text-only applications, they can display
any X application.
We introduce X terminals just for the sake of completeness.
However, this chapter does 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
.
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:
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.
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.
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.
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.
In FreeBSD, you access each serial port through an entry
in the /dev directory. There are two different
kinds of entries:
This section describes what you need to configure on your
FreeBSD system to enable a login session on a terminal. It
assumes you have already configured your kernel to support the
serial port to which the terminal is connected---and that you
have connected it.
In a nutshell, you need tell the /etc/ttys file.
First, use the /etc/ttys:
First, you need to add an entry to the /etc/ttys
file, unless one is already there.
The /etc/ttys file lists all of the ports on your
FreeBSD system where you want to allow logins. For example,
the first virtual console ttyv0 has an entry in
this file. You can log in on the console using this entry.
This file contains entries for the other virtual consoles,
serial ports, and pseudo-ttys. For a hardwired terminal,
just list the serial port's /dev entry without the
/dev part.
When you installed your FreeBSD system, the
/etc/ttys file included entries for the first four
serial ports: /etc/ttys file
after we add the new entry:
Next, we need to specify what program will be run to handle
the logins on a terminal. For FreeBSD, the standard program
to do that is /usr/libexec/getty. It is what
provides the login: prompt.
The program /etc/gettytab.
The file /etc/gettytab contains lots of entries for
terminal lines both old and new. In almost all cases, the
entries that start with the text /etc/ttys
file, make sure that the communications settings on the
terminal match.
For our example, the Wyse-50 uses no parity and connects at
38400 bps. The 286 PC uses no parity and connects at 19200
bps. Here is the /etc/ttys file so far (showing
just the two terminals in which we are interested):
The third field in the /etc/ttys file lists the
default terminal type for the port. For dialup ports, you
typically put /etc/ttys file, users can forego such
prompting.
To find out what terminal types FreeBSD supports, see the
file /usr/share/misc/termcap. It lists about 600
terminal types. You can add more if you wish. See the
termcap(5) manual page for information.
In our example, the Wyse-50 is a Wyse-50 type of terminal
(although it can emulate others, we will leave it in Wyse-50
mode). The 286 PC is running Procomm which will be set to
emulate a VT-100. Here are the pertinent yet unfinished
entries from the /etc/ttys file:
The next field in /etc/ttys, the fourth field,
tells whether to enable the port. Putting /etc/ttys file. We have turned each
port We have arrived at the last field (well, almost: there is
an optional /etc/ttys file, with comments added to describe
where the terminals are:
When you boot FreeBSD, the first process, /etc/ttys file and start the programs
listed for each enabled port to prompt for logins.
After you edit /etc/ttys, you do not want to have
to reboot your system to get /etc/ttys if it receives
a SIGHUP (hangup) signal.
So, after you have saved your changes to /etc/ttys,
send SIGHUP to Even with the most meticulous attention to detail, something
could still go wrong while setting up a terminal. Here is a
list of symptoms and some suggested fixes.