This commit is contained in:
gferg 2001-06-09 12:37:14 +00:00
parent 055f3ffa7d
commit 9fb4505b79
3 changed files with 614 additions and 346 deletions

View File

@ -3,10 +3,11 @@
<title> Modem-HOWTO </title>
<author>David S.Lawyer
<tt><url url="mailto:dave@lafn.org"></tt>
<date> v0.17, April 2001
<date> v0.18, June 2001
<!--
Change log: + => added more info ++ => added new topic
v0.18 June 2001 new section: modem doubling (bonding, teaming, multilink)
v0.17 April 2001 isapnp to pnpdump (with "dumpregs" option)
v0.16 March 2001 New url for winmodem.html, more obsolete protocols
v0.15 March 2001 Revision of Dial-In section (incl. problems with
@ -102,7 +103,7 @@ provided that you:
<enum>
<item> If it's not a translation: Email a copy of your derivative work
(in a format LDP accepts) to the author(s) and maintainer (could be
the same person). If you don't get a response them email the LDP
the same person). If you don't get a response then email the LDP
(Linux Documentation Project): submit@linuxdoc.org.
<item>License the derivative work in the spirit of this license or use
GPL. Include a copyright notice and at least a pointer to the
@ -160,12 +161,15 @@ modem situation is rapidly changing (and since I'm still learning).
Your problem might be solved in the latest version. It will be
available to browse and/or download at LDP mirror sites. For a list
of such sites see: <url url="http://www.linuxdoc.org/mirrors.html">
If you only want to quickly compare the date of this the version v0.17, April 2001
If you only want to quickly compare the date of this the version v0.18, June 2001
with the date of the latest version go to:
<url url="http://www.linuxdoc.org/HOWTO/Modem-HOWTO.html">
<sect1> New in Recent Versions
<p> v0.16 March 2001 New url for winmodem.html, more obsolete protocols
<p>v0.18 June 2001 new section: modem doubling (bonding, teaming,
multilink)<newline>
v0.17 April 2001 isapnp to pnpdump (with "dumpregs" option)<newline>
v0.16 March 2001 New url for winmodem.html, more obsolete protocols<newline>
v0.15 March 2001 Revision of Dial-In section (incl. problems with
agetty, interoperability with MS, VNC), blacklist, AT-cmds on Internet,
broken links fixed
@ -1264,7 +1268,7 @@ id="modem_conf" name="Modem Configuration">
<sect1> Serial Driver Module
<p> The device driver for the serial port is the software that
operates the serial port. It is now provided as a serial module.
From kernel 2.2 on, this module will normally get loaded automatically
>From kernel 2.2 on, this module will normally get loaded automatically
if it's needed. In earlier kernels, you had to have <tt/kerneld/
running in order to do auto-load modules on demand. Otherwise the
serial module needed to be explicitly listed in /etc/modules. Before
@ -3515,8 +3519,8 @@ incorrectly calls it speed. For all modern modems you have no choice
of the speed that the modem uses on the telephone line since it will
automatically choose the highest possible speed that is feasible under
the circumstances. If one modem is slower than the other, then the
faster modem will operate at the slower ones speed. On a noisy line,
this speed will drop still lower.
faster modem will operate at the slower modem's speed. On a noisy
line, the speed will drop still lower.
While the above speeds are selected automatically by the modems you do
have a choice as to what speed will be used between your modem and
@ -3524,8 +3528,8 @@ your computer (PC-to-modem speed). This is sometimes called "DTE
speed" where "DTE" stands for Data Terminal Equipment (Your computer
is a DTE.) You need to set this speed high enough so this part of the
signal path will not be a bottleneck. The setting for the DTE speed
is the maximum speed of this link. Most of the time it should operate
at lower speeds.
is the maximum speed of this link. Most of the time it should
actually operate at lower speeds.
For an external modem, DTE speed is the speed (in bits/sec) of the
flow over the cable between you modem and PC. For an internal modem,
@ -3551,7 +3555,12 @@ times faster, etc.
<sect1> Where do I Set Speed ?
<p> This DTE (PC-to-modem) speed is normally set by a menu in your
communications program or by an option given to the getty command if
someone is dialing in. You can't set the DCE modem-to-modem speed.
someone is dialing in. You can't set the DCE modem-to-modem speed
since this is set automatically by the modem to the highest feasible
speed after negotiation with the other modem. Well, actually you can
set the modem-to-modem speed with the S37 register but you shouldn't
do it. If the two modems on a connection were to be set this way to
different speeds, then they couldn't communicate with each other.
<sect1> Can't Set a High Enough Speed
<!-- high_speed.H begin In Serial and Modem HOWTOs but some of the speed
@ -3653,7 +3662,7 @@ is:
<item> 14.4k (v.32bis): use 57600 bps
<item> 9.6k (v.32): use 38400 bps
<item> slower than a 9600 bps (v.32) modem: Set the speed to the
same speed as the modem.
same speed as the modem (unless you have data compression).
</itemize>
All the above speeds may use v.42bis data compression and v.42 error
@ -3733,6 +3742,8 @@ efficient.
<item> <tt/hylafax/ a large fax program based on the client-server
model.
<item><tt/mgetty+fax/ handles fax stuff and login for dial-ins
<item>A fax protocol tutorial
<url url="http://www.iec.org/tutorials/vfoip/topic08.html">
</itemize>
<sect2> Voicemail Software <label id="voice_sw">
@ -3812,6 +3823,48 @@ PC then if they use:
Third party dial-out programs include HyperTerminal Private Edition.
<sect> Two Modems (Modem Doubling)
<sect1> Introduction
<p> By using two modems at the same time, the flow of data can be
doubled. It takes two modems and two phone lines. There are two
methods of doing this. One is "modem bonding" where software at both
ends of the modem-to-modem connection enables the paired modems to
work like a single channel.
The second method is called "modem teaming. Only one end of the
connection uses software to make 2 different connections to the
internet. Then when a file is to be downloaded, one modem gets the
first half of the file while the second modems simultaneously gets the
last half of the same file. Is there any modem teaming support in
Linux ??
<sect1> Modem Bonding
<p> There are two ways to do this in Linux: EQL and multilink. These
are provided as part of the Linux kernel (provided they've been
selected when the kernel was compiled). For multilink the kernel
must be at least v.2.4. Both ends of the connection must run them.
Few (if any) ISPs provide EQL but many provide Multilink.
The way it works is something like multiplexing only it's the other
way around. Thus it's called inverse-multiplexing. For the multilink
case, suppose you're sending some packets. The first packet goes out on
modem1 while the second packet is going out on modem2. Then the third
packet follows the first packet on modem1. The forth packet goes on
modem2, etc. To keep each modem busy, it may be necessary to send out
more packets on one modem than the other. Since EQL is not packet
based, it doesn't split up the flow on packet boundaries.
<sect2> EQL
<p>EQL is "serial line load balancing" which has been available for
Linux since at least 1995. An old (1995) howto on it is in the kernel
documentation (in the networking subdirectory). Unfortunately, ISPs
don't seem to provide EQL.
<sect2> Multilink
<p> Staring with kernel 2.4 in 2000, experimental support is provided
for multilink. It must be selected when compiling the kernel and it
only works with PPP.
<sect>Troubleshooting <label id="trouble_shoot">
<sect1> My Modem is Physically There but Can't be Found <label
@ -4383,6 +4436,8 @@ may be found on the Internet.
<item>Modems For Dummies by Tina Rathbone, 1996. (Have never seen it.)
<item>The Modem Technical Guide by Douglas Anderson, 1996.
<item>Ultimate Modem Handbook by Cass R. Lewart, 1998.
<item> Black, Uyless D.: Physical Layer Interfaces & Protocols, IEEE
Computer Society Press, Los Alamitos, CA, 1996.
</itemize>
<sect1> HOWTOs
@ -4570,34 +4625,35 @@ the actual speed is lower (56k or less --usually significantly less).
Thus 64k is the absolute top speed possible for an ordinary
telephone call using the digital portion of the circuit that was
designed to send digital encodings of the human voice. In order to
use 64k, the modem must know exactly how the telephone company is
doing its digital encoding of the analog signals. This task is far
too complicated if both sides of a telephone call have only an analog
interface to the telephone company. But if one side has a digital
interface, then it's possible (at least in one direction). Thus if
your ISP has a digital interface to the phone company, the ISP may
send out a certain digital signal over the phone lines toward your PC.
The digital signal from the ISP gets converted to analog at the local
telephone office near your PC's location (perhaps near your home).
Then it's your modem's task to try to figure out exactly what that
digital signal was. If it could do this then transmission at 64k (the
speed of the telephone company's digital signal) is possible in this
direction.
use 64k, the modems need to either have direct access to the digital
portion of the circuit or be able to predict the exact digital signal
that generated a received analog signal (and conversely).
This task is far too error prone if both sides of a telephone call
have only an analog interface to the telephone company. But if one
side has a digital interface, then it's possible (at least in one
direction). Thus if your ISP has a digital interface to the phone
company, the ISP may send out a certain digital signal over the phone
lines toward your PC. The digital signal from the ISP gets converted
to analog at the local telephone office near your PC's location
(perhaps near your home). Then it's your modem's task to try to
figure out exactly what that digital signal was. If it could do this
then transmission at 64k (the speed of the telephone company's digital
signal) is possible in this direction.
What method does the telephone company use to digitally encode analog
signals? It uses a method of sampling the amplitude of the analog
signal at a rate of 8000 samples per second. Each sample amplitude is
encoded as a 8-bit (ASCII-like) byte. (Note: 8 x 8000 = 64k) This is
called "Pulse Code Modulation" = PCM. These bytes are then sent
digitally on the telephone company's digital circuits where many calls
share a single circuit using a time-sharing scheme known as "time
division multiplexing". Then finally at a local telephone office
near your home, the digital signal is de-multiplexed resulting in the
same digital signal as was originally created by PCM. Then this
signal is converted back to analog and sent to your home. Each 8-bit
byte creates a certain amplitude of the analog signal. Your modem's
task is to determine just what that PCM 8-bit byte was based on the
analog amplitude it detects.
encoded as a 8-bit byte. (Note: 8 x 8000 = 64k) This is called
"Pulse Code Modulation" = PCM. These bytes are then sent digitally on
the telephone company's digital circuits where many calls share a
single circuit using a time-sharing scheme known as "time division
multiplexing". Then finally at a local telephone office near your
home, the digital signal is de-multiplexed resulting in the same
digital signal as was originally created by PCM. Then this signal is
converted back to analog and sent to your home. Each 8-bit byte
creates a certain amplitude of the analog signal. Your modem's task
is to determine just what that PCM 8-bit byte was, based on the analog
amplitude it detects.
This is (sort of) "amplitude demodulation" but not really. It's not
amplitude demodulation because there is no carrier. Actually, it's
@ -4689,10 +4745,10 @@ circuits leaves a signal which mostly came from the other end of the
line.
<sect1> Echo Cancellation
<p> A signal traveling down a line in one direction may encounter
changes in the line that will cause part of the signal to echo back in
the opposite direction. Since the same circuit is used for
bi-directional flow of data such echos will result in garbled
<p> An analog signal traveling down a line in one direction may
encounter changes in the line that will cause part of the signal to
echo back in the opposite direction. Since the same circuit is used
for bi-directional flow of data such echos will result in garbled
reception. One way to ameliorate this problem is to send training
signals once in a while to determine the echo characteristic of the
line. This will enable one to predict the echos that will be
@ -4840,12 +4896,14 @@ next 3 sections: ISDN, DSL and 56k, concern digital-to-digital
"modems".
<sect1> ISDN "Modems"
<p> The "modem" is really a Terminal Adapter (TA). A Debian package
"isdnutils" is available. There is a ISDN Howto in German with an
English translation: <url
url="http://sdb.suse.de/sdb/en/html/isdn.html">. It's put out by
the SuSE distribution of Linux and likely is about drivers available
in that distribution. There is an isdn4linux package and a newsgroup:
<p> Such a "modem" is really a Terminal Adapter (TA). Support for
some of them can be built into the kernel 2.4 or added as a module.
The kernel documentation has an isdn section. Configuration might use
"isdn-config" GUI. A Debian package "isdnutils" is available. There
is a ISDN Howto in German with an English translation: <url
url="http://sdb.suse.de/sdb/en/html/isdn.html">. It's put out by the
SuSE distribution of Linux and likely is about drivers available in
that distribution. There is an isdn4linux package and a newsgroup:
de.alt.comm.isdn4linux. Many of the postings are in German. You
might try using a search engine (such as DejaNews) to find
"isdn4linux".
@ -4908,13 +4966,44 @@ With a compression ratio of 8:1 it takes about 50 seconds at 9600bps
for transmission.
<sect> Appendix G: Antique Modems
<p> This section is about modems with modem-to-modem speeds of 9600
bps or less. Around 1980 many modems only had a speed of 300 bps
(which was also 300 baud). This is only 0.3kbps. Modern modems are
over 100 times faster. Many old-slow modems are still in use so they
are not really "antique" quite yet. This section compares the antique
modems with the modern ones. You should read it if you are interested
in modem history or are intending to actually use an antique modem.
<sect1> Obsolete CCITT (ITU) and Bell Protocols
<p> This section compares the antique modems with the modern ones.
You should read it if you are interested in modem history or are
intending to actually use an antique modem.
<itemize>
<item> Bell 103 300 bps; frequency shift keying = FSK
<item> v.21 300 bps; frequency shift keying (used a different
frequency than Bell 103)
<item> v.23 1200/75 bps and 600/75 bps asymmetric; 75 bps is the reverse
channel; frequency shift keying = FSK
<item> Bell 212A 1200 bps; quadrature differential phase shift keying
= QDPSK = DPSK
<item> v.22 1200 bps; fallback to 600 bps ; QDPSK = DPSK
<item> v.22bis 2400 bps; QAM
<item> v.32 9600 bps; QAM (1988)
<item> v.32bis 14400 bps; QAM
</itemize>
QAM= Quadrature Amplitude Modulation. The word "Quadrature" is short
for "quadrature differential phase shift keying" =QDPSK
<sect1> Overview
<p> Before v.32 modems typically had speeds of 300 to 2400 bps. Some
super fast ones had much higher speeds (such as 19.2k bps) and used
non-standard protocols. To utilize these "fast" ones, both modems for
a connection usually needed to be of the same brand.
Prior to the v.42 standard for error correction and the v.42bis (1990)
standard for data compression, the MNP standards were usually used for
both error correction and data compression. An X.PC error correction
standard was used on some commercial data networks. Compression and
error correction were available on some 2400 bps modems.
Around 1980 many modems only had a speed of 300 bps (which was also
300 baud). This is only 0.3kbps. Modern modems are over 100 times
faster. Some old-slow modems are still in use so they are not really
"antique" quite yet.
<sect1> Autobauding <label id="autobaud_">
<sect2> Various meanings
@ -4928,9 +5017,9 @@ they first connect to each other. If one side can't negotiate, the
other side should accept whatever speed and protocol that the antique
modem has available. Sometimes this is called "autobauding". When
both modems automatically lower their speed due to a noisy line it's
called "fallback". Thus users (or computer programs in your PC) don't
need to deal with this (unless the S37 register has been set so as to
disable autobauding).
called "fallback". Thus users of modern modems (or computer programs
in your PC) don't need to deal with this (unless the S37 register has
been set so as to disable autobauding).
But many old modems didn't have such autobauding (although many had
fallback). If you have such a modem, it will likely work OK if the
@ -4962,9 +5051,12 @@ for dial-in when there was a choice of speeds (via autobauding), if a
connection was made at say 2400 bps, then the modem-to-serial_port
speed would change to 2400 bps. Then one would need to start getty
at 2400 bps. Thus getty needed to adjust to whatever speed was
coming from the modem. Today it's the other way around: the modem
adjusts its modem-to-serial_port speed to whatever the serial port is
using.
coming from the modem. Since the serial port doesn't have any way to
detect what speed is being sent to it, getty would set the serial port
to a different speed (as specified in a getty configuration file) if
it couldn't communicate at the current speed. Today it's the other
way around: the modem adjusts its modem-to-serial_port speed to
whatever speed the serial port is using.
In Linux, there's a problem if the speed is set to a speed not
supported by Linux's serial port (for example 7200 bps). You
@ -5010,22 +5102,5 @@ ASCII or 8-bit EBCDIC character sets.
compression. Modern modems generally use V42 (error correction) and
V42bis (compression). Many modems support both MNP and V42.
<sect1> Obsolete CCITT (ITU) and Bell Protocols
<p>
<itemize>
<item> Bell 103 300 bps; frequency shift keying = FSK
<item> v.21 300 bps; frequency shift keying (used a different
frequency than Bell 103)
<item> v.23 1200/75 bps and 600/75 bps asymmetric; 75 bps is the reverse
channel; frequency shift keying
<item> Bell 212A 1200 bps; quadrature differential phase shift keying
= QDPSK = DPSK
<item> v.22 1200 bps; fallback to 600 bps ; QDPSK = DPSK
<item> v.22bis 2400 bps; quadrature (QDPSK) amplitude modulation = QAM
<item> v.32 9600 bps; QAM
<item> v.32bis 14400 bps; QAM
</itemize>
END OF Modem-HOWTO
</article>

View File

@ -4,19 +4,20 @@
<author>David S.Lawyer
<tt><htmlurl url="mailto:dave@lafn.org" name="dave@lafn.org"></tt>
original by Greg Hankins
<date>v2.10, February 2001
<date> v2.11 May 2001
<!-- Change log:
v2.10 EIA-485, frame errors on networks, gkermit, firewire
v2.11 May 2001: stty 0 => hangup (was ok in v2.08. )
v2.10 Feb 2001: EIA-485, frame errors on networks, gkermit, firewire
v2.09 October 2000: link to Serial Driver homepage, ttySD etc.
v2.08 June 2000: /proc/tty, fixed link to Gary's Encyclopedia.
v2.07 May 2000: locking methods, clarity re uart protocol, sticky parity
v2.06 2 March 2000 more on multiport, not 3-3 for null modem,
v2.06 2 March 2000: more on multiport, not 3-3 for null modem,
butter -> buffer,
v2.05 Vern's & my url, ref to multiport modem cards
v2.04 duplicate info removed from setserial
v2.03 ttyS minor is 4, not 5
v2.02 Oct. 1999. National Instruments card, removed m4_define TorS, lockfile
v2.05 1 January 2000: Vern's & my url, ref to multiport modem cards
v2.04 28 Nov. 1999: duplicate info removed from setserial
v2.03 Nov. 1999: ttyS minor is 4, not 5
v2.02 Oct. 1999: National Instruments card, removed m4_define TorS, lockfile
error mesg
v2.01 Aug. 1999. more on HSSI, irq=0, serial module, clarity,
Computone update, New copyright, interrupts mis-set symptoms,
@ -73,9 +74,9 @@ provided that you:
<enum>
<item> If it's not a translation: Email a copy of your derivative work
to the LDP (Linux Documentation Project) for free distribution on the
Internet in a format LDP accepts. Also email such a copy to the
author(s) and maintainer (could be the same person).
(in a format LDP accepts) to the author(s) and maintainer (could be
the same person). If you don't get a response then email the LDP
(Linux Documentation Project): submit@linuxdoc.org.
<item>License the derivative work in the spirit of this license or use
GPL. Include a copyright notice and at least a pointer to the
license used.
@ -101,7 +102,7 @@ be a trademark). Such trademarks belong to their respective owners.
<sect2>Credits
<p> Most of the original Serial-HOWTO was written by Greg Hankins.
<url url="mailto:gregh@twoguys.org">
H e also rewrote many contributions by others in order to maintain
He also rewrote many contributions by others in order to maintain
continuity in the writing style and flow. He wrote: ``Thanks to
everyone who has contributed or commented, the list of people has
gotten too long to list (somewhere over one hundred). Special thanks
@ -115,8 +116,9 @@ browse and/or download at LDP mirror sites. For a list of mirror
sites see: <url url="http://metalab.unc.edu/LDP/mirrors.html">.
Various formats are available. If you only want to quickly check the
date of the latest version look at <url
url="http://metalab.unc.edu/LDP/HOWTO/Serial-HOWTO.html"> and compare
it to this version: v2.10 February 2001 . New in this version is:
url="http://www.linuxdoc.org/HOWTO/Serial-HOWTO.html"> and compare
it to this version: v2.11 May 2001 . New in recent versions:<newline>
v2.11 stty 0 => hangup (was ok in v2.08)<newline>
v2.10 EIA-485, frame errors on networks, gkermit, firewire
<sect1> Related HOWTO's re the Serial Port <label id="related_howtos">
@ -855,37 +857,45 @@ external devices (including automation for both industry and the
home). They can connect to computer servers for the purpose of
monitoring/controlling the server from a remote location. They were
once mainly used for connecting up many terminals and/or modems to
serial ports. They are still used this way but any modem used with it
has the same limitation of ordinary modems: It can't send at over
33.6k even if it is a 56k modem.
serial ports. They are still used this way but today most modems are
internal digital modems (often called something else) and they don't
usually use multiport serial cards.
Thus if someone dials in to you (reaches your multiport serial card
from a modem plugged into the card) they will not be able to go above
33.6k in either direction, even if they use a 56k modem. To go above
33.6k for dial-in requires that you have a digital connection to the
telephone line. The serial port can't be used for this case. Thus
serial multiport cards are now obsolete for use by ISPs or anyone that
needs to allow others to dial-in to them at 56k (over 33.6k). See
Modem-HOWTO: Modem Pools, Digital Modems.
Each multiport card has a number of external connecters (DB-25 or
RJ45) so that one may connect up a number of devices (modems,
terminals, etc.). Each such physical device would then be connected
to its own serial port. Since the space on the external-facing part
of the card is limited there is often not enough room for all the
serial port connectors. To solve this problem, the connectors may be
on the ends of cables which come out (externally) from the card
(octopus cable). Or they may be on an external box (possibly rack
mountable) which is connected by a cable to a multiport card.
Each multiport card has a number of external connecters (DB-25 or RJ45
) so that one may connect up a number of devices (modems, terminals,
etc.). Each such physical device would then be connected to its own
serial port. Since the space on the external-facing part of the card
is limited there is often not enough room for all the serial port
connectors. To solve this problem, the connectors may be on the ends
of cables which come out (externally) from the card (octopus cable).
Or they may be on an external box (possibly rack mountable) which is
connected by a cable to a multiport card.
<sect1> Modem Limitations
<p>For a modem to transmit at nearly 56k requires that it be a special
digital modem and have a digital connection to a digital phone line
(such as a T1 line). Modem banks that connect to multiport cards do
exist, and some have a card that can access multiplexed digital phone
lines. Thus one can use a multiport card with a few 56k digital
modems.
Dumb multiport cards are not too much different than ordinary serial
For both analog and digital modem there is one modem on each serial
port so there needs to be an external cable (modem bank to multiport)
for each modem. This can lead to a large number of cables. So it's
less clutter (and cheaper) to use internal modems without a multiport
card. It's somewhat analogous to the lower cost of an internal modem
for a desktop PC as compared to the higher cost (and more cabling) for
an external modem. See Modem-HOWTO: Modem Pools, Digital Modems.
<sect1> Dumb vs. Smart Cards
<p>Dumb multiport cards are not too much different than ordinary serial
ports. They are interrupt driven and the CPU of the computer does
most all the work servicing them. They usually have a system of
sharing a single interrupt for all the ports. This doesn't decrease
the load on the CPU since the single interrupt will be sent to the CPU
each time any of the ports needs servicing. Such devices usually
require special drivers that you must put into the kernel or activate
by putting a #define in the source code (or the like).
each time any one port needs servicing. Such devices usually require
special drivers that you must put into the kernel or activate by
putting a #define in the source code (or the like).
Smart boards may use ordinary UARTs but handle most interrupts from
the UARTs internally within the board. This frees the CPU from the
@ -896,21 +906,34 @@ bits for making data transfers to main memory (instead of transferring
only 8-bit bytes like dumb serial cards do). Not all "smart" boards
are equally efficient. Many boards today are Plug-and-Play.
For a smart board to work, a special driver for it must be used.
Sometimes this driver is built into the kernel source code or supplied
as a module. Even in such cases, you may need to do something to
activate it. This includes selecting it when you compile the kernel
(during the configuration phase just before you compile). A
pre-compiled kernel probably didn't put the smart board driver into
the kernel but it may come with a pre-compiled module for the board.
This module needs to be loaded but the kernel may automatically do
this for you if a program is trying to use a device on the smart board
<sect1> Getting/Enabling a Driver
<sect2> Introduction
<p>For a multiport board to work, a special driver for it must be used.
This driver may either be built into the kernel source code or
supplied as a module. Support for dumb boards is likely to the built
into the kernel while smart boards usually need a module.
<sect2> Driver is built into the kernel (mostly dumb boards)
<p>A pre-compiled kernel is not likely to have multiport support
built in (especially after kernel 2.4). So you probably need to compile
it yourself. In kernel 2.4 you should select "CONFIG_SERIAL_EXTENDED
when configuring the kernel (just before you compile). If you select
this there will be still more choices presented to you. Even after
you do this you may need to edit the resulting source code a
little (depending on the card).
<sect2> Modules (mostly for smart boards)
<p>A pre-compiled kernel may come with a pre-compiled module for the board
so that you don't need to recompile the kernel. This module must be
loaded in order to use it, but the kernel may automatically do this
for you if a program is trying to use a device on the smart board
(provided there exists a table showing which module to load for the
device). This table may be in /etc/modules.conf and/or be internal to
the kernel. Also certain parameters may need to be passed to the
driver (via lilo's append command or via /etc/modules.conf).
The board's manufacturer should have info on all this on their website.
<sect2> Getting info on multiport boards
<p> The board's manufacturer should have info on their website.
Unfortunately, info for old boards is sometimes not there but might be
found somewhere else on the Internet (including discussion groups).
You might also want to look at the kernel documentation in
@ -918,7 +941,7 @@ You might also want to look at the kernel documentation in
to compiling see: Configure.help and search for "serial", etc. There
are also kernel documentation files for certain boards including
computone, hayes-esp, moxa-smartio, riscom8, specialix, stallion, and
sx.
sx (specialix).
<sect1>Making multiport devices in the /dev directory <label id="make_multi">
<p>
@ -1800,9 +1823,9 @@ communication program should set it in both places.
If a program you use doesn't set flow control in the serial driver,
then you may do it yourself using the <tt/stty/ command. Since the
driver doesn't remember the setting after you stop Linux, you could
put the stty command in a file that runs at start-up or when you
login (such as /etc/profile for the bash shell). Heres what you would
add for hardware flow control for port ttyS2:
put the stty command in a file that runs at start-up or when you login
(such as /etc/profile for the bash shell). Here's what you would add
for hardware flow control for port ttyS2:
<tscreen><verb>
stty crtscts < /dev/ttyS2
@ -1816,18 +1839,40 @@ letters of the last sentence spell: <tt/crtscts/.
<sect> Serial Port Devices /dev/ttyS2, etc. <label id="ttySN_">
<!-- device_dir.H begin
in Modem and Serial HOWTOs
<sect> Serial Port Devices /dev/ttyS2, etc. -->
<p> For creating devices in the device directory see
<p> For creating devices in the device directory see:
<ref id="create_dev" name="Creating Devices In the /dev directory">
<sect1> Devfs (The new Device File System)
<p> This is a new type of device interface to Linix. It's optional
starting with kernel 2.4. It's more efficient than the conventional
interface and makes it easy to deal with a huge number of devices.
The device names have all changed as well. But there's an option to
continue using the old names. For a detailed description of it see:
<url url="http://www.atnf.csiro.au/~rgooch/linux/docs/devfs.html">
The name changes (if used) are: ttyS2 becomes tts/2 (Serial port),
tty3 becomes vc/3 (Virtual Console), ptyp1 becomes pty/m1 (PTY
master), ttyp2 becomes pty/s2 (PTY slave). "tts" looks like a
directory which contains devices "files": 0, 1, 2, etc. All of these
new names should still be in the /dev directory although optionally
one may put them elsewhere.
<sect1>Serial Port Device Names & Numbers <label id="dev_nos">
<p> Devices in Linux have major and minor numbers. Each serial port
may have 2 possible names in the /dev directory: ttyS and cua. Their
drivers behave slightly differently. The cua device is deprecated and
will not be used in the future.
See the Modem-HOWTO section: "The cua Device".
<p> Devices in Linux have major and minor numbers (unless you use the
new devfs). The serial port ttySx (x=0,1,2, etc.) has major number 4.
You may see this (and the minor numbers too) by typing: "ls -l ttyS*"
in the /dev directory.
There formerly was an alternate name for each serial port. For
example, ttyS2 would have cua2 as an alternate name. You may still
have the cua devices in your /dev directory but they are now
deprecated. Their drivers behave slightly different than for the ttyS
ones. Device Obsolete">."') See the Modem-HOWTO
section: "cua Device Obsolete">.
Dos/Windows use the COM name while the <tt/setserial/ program uses
tty00, tty01, etc. Don't confuse these with dev/tty0, dev/tty1, etc.
@ -1836,36 +1881,31 @@ ports. The table below is for the "standard" case (but yours could be
different).
<tscreen><verb>
IO
dos major minor major minor address
COM1 /dev/ttyS0 4, 64; /dev/cua0 5, 64 3F8
COM2 /dev/ttyS1 4, 65; /dev/cua1 5, 65 2F8
COM3 /dev/ttyS2 4, 66; /dev/cua2 5, 66 3E8
COM4 /dev/ttyS3 4, 67; /dev/cua3 5, 67 2E8
</verb></tscreen>
Note that all distributions should come with ttyS devices (and many
distributions have the obsolete cua device). You can verify this by
typing (don't feel bad if you don't find any obsolete cua devices):
<tscreen><verb>
linux% ls -l /dev/cua*
linux% ls -l /dev/ttyS*
IO devfs
dos major minor major minor address name
COM1 /dev/ttyS0 4, 64; /dev/cua0 5, 64 3F8 /dev/tts/0
COM2 /dev/ttyS1 4, 65; /dev/cua1 5, 65 2F8 /dev/tts/1
COM3 /dev/ttyS2 4, 66; /dev/cua2 5, 66 3E8 /dev/tts/2
COM4 /dev/ttyS3 4, 67; /dev/cua3 5, 67 2E8 /dev/tts/3
</verb></tscreen>
<sect1> Link ttySN to /dev/modem ?
<sect1> Universal Serial Bus Ports
<p> Although the USB is not covered in this HOWTO, the serial ports on
the USB are: /dev/ttyUSB0 /dev/ttyUSB1, etc.
<sect1> Link ttySN to /dev/modem
<p> On some installations, two extra devices will be created,
<tt>/dev/modem</tt> for your modem and <tt>/dev/mouse</tt> for your
mouse. Both of these are symbolic links to the appropriate
device in <tt>/dev</tt> which you specified during the
installation (unless you have a bus mouse, then <tt>/dev/mouse</tt>
will point to the bus mouse device).
<tt>/dev/modem</tt> for your modem and <tt>/dev/mouse</tt> for a
mouse. Both of these are symbolic links to the appropriate serial
device in <tt>/dev</tt> which you specified during the installation
Except if you have a bus mouse, then <tt>/dev/mouse</tt> will point to
the bus mouse device).
Formerly the use of <tt>/dev/modem</tt> was discouraged since lock
files might not realize that it was really say <tt>/dev/ttyS2</tt>.
The newer lock file system doesn't fall into this trap so it's now OK
to use such links.
There has been some discussion on the merits of <tt>/dev/mouse</tt>
and <tt>/dev/modem</tt>. The use of these links is discouraged. In
particular, if you are planning on using your modem for dialin you may
run into problems because the lock files may not work correctly if you
use <tt>/dev/modem</tt>. However, if you change or remove this
link, some applications might need reconfiguration.
<!-- device_dir.H end -->
@ -2032,15 +2072,15 @@ it can be made to probe the hardware and try to determine the UART
type and IRQ, but this has severe limitations. See <ref
id="probing_ss" name="Probing">. Note that it can't set the IRQ or
the port address in the hardware of PnP serial ports (but the
plug-and-play features of the serial driver can do this).
plug-and-play features of the serial driver may do this).
If you only have one or two built-in serial ports, they will usually
get set up correctly without using setserial. Otherwise (or if there
are problems with the serial port) you will likely need to deal with
setserial. Besides the man page for <tt/setserial/, check out info in
<tt>/usr/doc/setserial.../</tt> or <tt>/usr/share/doc/setserial</tt>.
It should tell you how setserial is handled in your distribution of
Linux.
get set up correctly without using setserial. Otherwise, if you add
more serial ports (such as a modem card) you will likely need to deal
with setserial. Besides the man page for <tt/setserial/, check out
info in <tt>/usr/doc/setserial.../</tt> or
<tt>/usr/share/doc/setserial</tt>. It should tell you how setserial
is handled in your distribution of Linux.
<tt/Setserial/ is often run automatically at boot-time by a start-up
shell-script for the purpose of assigning IRQs, etc. to the driver.
@ -2059,7 +2099,7 @@ Setserial can set the time that the port will keep operating after
it's closed (in order to output any characters still in its buffer in
main RAM). This is needed at slow baud rates of 1200 or lower. It's
also needed at higher speeds if there are a lot of "flow control"
waits. See "closing_wait" in the man pg.
waits. See "closing_wait" in the man page.
Setserial does not set either IRQ's nor I/O addresses in the serial
@ -2353,7 +2393,8 @@ setserial" and search for say: "IRQ 11".
<sect1> Stty <label id="stty_">
<!-- stty.H begin <sect1> Stty <label id="stty_"> -->
<!-- stty.H begin <sect1> Stty <label id="stty_">
In Serial and Text-Terminal -->
<sect2> Introduction
<p> <tt/stty/ does much of the configuration of the serial port but
since application programs (and the getty program) often handle it,
@ -2364,7 +2405,7 @@ the -a (all) for a short listing which shows how it's set different
than normal. Don't try to learn all the setting unless you want to
become a serial guru. Most of the defaults should work OK and some of
the settings are needed only for certain obsolete dumb terminals made
in the 1970's.
in the 1970's.
<tt/stty/ is documented in the man pages with a more detailed account
in the info pages. Type <tt>"man stty"</tt> or <tt>"info stty"</tt>.
@ -2673,35 +2714,46 @@ is to:
<p>
A lock-file is simply a file created to mean that a particular device is
in use. They are kept in <tt>/var/lock</tt>. Formerly they were in
<tt>/usr/spool/uucp</tt>. Linux lock-files are sometimes named
<tt/LCK../<EM/name/, where <EM/name/ is either a device name, or a
UUCP site name. Most processes (an exception is getty) create these
locks so that they can have exclusive access to devices. For instance
if you dial out on your modem, a lock-file (or even more that one
lockfile) will appear telling other processes that someone else is
using the modem. Lock files contain the PID of the process that has
locked the device. Note that if a process insists on using a device
that is locked, it may ignore the lockfile and use the device anyway.
This is useful in sending a message to a text-terminal, etc.
<tt>/usr/spool/uucp</tt>. Linux lock-files are usually named
<tt/LCK../<EM/name/, where <EM/name/ may be a device name, a process
id number, a device's major and minor numbers, or a UUCP site name.
Most processes (an exception is getty) create these locks so that they
can have exclusive access to devices. For instance if you dial out on
your modem, some lockfiles will appear to tell other processes that
someone else is using the modem. In older versions (in the 1990s)
there was usually only one lockfile per process. Lock files contain
the PID of the process that has locked the device. Note that if a
process insists on using a device that is locked, it may ignore the
lockfile and use the device anyway. This is useful in sending a
message to a text-terminal, etc.
When a program wants to use a serial port but finds it locked with a
lock-file it should check to see if the lock-file's PID is still in
When a program wants to use a serial port but finds it locked with
lock-files it should check to see if the lock-file's PID is still in
use. If it's not it means that the lock is stale and it's OK to go
ahead and use the port anyway (after removing the stale lock-file).
ahead and use the port anyway (after removing the stale lock-files).
Unfortunately, there may be some programs that don't do this and give
up by telling you that a device is already in use when it really isn't.
Problems can arise with lockfiles if the same device has two different
names, resulting in lockfiles with different names that actually are
the same device. Formerly each physical serial port was known by
two different device names: ttyS0 and cua0. The lock checking
software is aware of ttyS vs. cua but it's simpler now since cua has
been eliminated. Older versions may still use cua. Using alternate
names (such as /dev/modem for /dev/ttyS2) is asking for trouble.
When there were only lockfiles with device names, the following
problem could arise: If the same device has two different
names then two different processes could each use a differnet name for
the same device. This results in lockfiles with different names that
actually are the same device. Formerly each physical serial port was
known by two different device names: ttyS0 and cua0. To solve this
lockfile alias problem, 3 methods have been used. It may be overkill
since any one of these methods would have fixed the problem.
For dumb terminals, lockfiles are not used since this would not permit
someone else to send a message to your terminal using the write or
talk program.
<enum>
<item> The lock checking software was made aware of ttyS vs. cua.
<item> The device cua was deprecated
<item> Additional locks were created which use unique device numbers
instead of names.
</enum>
Using alternate names such as /dev/modem for /dev/ttyS2 may cause
problems with older versions. For dumb terminals, lockfiles are not
used since this would not permit someone else to send a message to
your terminal using the write or talk program.
<sect1> Change Owners, Groups, and/or Permissions of Device Files
<p> In order to use a device, you (or the program you run if you have
@ -2806,7 +2858,8 @@ LDP. Get it from <url url="scicom.alphacdc.com/pub/linux">)
<sect1> Serial Console (console on the serial port)
<p> See the kernel documentation in: Documentation/serial-console.txt.
See also "Serial Console" in Text-Terminal-HOWTO.
Kernel 2.4+ has better documentation. See also "Serial Console" in
Text-Terminal-HOWTO.
<sect1> Line Drivers
<p> For a text terminal, the EIA-232 speeds are fast enough but the
@ -3155,6 +3208,13 @@ increase its size. See
<sect1> Port get characters only sporadically
<p> There could be some other program running on the port. Use "top"
(provided you've set it to display the port number) or "ps -alxw".
Look at the results to see if the port is being used by another
program. Be on the lookout for the gpm mouse program which often runs
on a serial port.
<sect1> Troubleshooting Tools
<p> These are some of the programs you might want to use in
troubleshooting:
@ -3485,6 +3545,23 @@ anyway. This results in fetching all of the characters in the FIFO
buffer, even if only a few (or only one) are present. There is also
"timeout" for the transmit buffer as well.
<sect1> Why FIFO Buffers are Small
<p>You may wonder why the FIFO buffers are not larger. After all,
memory is cheap and it wouldn't cost much more to use buffers in the
kilo-byte range. The reason is flow control. Flow control stops the
flow of data (bytes) on serial line when necessary. If a stop signal
is sent to serial port, then the stop request is handled by software
(even if the flow control is "hardware"). The serial port hardware
knows nothing about flow control.
If the serial port buffer contains 64 bytes ready to send when it
receives a flow control signal to stop sending, it will send out the
64 bytes anyway in violation of the stop request. There is no
stopping it since it doesn't know about flow control. If the buffer
was large, then many more bytes would be sent in violation of flow
control's request to stop.
<sect1> UART Model Numbers
<p> Here's a list of UARTs. <em/TL/ is <em/T/rigger <em/L/evel
<itemize>
@ -3520,7 +3597,7 @@ newer ones in pre 1990 hardware see the Appendix: Obsolete ...
<sect> Pinout and Signals <label id="pinout_">
<sect1> Pinout
<p>
<verb>
<tscreen><verb>
PINOUT of the SERIAL PORT (--> direction is out of PC)
(Note DCD is sometimes labeled CD)
Pin # Pin # Acronym Full-Name Direction What-it-May-Do/Mean
@ -3533,8 +3610,8 @@ Pin # Pin # Acronym Full-Name Direction What-it-May-Do/Mean
4 20 DTR Data Terminal Ready--> I'm ready to communicate
1 8 DCD Data Carrier Detect<-- Modem connected to another
9 22 RI Ring Indicator <-- Telephone line ringing
5 7 Signal Ground
</verb>
5 7 SG Signal Ground
</verb></tscreen>
<sect1> Signals May Have No Fixed Meaning
<p> Only 3 of the 9 pins have a fixed assignment: transmit, receive
@ -3546,7 +3623,7 @@ two states: asserted (+12 volts) or negated (-12 volts). Asserted is
that DTR be negated and the hardware only carries out this command and
puts -12 volts on the DTR pin. A modem (or other device) that
receives this DTR signal may do various things. If a modem has been
configured a certain way it will hang-up the telephone line when DTR
configured a certain way it will hang up the telephone line when DTR
is negated. In other cases it may ignore this signal or do something
else when DTR is negated (turned off).
@ -3561,14 +3638,15 @@ modify the source code to make these signal lines behave differently
<sect1> Cabling Between Serial Ports <label id="cabling_">
<p> A cable from a serial port always connects to another serial port.
A modem or other device that connects to the serial port has a serial
port built into it. For modems, the cable is always straight thru:
pin 2 goes to pin 2, etc. The modem is said to be DCE (Data
An external modem or other device that connects to the serial port has
a serial port built into it. For modems, the cable is always straight
thru: pin 2 goes to pin 2, etc. The modem is said to be DCE (Data
Communications Equipment) and the computer is said to be DTE (Data
Terminal Equipment). Thus for connecting DTE-to-DCE you use
straight-thru cable. For connecting DTE-to-DTE you must use a
null-modem cable and there are many ways to wire such cable (see
examples in Text-Terminal-HOWTO subsection: "Direct Cable Connection")
null-modem cable (also called a crossover cable). There are many ways
to wire such cable (see examples in Text-Terminal-HOWTO subsection:
"Direct Cable Connection")
There are good reasons why it works this way. One reason is that the
signals are unidirectional. If pin 2 sends a signal out of it (but is
@ -3582,8 +3660,11 @@ type (which receives the signal). That's the way it's done when you
connect a PC (DTE) to a modem (DCE). There's a second way to do this
without having two different types of equipment: Connect pin sending
pin 2 to a receiving pin 3 on same type of equipment. That's the way
it's done when you connect 2 PC's together or a PC to a terminal
(DTE-to-DTE). The cable used for this is called a null-modem cable.
it's done when you connect 2 PCs together or a PC to a terminal
(DTE-to-DTE). The cable used for this is called a null-modem cable
since it connects two PCs without use of a modem. A null-modem cable
may also be called a cross-over cable since the wires between pins 2
and 3 cross over each other (if you draw them on a sheet of paper).
The above example is for a 25 pin connector but for a 9-pin connector
the pin numbers are just the opposite.
@ -3592,19 +3673,19 @@ dumb terminal to a modem. The terminal was DTE (Data Terminal
Equipment) and the modem was DCE (Data Communication Equipment).
Today the PC is usually used as DTE instead of a terminal (but real
terminals may still be used this way). The names of the pins are the
same on both DTE and DCE. The words: "receive" and "transmit" are in
this case from the point of view of the PC (DTE). The transmit pin
from the PC transmits to the "transmit" pin of the modem (but actually
the modem is receiving the data from this pin so from the point of view
of the modem it would be a receive pin).
same on both DTE and DCE. The words: "receive" and "transmit" are
from the "point of view" of the PC (DTE). The transmit pin from the
PC transmits to the "transmit" pin of the modem (but actually the
modem is receiving the data from this pin so from the point of view of
the modem it would be a receive pin).
The serial port was originally intended to be used for connecting DTE
to DCE which makes cabling simple: just use a straight-thru cable.
Thus when one connects a modem one seldom needs to worry about which
pin is which. But people wanted to connect DTE to DTE (for example a
computer to a terminal) and various ways were found to do this by
fabricating various type of special cables. In this case what pin
connects to what pin becomes more important.
fabricating various types of special null-modem cables. In this case
what pin connects to what pin becomes significant.
<sect1> RTS/CTS and DTR/DSR Flow Control <label id="rts_cts">
<p> This is "hardware" flow control. Flow control was previously
@ -3670,9 +3751,9 @@ serial driver.
The normal use of DTR and DSR (not for flow control) is as follows: A
device asserting DTR says that its powered on and ready to operate.
For a modem, the meaning of a DTR signal from the PC depends on how
the modem is configured. Sending a DTR signal manually from a PC
using the stty command sets the baud rate to 0. Negating DTR is
sometimes called "hanging up" but it doesn't always do this.
the modem is configured. Negating DTR is sometimes called "hanging
up" but it doesn't always do this. One way to "hang up" (negate DTR)
is to set the baud rate to 0 using the command "stty 0".
<sect1> Preventing a Port From Opening
<p> If "stty -clocal" (or getty is used with the "local" flag negated)
@ -4093,4 +4174,3 @@ the Internet (few retail stores stock them today) or find a used one.
<p> END OF Serial-HOWTO
</article>

View File

@ -2,10 +2,12 @@
<article>
<title> Text-Terminal-HOWTO
<author> David S. Lawyer <url url="mailto:dave@lafn.org">
<date> v1.21, April 2001
<date> v1.22, May 2001
<!--
Change log:
v1.22 Clarity: 8-bit, ASCII, national replacement characters,
CP1252=MS-ANSI
v1.21 More on mgetty, getty-login sequence, agetty parity
problem, types of "terminal servers", parity set shows upper 128
chars., Correction: PCTerm doesn't work with MS DOS, troubleshooting:
@ -101,7 +103,7 @@ provided that you:
<enum>
<item> If it's not a translation: Email a copy of your derivative work
(in a format LDP accepts) to the author(s) and maintainer (could be
the same person). If you don't get a response them email the LDP
the same person). If you don't get a response then email the LDP
(Linux Documentation Project): submit@linuxdoc.org.
<item>License the derivative work in the spirit of this license or use
GPL. Include a copyright notice and at least a pointer to the
@ -163,8 +165,10 @@ url="http://linuxdoc.org/mirrors.html">. Various formats are
available. If you only want to quickly check the date of the latest
version look at <url
url="http://linuxdoc.org/HOWTO/Text-Terminal-HOWTO.html">. The
version your are currently reading is: v1.21, April 2001 . New in this
version:<newline>
version your are currently reading is: v1.22, May 2001 . New in recent
versions:<newline>
v1.22 Clarity: 8-bit, ASCII, national replacement characters,
CP1252=MS-ANSI<newline>
v1.21 More on mgetty, getty-login sequence, agetty parity
problem, types of "terminal servers", parity set shows upper 128
chars., Correction: PCTerm doesn't work with MS DOS, troubleshooting:
@ -1158,36 +1162,42 @@ You should examine such a table if you're not familiar with them.
They are sometimes included in printer and terminal manuals but also
are found on the Internet.
ASCII is one of the most common character-sets used on text terminals.
It is a 7-bit code but will usually work OK even if your terminal is set
to 8-bit mode. In 8-bit mode with ASCII, the high order bit is always
set to zero. Other character-sets are usually available and often use
8-bit codes (except on very old terminals where the only choice is
ASCII). The first half of most character-sets are the conventional
128 ASCII characters and the second half (with the high-order bit set
to 1) belong to a wide variety of character-sets. Character sets are
often ISO standards. To get specialized character sets on a terminal,
you may need to download a soft-font for that character-set into the
memory of the terminal. Many terminals have a few built-in character
sets (but perhaps not the one you need).
Many character sets include letters from foreign languages. But they
may also include special characters used to draw boxes and other
special characters.
ASCII was the traditional English character set used on text terminals
It is a 7-bit code but will usually work OK even if your terminal is
set to 8-bit mode. In 8-bit mode with ASCII, the high order bit is
always set to zero. Other character-sets are usually available and
usually use 8-bit codes (except on very old terminals where the only
choice is ASCII). The first half of most character-sets are the
conventional 128 ASCII characters and the second half (with the
high-order bit set to 1) belong to a wide variety of character-sets.
Character sets are often ISO standards. To get specialized character
sets on a terminal, you may need to download a soft-font for that
character-set into the memory of the terminal. Many terminals have a
number of built-in character sets (but perhaps not the one you need).
Here are some common 8-bit character sets. CP stands for Code Page
character sets invented by IBM: CP-437 (DOS ECS), ISO-8859-1
(Latin-1), CP-850 (Multilingual Latin 1 --not the same as ISO
Latin-1), ANSI (derived from Latin-1). MS Windows uses ANSI while the
Internet often uses Latin-1. There are several ISO-8859- character
sets in addition to Latin-1. These include Greek (-7), Arabic (-6),
Eastern European (-2), and a replacement for Latin-1 (-15) called
Latin-9. There are many others. For example, KOI8-R is more commonly
used for Russian than IS0-8859-5. Unicode is a very large
character-set where each character is represented by 2 bytes instead
on just one byte.
Latin-1), CP-1252 (WinLatin1 = MS-ANSI). MS Windows uses CP-1252
(WinLatin1) while the Internet often uses Latin-1. There are several
ISO-8859- character sets in addition to Latin-1. These include Greek
(-7), Arabic (-6), Eastern European (-2), and a replacement for
Latin-1 (-15) called Latin-9. There are many others. For example,
KOI8-R is more commonly used for Russian than IS0-8859-5. Unicode is
a very large character-set where each character is represented by 2
bytes instead on just one byte.
More info re character-sets are:
<itemize>
<item> Manual pages: ASCII and latin1
<item> HOWTO's for various languages (likely written in that language).
<item> Manual pages: iso_8859-l or latin1 (covers 8859 series), ascii
<item> HOWTO's for various languages (often written in that language).
See "Cyrillic" for Russian.
<item> <url url="http://czyborra.com/charsets/iso8859.html"
name="ISO-8859 Alphabet Soup"> More than just iso8859. Extensive.
<item> <url url="http://www.hut.fi/~jkorpela/chars.html" name="A
tutorial on character code issues"> Clearly written.
<item> <url url="http://www.w3.org/International/O-charset-lang.html"
@ -1197,12 +1207,96 @@ tutorial on character code issues"> Clearly written.
<item> <url url="http://linux.monnet.ru/books/locale/locale_i.html"
name="Links re Internationalization"> A long list of links (in Russian
but most words in English).
<item> <url url="ftp://kermit.columbia.edu/kermit/e/isok7.txt"
name="... International Character Sets">
</itemize>
Once you've found the character set name (or alpha-numeric
designation) you are interested in, you may search for more info about
it on the Internet.
<sect2> Graphics (Line Drawing, etc.)
<p> There are special characters for drawing boxes, etc. There are
also numerous non-ASCII symbols such as bullets. These may either be
part of an 8-bit character set (such as WinLatin1 = CP-1252) or
provided as a separate font (in vt100 terminals). Your terminfo may
be set up to use them. But if you see a row of letters when there
should be a line, it may mean that terminfo hasn't implemented them.
You need to know the following if your graphics don't work right.
The default graphic character set is the vt-100 ANSI graphics.
Otherwise the string acsc must be defined in your terminfo. It
establishes a map between the vt-100 graphic characters codes and the
actual codes used on your terminal. So even if your terminal doesn't
have the vt-100 graphics, it can likely still generate such graphics
with some other character set. If terminfo has it right, this will
happen automatically.
If character sets must be switched then the terminfo variables: enacs,
rmacs, and smacs should be defined. Note acs = Alternate Character
Set. Even if the upper half of the normal character set contains the
graphic characters it may be considered a separate 7-bit character set
that needs to be switched to.
<sect2> National Replacement Characters (obsolete)
<p> These result in modified 7-bit ASCII codes. Many West-European
languages only need several additional letters which are not in ASCII.
To get them in 7-bit code, one may borrow the codes for seldom used
ASCII symbols:<newline> @ [ \ ] ^ ` { \ } &tilde<newline>
The symbols $ and # are sometimes used also. So when using these
replacement character sets, you are deprived of using certain ASCII
symbols since they now are used for the new non-ASCII letters. Now
that 8-bit character codes have mostly replaced 7-bit ones, it's
better to use an 8-bit code which has both all the ASCII symbols plus
the non-ASCII characters for various languages.
ISO-646 (for 1972 and later) permits this. It specifies that the
above mentioned character codes may be borrowed, but doesn't specify
which national characters are to replace them. Some countries
standardized the replacements by registering them with ECMA.
Many terminals exist which support these national replacement
characters but you probably don't want to implement them unless you
have some old files to read. Very old terminals may only support one
language (for the country in which they were sold). Later terminals
offered a choice of languages. Modem terminals are 8-bit and don't
need "national replacements". Replacement characters exist for the
following languages/countries: British, Cuba (Spanish), Dutch,
Finnish, French, French Canadian, German, Hebrew, Hungarian, Italian,
Norwegian/Danish, Portuguese, Spanish, Swedish, Swiss (German).
Here's tables for some character sets taken from Kermit and Unisys
documents:
<tscreen><verb>
Swedish Danish
ASCII German Finnish Norwegian French
@ at-sign section ------- ------- a-grave
[ left-bracket A-diaeresis A-diaeresis AE-digraph degree
/ backslash O-diaeresis O-diaeresis O-slash c-cedilla
] right-bracket U-diaeresis A-circle A-circle section
^ circumflex ------ U-diaeresis ------- -------
` accent-grave ------ e-acute ------- -------
{ left-brace a-diaeresis a-diaeresis ae-digraph e-acute
| vertical-bar o-diaeresis o-diaeresis o-circle u-grave
} right-brace u-diaeresis a-circle a-circle e-grave
~ tilde ess-zet u-diaeresis -------- diaeresis
ASCII Italian Spanish
@ at-sign section section
[ left-bracket degree inverted-exclamation
/ backslash #-pound N-tilde
] right-bracket e-acute inverted-question-mark
^ circumflex ------- -------
` accent-grave u-grave -------
{ left-brace a-grave degree
| vertical-bar o-grave n-tilde
} right-brace e-grave --------
~ tilde i-grave --------
</verb></tscreen>
<sect1> Fonts
<p> Most terminals made after the mid 1980's can accept downloaded
@ -1283,15 +1377,16 @@ terminal. To do this you select the emulation you want (called
section is about the first type of emulation: emulating a terminal on
a PC.
Emulation software is available for MS Windows and comes built-in
with recent versions of MS Windows. Most Linux free software can only
emulate a VT100, VT102, or VT100/ANSI. If you find out about any
others, let me know. Since most PC's have color monitors but VT100
and VT102 were designed for a monochrome monitor, the emulation
usually adds color capabilities (and a choice of colors). Sometimes
the emulation is not 100% perfect but this usually causes few
problems. For using a Mac computer to emulate a terminal see the
mini-howto: Mac-Terminal.
Much emulation software is available for use under the MS Windows OS.
See <ref id="non_linux_pc" name="Make a non-Linux PC a terminal"> This
can be used to connect a Windows PC to a Linux PC (as a
Text-Terminal). Most Linux free software can only emulate a VT100,
VT102, or VT100/ANSI. If you find out about any others, let me know.
Since most PC's have color monitors while VT100 and VT102 were
designed for a monochrome monitor, the emulation usually adds color
capabilities (including a choice of colors). Sometimes the emulation
is not 100% perfect but this usually causes few problems. For using a
Mac computer to emulate a terminal see the mini-howto: Mac-Terminal.
<sect1> Don't Use TERM For Emulation <label id="term_not_for_emulation">
<p> Some have erroneously thought that they could create an emulator
@ -1299,9 +1394,9 @@ at a Linux console (monitor) by setting the environment variable TERM
to the type of terminal they would like to emulate. This does not
work. The value of TERM only tells an application program what
terminal you are using. This way it doesn't need to interactively ask
you this question. If you're at the PC monitor it's a terminal of
type "Linux" and your can't change this. So you must set TERM to
"Linux".
you this question. If you're at a Linux PC monitor (command line
interface) it's a terminal of type "Linux" and your can't change this.
So you must set TERM to "Linux".
If you set it to something else you are fibbing to application
programs. As a result they will incorrectly interpret certain escape
@ -1321,7 +1416,7 @@ example) dial up public libraries to use their catalogs and indexes,
modems. Seyon is only for use with X-windows and can emulate
Tektronix 4014 terminals.
The communication program kermit doesn't do terminal emulation as it
The communication program Kermit doesn't do terminal emulation as it
is merely a semi-transparent pipe between whatever terminal you are on
and the remote site you are connected to. Thus if you use kermit on a
Linux PC the terminal type will be "Linux". If you have a Wyse60
@ -1372,7 +1467,7 @@ it to emulate anything else. Setting the TERM environment variable to
type of terminal other than "Linux" will not result in emulating that
other terminal. It will only result in a corrupted interface since
you have falsely declared (via the TERM variable) that your "terminal"
is of a type different from what it is. See <ref
is of a type different from what it actually is. See <ref
id="term_not_for_emulation" name="Don't Use TERM For Emulation">
In some cases, the console for a Linux PC is a text-terminal. One may
@ -1403,10 +1498,12 @@ settings for use only when the console is in single user mode (but you
are normally in multiuser-user mode). This is explained (a little) in the
init man page.
Many commands exist (see Keyboard-and-Console-HOWTO) to utilize the
added features provided by the console-monitor driver. Real
terminals, which use neither scan codes nor VGA cards, unfortunately
can't use these features.
Many commands exist to utilize the added features provided by the
console-monitor driver. Real terminals, which use neither scan codes
nor VGA cards, unfortunately can't use these features. To find out
more about the console see the Keyboard-and-Console-HOWTO. Also see
the various man pages about the console (type "man -k console").
Unfortunately, much of this documentation is outdated.
<sect1> Emulation Software
<p> Emulators often don't work quite right so before purchasing
@ -1433,7 +1530,7 @@ url="http://www.ecc400.com/censoft/termunix.html"> can emulate Wyse60,
ADM-1l; WANG 2110. Block mode is available for IBM and Wyse. It runs
on a Linux PC.
<sect2> Make a non-Linux PC a terminal
<sect2> Make a non-Linux PC a terminal <label id="non_linux_pc">
<p> Emulators exist which run on non-Linux PCs. They permit you to
use a non-Linux-PC as a terminal connected to a Linux-PC. Under DOS
@ -1441,9 +1538,11 @@ there is <tt/telix/ and <tt/procomm/. Windows comes with
"HyperTerminal" (formerly simply called "Terminal" in Windows 3.x and
DOS). Competing with this is "HyperTerminal Private Edition" <url
url="http://www.hilgraeve.com/htpe/index.html"> which is non-free to
business. It can emulate vt-220. Turbosoft's (Australia) TTWin <url
url="http://www.turbosoft.com.au/"> can emulate over 80 different
terminals under Windows.
business. It can emulate vt-220. Turbosoft's TTWin can emulate over
80 different terminals under Windows. See <url
url="http://www.ttwin.com/home.html"> or <url
url="http://www.turbosoft.com.au/"> (Australia).
See also <url url="http://www.wrq.com/" name="Reflection">
For the Mac Computer there is emulation by Carnation Software <url
url="http://www.carnationsoftware.com/carnation/HT.Carn.Home.html">
@ -2123,7 +2222,7 @@ compatible with telephone connectors. See also <ref
id="rj_conn_install" name="Installing RJ Connectors">. They may be 6,
8, or 10 conductor.
<sect3> 6-conductors (including MMJ look-alikes)
<sect3> 6-conductors: RJ11/14 and MMJ
<p> RJ11/14 is a 4-6 conductor telephone plug. A look-alike is a MMJ
connector (6-conductor) used on later model VT (and other) terminals.
It's sometimes referred to as a DEC-423. MMJ has an offset tab and is
@ -2265,9 +2364,9 @@ the easiest since it almost completely envelops the wire.
With the tip properly inserted pull on both the tool and the wire
with a gentle pull. If it doesn't come out, the tool was likely not
inserted correctly so either push it in more or twist it to a
different position (or both). Perhaps you should have used the other
tip that goes more around the pin. Using this tool, one may readily
convert a straight-thru cable to a null-modem cable, etc.
different position (or both). Perhaps you should have used another
tip that fits tighter around the pin. Using this tool, one may
readily convert a straight-thru cable to a null-modem cable, etc.
There can be problems using the "insertion/extraction" tool. If the
tools will not insert on the back of the pin, it could be that the pin
@ -2891,16 +2990,22 @@ Mapping: mapchan">
<p> Wyse terminals have a key near the lower left corner which may be
set to do various things. Its may be labelled "Funct", "Compose
Character", "Alt", "Hold" or "Scroll Lock". Early models don't have
all of the following options: When set to {Hold} No-Scroll it stops
the flow of data (using flow control) to the terminal. Hitting the
key again restores normal flow. When set to {Compose} it permits one
all of the following options:
<itemize>
<item>Hold: No-Scroll. Hitting it stops the flow of data (using flow
control) to the terminal. Hitting the key again restores normal flow.
<item>Compose: Hitting it followed by certain other keys permits one
to generate a limited number of pre-defined non-Latin characters.
When set to Meta, it makes it a meta shift key which sets the
high-order bit on each byte. When set to {Funct} (and pressed) any
alphanumeric key pressed gets a header (SOH) and trailer (CR) byte
framing the ASCII byte code. When set to {Kpd Compose} (and pressed)
then typing a decimal number on the numeric keys (followed by "enter")
sends out the same number in hexadecimal ??
<item>Meta: Holding it down while typing another key sets the
high-order bit on each byte. Are there models where it acts like a
toggle to lock in the meta effect ??
<item>Funct: Holding it down while typing any alphanumeric key
gets a header (SOH) and trailer (CR) byte framing the ASCII byte code.
<item>Kpd Compose: Holding it down while typing a decimal number
on the numeric keys (followed by "enter") sends out the same number in
hexadecimal ??
</itemize>
<sect2> Numeric Keypad or Arrow Keys Sends
<p> The numeric keypad (the rectangle of mostly numeric keys to the
@ -2908,14 +3013,14 @@ right of the main part of the keyboard) can be set to send special
codes which will do special things in certain application programs.
Ditto for the arrow keys. There is thus a "normal" mode where they
send what is shown on the keycap (or the normal code sequence for an
arrow-key) and an "application" mode where a special escape sequence
is sent. In some cases there is a "hex" numeric mode which is almost
arrow-key) and an "application" mode where special escape sequences
are sent. In some cases there is a "hex" numeric mode which is almost
like normal numeric mode except that 6 non-numeric keys send the
letters A-F. Thus one may type for example "B36F" on the numeric
keypad.
<sect2> What does shifted-del and shifted-bs send?
<p> Depending on how they're set up shifted-del sometimes sends the
<p> Depending on how they're set up, shifted-del sometimes sends the
control character CAN and shifted backspace sometimes sends DEL.
<sect2> PC Scan Codes
@ -3255,16 +3360,16 @@ terminal and this getty will set the environment variable TERM to this
value. There are no configuration files. Type "init q" on the
command line after editing getty and you should see a login prompt.
<sect3> Agetty's auto-detection of parity
<sect3> Agetty's auto-detection of parity problems
<p> The <tt/agetty/ program will attempt to auto-detect the parity set
inside the terminal (including no parity). It doesn't support 8-bit
data bytes plus 1-bit parity. See <ref id="parity_8-bit"
name="Agetty's parity with 8-bit data bytes">. If you use <tt/stty/
to set parity, <tt/agetty/ will automatically unset it since it
initially wants the parity bit to come thru as if it was a data bit.
This is because it needs to get the last bit (possibly a parity bit)
as you type your login-name so that it can auto-detect parity. Thus
if you use parity, enable it only at the terminals and let <tt/agetty/
data bytes plus 1-bit parity. See <ref id="parity_8-bit" name="8-bit
data bytes (plus parity)"> If you use <tt/stty/ to set parity,
<tt/agetty/ will automatically unset it since it initially wants the
parity bit to come thru as if it was a data bit. This is because it
needs to get the last bit (possibly a parity bit) as you type your
login-name so that it can auto-detect parity. Thus if you use parity,
enable it only inside the text-terminal and let <tt/agetty/
auto-detect it and set it at the computer. If your terminal supports
received parity, the login prompt will look garbled until you type
something so that getty can detect the parity. The garbled prompt
@ -3279,9 +3384,9 @@ Unfortunately, the <tt/login/ program can't detect parity so if the
not be able to determine it either. If the first login attempt fails,
<tt/login/ will let you try again, etc. (all with the parity set
wrong). Eventually, after a number of failed attempts to login (or
after a timeout) /agetty/ will start up again and start the login
after a timeout) <tt/agetty/ will start up again and start the login
seqeunces all over again. Once getty is running again, it may be able
to detect the parity so everything should then work OK.
to detect the parity on the second try so everything may then work OK.
With wrong parity, the <tt/login/ program can't correctly read what
you type and you can't log in. If your terminal supports received
@ -3291,34 +3396,42 @@ before the before the prompt, so more grabled words may appear on the
screen.
Why can't agetty detect parity by the first letter typed? Here's an
example: Suppose for this letter the detected parity bit is 0 (the 8th
bit). What parity is it? If the letter is supposed to take a 0
parity bit if odd parity was set, then odd parity is a possibility.
But if the terminal sends 8-bit characters with no parity, this would
produce exactly the same 8 bits. To resolved this dilemma, more
characters are needed. If all the following characters are like the
one described above (half of the ASCII character set is like this) no
determination of parity is possible. Thus is rare cases, login will
always fail until the user name is changed.
example: Suppose it detects an 8-bit byte with its parity bit 0
(high-order bit) and with an odd number of 1-bits. What parity is it?
Well, the odd number of 1 bits implies that it's odd partiy. But it
could also just be an 8-bit character with no parity. There's no way
so far to determine which. But so far we have eliminated the
possibility of even parity. The detection of parity thus proceeds by
a process of elimination.
One may get into this "login loop" in various ways. Suppose you only
If the next byte typed is similar to the first one and also only
eliminates the possibility of even parity, it's still impossible to
determine parity. This situation can continue indefinitly and in rare
cases login will fail until you change your login-name. If agetty
finds a parity bit of 1 it will assume that this is a parity bit and
not a high-order bit of an 8-bit character. It thus assumes that you
don't use meta-characters (high bit set) in your user name (i.e that
your name is in ASCII).
One may get into a "login loop" in various ways. Suppose you only
type a single letter or two for your login name and then hit return.
If these letters are not sufficient for parity detection, then login
runs before parity has been detected. Sometimes this problem happens
if you don't have the terminal on and/or connected when agetty first
starts up.
starts up.
If you get stuck in this "login loop" a way out of it is
to hit the return key several times until you get the getty login
prompt. Another way is to just wait a minute or so for a timeout.
The getty login prompt is put on the screen by the getty program.
Then the getty login prompt will be put on the screen by the getty
program and you may try again to log in.
<sect3> Agetty's parity with 8-bit data bytes <label id="parity_8-bit">
<p> Unfortunately, agetty can't detect this parity. It (as of late
1999) has no option for disabling the auto-detection of parity and
thus will detect incorrect parity. The result is that the login
process will be garbled and parity will be set wrong. Thus it doesn't
seem feasible to try to use 8-bit data bytes with parity.
<sect3> 8-bit data bytes (plus parity) <label id="parity_8-bit">
<p> Unfortunately, agetty can't detect this parity. As of late 1999
it has no option for disabling the auto-detection of parity and thus
will detect incorrect parity. The result is that the login process
will be garbled and parity will be set wrong. Thus it doesn't seem
feasible to try to use 8-bit data bytes with parity.
<sect2> getty (part of getty_ps) <label id="getty_ps">
<p> (Most of this is from the old Serial-HOWTO by Greg Hankins)<newline>
@ -4195,23 +4308,23 @@ such as how you need to set it up so that it will work correctly with
the terminfo database.
<sect2> Deleting Data Not Needed
<p> In order to save disk space, one may delete all of the database
except for the terminals types that you have (or might need in the
future). Don't delete any of the termcaps for a "Linux terminal" (the
console) or the xterm ones if you use X-Windows. The terminal type
"dumb" may be needed when an application program can't figure out what
type of terminal you are using. It would save disk space if install
programs only installed the terminfo for the terminals that you have
and if you could get a termcap for a newly installed terminal over the
Internet in a few seconds.
<p> In order to save disk space, one may delete all of the terminfo
database except for the terminals types that you have (or might need
in the future). Don't delete any of the termcaps for a "Linux
terminal" (the console) or the xterm ones if you use X-Windows. The
terminal type "dumb" may be needed when an application program can't
figure out what type of terminal you are using. It would save disk
space if install programs only installed the terminfo for the
terminals that you have and if you could get a termcap for a newly
installed terminal over the Internet in a few seconds.
<sect1> Bugs in Existing Terminfo Files (and Hardware)
<p> Unfortunately, there are a number of bugs in the terminfo and
termcap files. In addition, many of these definitions are incomplete
and do not define certain features available on the terminals.
Sometimes you can get by without modifying the terminfo but in other
cases you need to modify it or possibly use another emulation that has
a good terminfo.
termcap files. In addition, many of these terminfo files are
incomplete and do not define certain features available on the
terminals. Sometimes you can get by without modifying the terminfo
but in other cases you need to modify it or possibly use another
emulation that has a good terminfo.
The sad state of the supplied terminfo files is due to a number of
reasons. One is that during the 1980's when many of them were written
@ -4237,11 +4350,10 @@ because the company went out of business, etc.
<sect1> Modifying Terminfo Files
<p> To do this you need a manual for your terminal showing what escape
sequences it uses. Newer manuals from the 1990's often don't show
this. You also need a terminfo manual (or the like). For example, in
order to add graphic capability you must assign values to the terminfo
variables: enacs, rmacs, and smacs by editing a source file. Then by
using "tic" you may compile it. "tic" should automatically put the
compiled terminfo file in the correct directory reserved for it.
this. You also need a terminfo manual (the man page "terminfo" is
one). After you edit the terminfo source file you compile it using
"tic". "tic" should automatically put the compiled terminfo file in
the correct directory reserved for it.
If you would like to find a better terminfo entry for a certain terminal
than the one supplied, you might try searching the Internet (but what
@ -4669,14 +4781,14 @@ Shift-PageDown will scroll forward again.
directly thru the device driver with no action or interpretation.
Echoed back are two ASCII characters such as ^C.
<sect1> Viewing Latin-1 Files on a 7-bit Terminal
<p> Some "text" files are 8-bit Latin1 (see <ref id="char_sets"
name="Character-Sets">). If you have a terminal that will not display
Latin1 (or don't have the Latin1 character set selected), then a
bullet symbol will display as a 7, etc. When viewing manual pages
(they are Latin1) you may give the option -7 to man so as to translate
the 7's, etc. to something close to a bullet (in ASCII). Are there
some pagers that make these translations ??
<sect1> Viewing Latin1 Files on a non-Latin1 terminal
<p> Some "text" files are 8-bit Latin1 (=ISO-8859-1). See <ref
id="char_sets" name="Character-Sets">. If you have a terminal that
will not display Latin1 (or don't have the Latin1 character set
installed), then certain symbols (such as a bullet) will display wrong.
When viewing manual pages (they are Latin1) you may give the option -7
to man so as to translate everything to ASCII. Are there some pagers
that make these translations ??
<sect1> Inspecting the Interface
<p> These utility programs will provide information about the terminal
@ -4751,10 +4863,9 @@ file that runs each time you login or start up the computer.
<sect1> Multiple Sessions
<p> The "<tt/screen/" package runs multiple sessions something like
virtual terminals on the console: See <ref id="console_dev" name="The
Console: /dev/tty?">. However, this is not like "pages" (<ref
id="pages_" name="Pages">) since the image of the pages are stored in
the host computer and not inside the terminal as they are with
"pages".
Console: /dev/tty?">. You can switch back and forth between the
sessions. The non-free Facet Term software also does this. See <url
url="http://www.facetcorp.com/facetterm-overview.html" name="FacetTerm">
<sect1> Logging Out
<p> To log out type either "logout" or "exit". Under some
@ -4859,7 +4970,8 @@ console. Unfortunately, the messages from the BIOS (which display on
the monitor when a PC is first started) will not display on this
terminal (but still display on the monitor).
Some people do this when they run a PC without a monitor or keyboard.
There's a Remote-Serial-Console-HOWTO on this topic. Some people use
a serial console when they run a PC without a monitor or keyboard.
Normally, a PC will not start up without a keyboard and video card but
some BIOSs permit it. If you are lucky enough to have such a BIOS
that supports "console re-direct" you will likely then need to setup
@ -5275,7 +5387,7 @@ specified "local" to getty by either:
<itemize>
<item>If getty_ps (Redhat, etc.) two CLOCAL flags in /etc/gettydefs
(See <ref id="getty_ps" name="getty (part of getty_ps)">).
<item>If agetty (Debian, etc.) a -L flag in /etc/initab (See <ref
<item>If agetty (Debian, etc.) a -L flag in /etc/inittab (See <ref
id="agetty_" name="agetty">).
</itemize>
@ -5347,14 +5459,16 @@ serial port and see if it works OK.
<sect1> Displays Garbage <label id="displays_garbage">
<p> If what you type or see on the screen is not what's expected but
looks like a foreign language, math symbols, line-drawing character,
etc. then it could be that the many of bytes that are echoed to your
looks like a foreign alphabet, math symbols, line-drawing character,
etc. then it could be that the many of bytes that are sent to your
terminal have the high order bit set (when it shouldn't be). You are
looking at the character set (or part of a character set) which has
high order bit set. This may happen if you have the baud rate wrong
or parity set per stty when it's not set inside the terminal. Try
stty -F /dev/ttyS? from another terminal to check if the baud rate
and parity are correct.
the high order bit set. This may happen if you have the baud rate
wrong or parity set wrong (per stty). If you have parity set per stty
but inside the terminal it's 8-bit no-parity, then the high order bit
(= parity bit) will often be erroneously set. Try stty -F /dev/ttyS?
from another terminal to check if the baud rate and parity are
correct.
Perhaps the wrong character set (font) has been installed. An
erroneous escape sequence sent to the terminal could have switched
@ -6656,4 +6770,3 @@ the set-up (confusing menu design).
END OF Text-Terminal-HOWTO
</article>