COHERENT manpages
This page displays the COHERENT manpage for terminal [Technical Information].
List of available manpages
Index
terminal -- Technical Information
This article describes how you can hook up a terminal to your COHERENT
system via a serial port. It also discusses common problems that arise
with this procedure, as diagnosed daily by the technical support staff at
Mark Williams Company. For information on connecting a modem to your
computer's serial port, see the article modem.
Terminals for Beginners
To a beginner, a terminal -- with its many wires and controls -- may be
daunting. However, connecting a terminal or PC-based terminal emulator to
a COHERENT system is really very easy. To make matters even easier, this
section discusses how to use a simple configuration, using only one COM
port.
What you need:
1. A COHERENT system with a COM port.
2. Either a terminal or a PC with a COM port and communications software.
An old PC or PC-AT is fine. (You can also use a Macintosh or other such
computer, but that is beyond the scope of this discussion.)
3. A ``null modem cable'' purchased from your nearest computer supply
store. This should cost between $10 and $20, in U.S. currency. The
only tricky part about the cable is making sure that the connectors on
the ends match the connectors on your COM ports (i.e., nine pin vs. 25
pin, and male vs female. Adaptors are also available.
What you do:
1. Connect the cable to the COM port on the COHERENT system. Note that the
COM port on your COHERENT system is always a male plug (that is, it has
pins rather than sockets). Do not plug your connection into a female
plug, as this is the parallel port. If you do so, you can damage your
equipment.
2. Connect the cable to the COM port on the terminal/PC. If you are using
a PC as a terminal, the COM port on it will also be male. If you are
using a stand-alone terminal, the plug could be either male or female.
If you are using a stand-alone terminal, there may be a plug on the back
that is labelled ``AUX''. Do not use this plug; use the other one.
3. Configure the terminal/PC to use 9600 speed (or ``baud'') and 8N1
character setting (that is, eight bits, no parity, one stop bit. Note
that you do not need a telephone number: you won't be dialing anywhere.
4. Log in on your COHERENT system as the superuser root. Type the following
command:
/etc/enable com?l
where `?' is the number of the COM port on your COHERENT system into
which you are plugging the cable from the PC or terminal Note that the
last character is lower-case `L', not a one.
5. Now come a tricky part: use your favorite text editor and edit file
/etc/ttytype. This file gives the default type of terminal that will be
connecting to COHERENT via a given COM port. This is important. If you
don't do this, such screen-oriented programs as editors and vsh will not
work properly.
Each entry in /etc/ttytype has two columns: the first gives a type of
terminal, and the second names the port. The following shows an example
entry:
vt100 com3l
In this instance, COM port com3l has a DEC VT-100 plugged into it by
default. Look for an entry for the COM port into which you plugged your
terminal device. If you can't find you, you can create one easily
enough; however, having two entries for the same port is not a good
idea, as COHERENT will become confused.
If you are plugging in a PC, use the terminal type vt100. If you are
using a stand-alone terminal, name the type of terminal you are using,
e.g., wyse370 for a Wyse 370 color terminal. If you cannot figure out
what type of terminal you are using, use dumb. This will not allow you
to use screen-oriented programs like MicroEMACS, but at least you will
be able to connect to COHERENT; you can figure out the type of terminal
later.
6. Return to your terminal device. If you are using a PC, invoke the
terminal emulator, and put it into ``connect'' mode. If you are using a
stand-alone terminal, turn it on. Press <return>. After a short pause,
you should see the prompt
Coherent login:
on your screen. You can then log in and run normally.
That's all there is to it. In this way, you can get more use out of an
old, obsolete PC. After you get it working, you may need to adjust some
other settings, particularly if you are using a communications package on a
PC for a terminal.
If you see garbage characters when you log in, probably the speed (or
``baud rate'') is not set correctly either on the COM port of your COHERENT
system or on your terminal device. The Lexicon article on ttys describes
the magic character string used to describe each com port and one of the
letters is the port speed.
Problems with Terminal Hookup
As noted above, it is easy to hook up a terminal. However, problems can
arise if you overlook any details.
When problems arise, they usually come from some form of confusion. These
can include send/receive confusion, baud rate confusion, and shell/no shell
confusion. The following sections describes eacy type of confusion in
turn.
Send/Receive Confusion
This most often happens when you've soldered your own connectors, and you
made a mistake. If you purchased a connector, as we recommended above,
then skip to the next section.
A serial connection between your computer and a terminal requires at least
three wires: one each for pins 2, 3, and 7. These pins, respectively,
control send (TD), receive (RD), and signal-ground (Gnd or SG). These pin
numbers correspond to the 25-pin ``DB-25'' connectors used on most
equipment. If your system has the AT-style nine-pin ``DB-9'' connectors,
you will need to wire to the corresponding signals. See the Lexicon entry
for RS-232 for details of the pin-outs for these two connectors.
When hooking up a terminal to a serial port using a three-wire connection,
you must cross pins 2 and 3, so that each device's send pin talks to the
other device's receive pin. You can plug a device called a ``null modem''
between the cable and the serial port, to do this automatically.
Note that the only symptom of a problem in the cable is that nothing
appears on your terminal when you type.
Baud-Rate Confusion
The terminal and the computer must speak to each other at the same speed,
or ``baud rate''. A typical symptom of baud-rate confusion is garbage
characters on the screen. When the wiring is wrong, you see nothing; when
the baud rate is wrong, you see random collections of characters on the
screen, but nothing meaningful.
You can fix baud-rate problems by using the command stty to reset the baud
rate on the port, or resetting the baud rate on the terminal. The problem
should also be solved by editing file /etc/ttys. For directions on how to
reset the baud rate for a port, see the Lexicon entry for stty; see the
Lexicon entry for ttys for information on how to edit /etc/ttys.
Please note, too, that COHERENT supports the following configuration for
terminals:
8 word bits
1 stop bit
No parity bits
These settings, as well as the baud rate, must match before your terminal
will work correctly.
The Old Shell Game
Before a terminal is useful to you, you must enable the port into which it
is plugged. Enabling a port means that the COHERENT system creates a shell
for that port: this, in turn, means that COHERENT prints a login prompt on
the device plugged into that port, and reads and processes interactively
commands that are entered from that port. The COHERENT system also
restricts permissions on all enabled serial ports, so that only the
superuser root can read and write to the port. This prevents other users
who may be using the system from accessing the serial port.
Note that not all ports need be enabled: for example, you should not enable
a COM port into which you've plugged a printer.
When you boot the COHERENT system, it reads system file /etc/ttys and
creates a shell for each serial port that needs one. One way to enable a
port is to log in as the superuser root, then use a text editor to change
the port's entry in /etc/ttys, as described its Lexicon article. Finally,
typing the command
kill quit 1
forces COHERENT to re-read /etc/ttys and so create a shell for the port.
Note that doing this will ensure that the port is re-enabled every time you
boot.
A better way to enable a port is to use the command enable, as described in
its Lexicon article. For example, to put up a shell on COM port
/dev/com1r, log in as the superuser root and type the command:
/etc/enable com1r
Exiting Raw Mode
A terminal is in cooked mode. In cooked mode, the tty driver interprets
and correctly processes such predefined characters as the end-of-file
character or the quit character. In raw mode, however, processing of such
characters is turned off; and in general the terminal will behave
bizarrely. Raw mode is used by programs that do not want the tty driver to
interpret characters; for example, a program that uses a tty to transmit a
binary to another machine does not want the tty driver to be interpreting
the binary information being passed through it.
Occasionally, a program will exit abruptly and leave the terminal in raw
mode. To return to cooked mode, use the command <ctrl-J> stty sane
<ctrl-J>. This invokes the command stty, which lets you manipulate
terminal settings, to restore the previous cooked state. See the Lexicon
entry on stty for details on raw and cooked modes; this article also
describes the options of this most useful command.
See Also
Administering COHERENT,
asy,
device drivers,
hs,
modem,
RS-232,
sgtty,
stty,
termcap,
terminfo,
termio,
termios,
ttys
Notes
One final bit of hard-won wisdom: once you have something working, write
down what you did, and store it in a place where you won't lose it. Note
especially what connectors are where and how they have been cabled
together. It makes life easier just knowing that you are looking for a
female-to-female cable instead of male-to-female or male-to-male. If you
know whether to insert a null modem, you are even better off.
COHERENT supports multi-port serial cards as well as COM ports 1 through 4.
See the Lexicon entry on asy for a list of the devices that COHERENT
supports, and for details.
Thanks to Dave Hough (tecdah1@sdc.cs.boeing.com), whose posting to
comp.os.coherent is the basis of the ``Beginners'' section, above.











