Previous Next Contents

8. How do I set up a terminal connected to my PC?

8.1 Hardware requirements

Make sure you have the right kind of cable. A null modem cable bought at a computer store will do it. But it must be a null modem cable! Make sure you are using your serial port, the male DB25 or the DB9, and not your parallel port.

For a DB25 connector, you need a minimum of:

        TxD   Transmit Data         2 - 3       RxD   Receive Data
        RxD   Receive Data          3 - 2       TxD   Transmit Data
        SG    Signal Ground         7 - 7       SG    Signal Ground

If you want to have hardware handshaking signals, you must have a full null modem cable:

        TxD   Transmit Data         2 - 3       RxD   Receive Data
        RxD   Receive Data          3 - 2       TxD   Transmit Data
        RTS   Request To Send       4 - 5       CTS   Clear To Send     
        CTS   Clear To Send         5 - 4       RTS   Request To Send 
        DSR   Data Set Ready        6 - 20      DTR   Data Terminal Ready
        SG    Signal Ground         7 - 7       SG    Signal Ground
        DCD   Carrier Detect        8 - 20      DTR   Data Terminal Ready
        DTR   Data Terminal Ready  20 - 6       DSR   Data Set Ready
        DTR   Data Terminal Ready  20 - 8       DCD   Carrier Detect

If you have a DB9 connector on your serial port, try the following:

                                  DB9   DB25 
        RxD   Receive Data          2 - 2       TxD   Transmit Data
        TxD   Transmit Data         3 - 3       RxD   Receive Data
        SG    Signal Ground         5 - 7       SG    Signal Ground

Alternatively, a full DB9-DB25 null modem cable:

                                  DB9   DB25 
        DCD   Carrier Detect        1 - 20      DTR   Data Terminal Ready
        RxD   Receive Data          2 - 2       TxD   Transmit Data
        TxD   Transmit Data         3 - 3       RxD   Receive Data
        DTR   Data Terminal Ready   4 - 6       DSR   Data Set Ready
        DTR   Data Terminal Ready   4 - 8       DCD   Carrier Detect
        SG    Signal Ground         5 - 7       SG    Signal Ground
        DSR   Data Set Ready        6 - 20      DTR   Data Terminal Ready
        RTS   Request To Send       7 - 5       CTS   Clear To Send
        CTS   Clear To Send         8 - 4       RTS   Request To Send
        (RI Ring Indicator          9 not needed)

If you are not using a full null modem cable, you might have to do the following trick: on your computer side of the connector, connect RTS and CTS together, and also connect DSR, DCD and DTR together. This way, when the computer wants a certain handshaking signal, it will get it (from itself).

Now that you have the right kind of cable, connect your terminal to your computer. If you can, tell you terminal to ignore modem control signals. Try using 9600 bps, 8 data bits, 1 stop bit, no parity bits for the terminal's setup.

8.2 Setting up getty

Install getty_ps as described in section 7.2. Add an entry for getty to use for your terminal in /etc/gettydefs:

# 38400 bps Dumb Terminal entry
DT38400# B38400 CS8 CLOCAL # B38400 SANE -ISTRIP CLOCAL #@S @L login: #DT38400
# 19200 bps Dumb Terminal entry
DT19200# B19200 CS8 CLOCAL # B19200 SANE -ISTRIP CLOCAL #@S @L login: #DT19200
# 9600 bps Dumb Terminal entry
DT9600# B9600 CS8 CLOCAL # B9600 SANE -ISTRIP CLOCAL #@S @L login: #DT9600

If you want, you can make getty print interesting things in the login banner. In my examples, I have the system name and the serial line printed. You can add other things:

@B    The current (evaluated at the time the @B is seen) bps rate.
@D    The current date, in MM/DD/YY.
@L    The serial line to which getty is attached.
@S    The system name.
@T    The current time, in HH:MM:SS (24-hour).
@U    The number of currently signed-on users.  This is  a
      count of the number of entries in the /etc/utmp file
      that have a non-null ut_name field.
@V    The value of VERSION, as given in the defaults file.
To display a single '@' character, use either '\@' or '@@'.

Edit your /etc/inittab file to run getty on the serial port (substituting in the correct information for your environment - port, speed, and default terminal type):

S1:456:respawn:/sbin/getty ttyS1 DT9600 vt100

Restart init:

linux# init q 

At this point, you should see a login prompt on your terminal. You may have to hit return to get the terminal's attention. Rejoice.

8.3 Notes on setting up a PC as a terminal

Many people set up other PCs as terminals connected to Linux boxen. For example, old 8088 or 286 PCs are perfect for this purpose. All you need is a DOS boot disk containing a version of DOS suitable for your terminal-PC, and a communications program for your terminal-PC to run. kermit works very well for this purpose. You can find precompiled versions of kermit for nearly every OS in existence at watsun.cc.columbia.edu:/pub/ftp/kermit. Other popular DOS comm programs such as telix and procomm will work equally well. Be sure to input correct serial port information into your terminal-PC's communications setup.


Previous Next Contents