[Wolves] Serial terminal
James Turner
james at turnersoft.co.uk
Wed Jul 20 00:55:33 BST 2005
On Tuesday 19 Jul 2005 16:28, Adam Sweet wrote:
> How easy is this? I know I can use minicom or seyon
> from a linux machine, telix from DOS or hyperterminal
> from Windows etc.
I've seen it done using an old green-screen dumb terminal and a home-made
cable. It works, but it isn't entirely pretty.
It's been ages, but here goes... I'll bet Ron knows every detail. :)
> I've been looking at the following:
>
> http://www.tldp.org/HOWTO/Text-Terminal-HOWTO.html
The most relevant sections to setting up a basic terminal are 11.3 (physical
connection) and 14 (software connection).
Fundamental to the operation is running the getty command (or one of its
varients like agetty, mgetty, mingetty, etc) on the serial port corresponding
to the terminal (e.g. /dev/ttyS0). Some variants of getty are more suited to
use with a serial terminal than others - see the HOWTO for various
recommendations.
I'd suggest using a ready-made null modem cable if possible, rather than
making your own, unless you're into that sort of thing. To start off with,
you may well be able to test things by running getty from the command line.
You may also need to use setserial and/or stty commands to configure the
serial port.
Once things are working OK, you could transfer the settings into /etc/inittab
so that the serial console is run on boot, and getty is re-run to display
another login prompt when someone logs off, etc.
More background info
--------------------
Traditionally, the getty program will send the contents of the /etc/issue file
to the terminal (typically announcing the operating system type, etc)
followed by the login prompt, for example:
Fedora Core release 4 (Stentz)
Kernel 2.6.11-1.1369_FC4smp on an i686
login:
After the user enters their user name, control is passed to /sbin/login to log
the user on (which generally includes prompting for and checking the
password). If all is well, login sets ownership on the TTY device
(under /dev) and runs the user's choice of shell (e.g. /bin/bash) as
specified in /etc/passwd, with the standard input, output and error streams
directed to the TTY device. This behaviour is (or should be) very similar to
the text-based console login, except that the input and output go to a serial
port rather than the Linux console driver.
Different types of terminal have different capabilities, as defined in
the /etc/termcap file. Capabilities typically involve things like character
sets, ability to move the cursor around at will (rather than just scrolling
upwards all the time), changing text/background colour, etc. The terminal
type connected to the serial port might be typically specified on the command
line to run getty. Console-based programs can then use the TERM environment
variable and look up the corresponding information in /etc/termcap to figure
out how to display their user interface. (In practice this part would often
be taken care of by the ncurses library or similar).
I suggest starting out with terminal type "dumb" or "vt100" unless you know
the correct setting for your terminal, then experimenting. Software
applications which emulate a terminal such as minicom or Hyperterminal (under
Windows) usually have settings for changing the emulated terminal type. Just
make sure both ends are configured the same and ideally the "best" (most
capable) type supported.
> Can anyone tell me what parameters I need to know
> (apart from the outgoing serial port on the server -
> ttyS1)
Depends on the getty program being used, typically the serial port, terminal
type at the other end and serial communication settings - speed, data format
(7 or 8 data bits) and parity.
> , what files I need to edit
Start off entering commands from the console prompt, then transfer
to /etc/inittab (and maybe /etc/ttytype, if required). If you need any extra
commands such as setserial, these could go in /etc/rc.d/rc.local once you've
got them worked out.
> and recommednations for a terminal emulator
> (minicom/telix/hyperterminal/seyon etc.
Hyperterminal is a bit slow and clunky, with limited terminal capabilities.
Minicom seems a bit more capable. Not used the others but any of them are
probably fine.
Hope this helps,
Regards,
James
More information about the Wolves
mailing list