This commit is contained in:
gferg 2003-09-22 13:53:49 +00:00
parent c27a54ed8e
commit 96392d0e4e
2 changed files with 935 additions and 846 deletions

File diff suppressed because it is too large Load Diff

View File

@ -4,9 +4,11 @@
<author>David S.Lawyer
<tt><htmlurl url="mailto:dave@lafn.org" name="dave@lafn.org"></tt>
original by Greg Hankins
<date> v2.18, May 2003
<date> v2.19 September 2003
<!-- Change log:
v2.19 linux-serial email now at kernel.org, new section: Servers,
pinout diagram
v2.18 May 2003: EIA-485 features not supported by Linux, Flow control
"typos" fixed
v2.17 Feb. 2003 url signum->cendio, Mac port names, clarity when
@ -137,7 +139,7 @@ sites see: <url url="http://www.tldp.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://www.tldp.org/HOWTO/Serial-HOWTO.html"> and compare
it to this version: v2.18 May 2003 .
it to this version: v2.19 September 2003 .
<sect1>New in Recent Versions
<p> For a full revision history going back to the time I started
@ -146,11 +148,12 @@ maintaining this HOWTO, see the source file (in linuxdoc format) at
url="http://www.ibiblio.org/pub/linux/docs/HOWTO/other-formats/sgml/Serial-HOWTO.sgml.gz">.
<itemize>
<item>v2.19 September 2003: linux-serial email now at kernel.org, new
section: Servers, pinout diagram
<item>v2.18 May 2003: EIA-485 features not supported by Linux, Flow control
"typos" fixed
<item>v2.17 Feb 2003: url signum->cendio, Mac port names, clarity when
stopping data flow when printing, ide2 address conflict<newline>
v2.16 March 2002 fixed a few broken links<newline>
</itemize>
<sect1> Related HOWTO's re the Serial Port <label id="related_howtos">
@ -177,13 +180,9 @@ explained above.
</itemize>
<sect1>Feedback
<p>
Please send me any questions, comments, suggestions, or additional
material. I'm always eager to hear about what you think about this
HOWTO. I'm also always on the lookout for improvements! Tell me
exactly what you don't understand, or what could be clearer. You can
reach me via email at <tt><htmlurl url="mailto:dave@lafn.org"> (David
Lawyer)</tt>.
<p> Please send me any suggestions, or additional material. Tell me
what you don't understand, or what could be clearer. You can reach me
via email at <tt><url url="mailto:dave@lafn.org"></tt>.
<sect1> What is a Serial Port?
<p> The conventional serial port (not the newer USB port, or HSSI
@ -531,8 +530,8 @@ bytes promptly, then there will not be any space left for any more
incoming bytes and the small buffer may overflow (overrun) resulting
in a loss of data bytes.
There is no
<ref id="flow_control" name="Flow Control"> to prevent this.
There is no <ref
id="flow_control" name="Flow Control"> to prevent this.
Interrupts are also issued when the serial port has just sent out all
of its bytes from its small transmit FIFO buffer out the external
@ -834,7 +833,7 @@ happened there, bytes intended for the hard-disk were lost.
<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
@ -876,13 +875,13 @@ world.
is severely limited in distance. Ads often read "high speed" but it
can only work at "high speed" over very short distances such as to a
modem located right next to the computer. Compared to a network card,
even this "high speed" is low speed. All of the EIA-232 serial cable
wires use a common ground return wire so that twisted-pair technology
(needed for high speeds) can't be used without additional hardware.
More modern interfaces for serial ports exist but they are not
standard on PC's like the EIA-232 is. See <ref id="non_232"
name="Successors to EIA-232">. Some multiport serial cards support
them.
even this "high speed" is actually low speed. All of the EIA-232
serial cable wires use a common ground return wire so that
twisted-pair technology (needed for high speeds) can't be used without
additional hardware. More modern interfaces for serial ports exist
but they are not standard on PC's like the EIA-232 is. See <ref
id="non_232" name="Successors to EIA-232">. Some multiport serial
cards support them.
It is somewhat tragic that the RS-232 standard from 1969 did not use
twisted pair technology which could operate about a hundred times
@ -911,12 +910,14 @@ conventional serial I/O system only moves a byte at a time. There are
various ways to read/write directly to main memory. One way is called
shared memory I/O (where the shared memory is usually on the same card
as the I/O device). Other methods are DMA (direct memory access) on
the ISA bus and what is about the same as DMA (only much faster):
"bus mastering" on the PCI bus. These methods are a lot faster than
those used for the serial port. Thus the conventional serial port
with its interrupt driven (every 14 bytes) interface and single bytes
transfers on a bus which could accommodate 4 (or 8) bytes at a time is
not suited for very high speed I/O.
the PCI or ISA bus. Strictly speaking, for the PCI bus this is "bus
mastering" and not DMA but it's like DMA and a lot faster than true
DMA on the old ISA bus.
DMA is a lot faster than the serial-port-to computer-bus interface.
Also, the computer bus is capable of 4 (or 8) byte transfers but the serial
port only transfers a byte at a time. Interrupts to initiate a series
of such single-byte transfers often happen only every 14 bytes.
<sect> Multiport Serial Boards/Cards/Adapters
<sect1> Intro to Multiport Serial
@ -1077,11 +1078,12 @@ id="8514_" name="Avoiding IO Address Conflicts with Certain Video
Boards">
<sect1>Dumb Multiport Serial Boards (with standard UART chips)
<p> They are also called "serial adapters". They often have a
special method of sharing interrupts which requires that you compile
support for them into the kernel.<newline>
<p> They are also called "serial adapters". Each port has its own
address. They often have a special method of sharing interrupts which
requires that you compile support for them into the kernel.<newline>
* => The file that ran setserial in Debian shows some details of configuring
* => The file that ran setserial in Debian shows some details of
configuring<newline>
# => See note below for this board
<itemize>
<item>AST FourPort and clones (4 ports) * #
@ -1160,9 +1162,13 @@ webpage, the cards are likely obsolete. If you would like to put
together a better list, let me know.
<itemize>
<item>Chase Research (UK based, ISA/PCI cards)<newline>
webpage: <tt><url url="www.chaser.com"></tt><newline>
driver status: for 2.2 kernel. Supported by Chase.
<item>Chase Research now Perle Systems Ltd (UK based, ISA/PCI cards)<newline>
webpage: <tt><url url="http://www.perle.com"></tt><newline>
driver status: included in kernel 2.4+ for PCI only; otherwise supported by
Perle<newline>
driver location: <url
url="http://www.perle.com/downloads/multi_port.html"> <newline>
<item>Comtrol RocketPort (36MHz ASIC; 4, 8, 16, 32, up to 128 ports)<newline>
webpage: <tt><htmlurl url="http://www.comtrol.com"
@ -1294,8 +1300,8 @@ driver status: for 2.2 kernel. Supported by Chase.
<item> Specialix SX (25MHz T225; 8? - 32 ports),<newline>
SIO/XIO (20 MHz Zilog Z280; 4 - 32 ports)<newline>
webpage: <url url="www.specialix.com/products/io/serialio.htm"><newline>
driver status: Supported by Specialix<newline>
webpage: Old link is broken. Out of business?<newline>
driver status: Was supported by Specialix<newline>
driver location: <url url="http://www.BitWizard.nl/specialix/"><newline>
old driver location: <url
url="ftp://metalab.unc.edu/pub/Linux/kernel/patches/serial">
@ -1334,6 +1340,39 @@ name="http://www.ssc.com/lj/issue14"></tt>.
<item> Aurora (PCI only) <url url="www.auroratech.com">
</itemize>
<sect>Servers for Serial Ports
<p>A computer that has many serial ports (with many serial cables
connected to it) is often called a server. Of course, most servers
serve other functions besides just serving serial ports, and many do
not serve serial ports at all (although they likely have a serial port
on them). For example, a "serial server" may have serial cables,
each of which runs to a different (non-serial) server. The serial
server (perhaps called a "console server") controls, via a console,
all the other servers. The console may be physically located remote
from the serial server, communicating with the server over a network.
There are two basic types of serial servers. One type is just an
ordinary computer (perhaps rack mounted) that uses multiport cards on
a PCI bus (or the like). The other type is a proprietary server that
is a dedicated computer that serves a special purpose. Servers of
both types may be called: serial servers, console servers, print
servers, or terminal servers. They are not the same.
The terminal server was originally designed to provide many serial
ports, each connected to a dumb text-terminal. Today, a terminal
server often connects to graphic terminals over a fast network and
doesn't use serial ports since they are too slow. One network cable
takes the place of many serial cables and each graphic terminal uses
far more bandwidth than the text-terminals did. However, graphic
terminals may be run in text mode to reduce the bandwidth required. A
more detailed discussion of terminal servers (serial port) is in
Text-Terminal-HOWTO. For networked terminal servers (not serial port)
see <url url="http://www.ltsp.org/index.php" name="Linux Terminal
Server Project (LTSP)">
(To-do: Discuss other types serial servers, but the author knows
little about them.)
<sect>Configuring Overview
<p> The first part (locating the hardware or low-level configuring) is
assigning each port an IO address, IRQ, and name (such as ttyS2). This
@ -1419,9 +1458,9 @@ then you need to do it if you:
<item> Are installing a new serial port (such as an internal modem)
</itemize>
For kernel 2.2+ you may be able to use more that 2 serial ports
without doing any low-level configuring by sharing interrupts. All
PCI ports should support this but for ISA it only works for some
Starting with kernel 2.2 you may be able to use more that 2 serial
ports without doing any low-level configuring by sharing interrupts.
All PCI ports should support this but for ISA it only works for some
hardware. It may be just as easy to give each port a unique interrupt
if they is available. See <ref id="int_share-2.2" name="Interrupt
sharing and Kernels 2.2+">
@ -2151,8 +2190,8 @@ you may send some bytes out a port and try to detect which connector
(if any) it's coming out of. One way to send such a signal is to copy
a long text file to the port using a command like: cp my_file_name
/dev/ttyS1. A voltmeter connected to the DTR pin (see Serial-HOWTO
for Pinout) will display positive as soon as you give the copy
command.
for Pinout) will display a positive voltage as soon as you give the
copy command.
The transmit pin should go from several volts negative to a voltage
fluctuating around zero after you start sending the bytes. If it doesn't
@ -3311,7 +3350,7 @@ indicate if they are positive (1) or negative (0). See section <ref
id="serial_mon" name="Serial Monitoring/Diagnostics">
<!-- currently in <sect>Troubleshooting -->
<!-- troubleshooting.H begin (in Modem/Serial HOWTOs)
<!-- troubleshooting.D begin (in Modem/Serial HOWTOs)
Change Log:
Apr. '00: 2 ports on same address
May '00: address conflict
@ -3323,6 +3362,7 @@ July '02: typo: is doesn't => it doesn't, clarity re port not found
Dec. '02: IO error may mean IRQ conflict or IO address conflict.
Jan. '03: LSR safety check error
Feb. '03: Interrupts may be shared on PCI Bus
June '03: Wvdial: busy message due to lockfile permissions
-->
<sect1>(The following subsections are in both the Serial and Modem HOWTOs)
@ -3449,10 +3489,13 @@ at first when Linux boots. (Older kernels may show "ttyS02" as
<p> Check the file permissions on this port with "ls -l /dev/ttyS?"_
If you own the ttyS? then you need read and write permissions: crw
with the c (Character device) in col. 1. It you don't own it then it
should show rw- in cols. 8 & 9 which means that everyone has read and
write permission on it. Use "chmod" to change permissions. There are
more complicated ways to get access like belonging to a "group" that
has group permission.
will work for you if it shows rw- in cols. 8 & 9 which means that
everyone has read and write permission on it. Use "chmod" to change
permissions. There are more complicated (and secure) ways to get
access like belonging to a "group" that has group permission. Some
programs change the permissions when they run but restore them when
the program exists normally. But if someone pulls the plug on your
PC it's an abnormal exit and correct permissions may not be restored.
<sect1> "Operation not supported by device" for ttyS?
<p> This means that an operation requested by setserial, stty, etc.
@ -3476,9 +3519,12 @@ in: /lib/modules/.../misc/serial.o.
<p> When a port is "opened" by a program a lockfile is created in
/var/lock/. Wrong permissions for the lock directory will not allow a
lockfile to be created there. Use "ls -ld /var/lock" to see if the
permissions are OK: usually rwx for everyone (repeated 3 times). If
it's wrong, use "chmod" to fix it. Of course, if there is no "lock"
directory no lockfile can be created there. For more info on
permissions are OK. Giving rwx permissions for the root owner and the
group should work, provided that the users that need to dialout belong
to that group. Others should have r-x permission. Even with this
scheme, there may be a security risk. Use "chmod" to change
permissions and "chgrp" to change groups. Of course, if there is no
"lock" directory no lockfile can be created there. For more info on
lockfiles see <ref id="lockfiles_" name="What
Are Lock Files">
@ -3501,10 +3547,19 @@ have been automatically removed if it contained a stale process id
supposedly busy (in use) or that a resource it needs (such as an IRQ)
is supposedly being used by another device and can't be shared.
This message is easy to understand if it only means that the device is
busy (in use). But it often means that a needed resource is already
busy (in use). But it sometimes means that a needed resource is already
in use (busy). What makes it even more confusing is that in some cases
neither the device nor the resources that it needs are actually
"busy".
"busy".
In olden days, if a PC was shutdown by just turning off the power, a
bogus lockfile might remain and then later on one would get this bogus
message and not be able to use the serial port. Software today is
supposed to automatically remove such bogus lockfiles, but as of 2003
there is still a problem with the "wvdial" dialer program related to
lockfiles. If wvdial can't create a lockfile because it doesn't have
write permission in the /var/lock/ directory, you will see this
erroneous message.
The following example is where interrupts can't be shared (at least
one of the interrupts is on the ISA bus). The ``resource busy'' part
@ -3611,6 +3666,14 @@ troubleshooting:
<!-- troubleshooting.H end -->
<sect1> Almost all characters are wrong; Many missing or many extras
<p>Perhaps a baud mismatch. If one port sends at twice the speed that
the other port is set to receive, then every two characters sent will
be recieved as one character. The bits of this received character
will be a sample of every other bit of the two characters sent, so it
will be wrong. Also, only half the characters sent seem to get
received. A worse mismatch will produce even worse results.
<sect> Interrupt Problem Details <label id="irq_prob_details">
<p> While the section <ref id="trouble_shoot" name="Troubleshooting">
lists problems by symptom, this section explains what will happen if
@ -3965,11 +4028,19 @@ today (2000) even have 16650s. For replacing obsolete UARTs with
newer ones in pre 1990 hardware see the Appendix: Obsolete ...
<sect> Pinout and Signals <label id="pinout_">
<sect1> Pinout
<p>
<sect1> Pinout of 9-pin and 25-pin serial connectors
<p> The pin numbers are often engraved in the plastic of the
connector but you may need a magnifying glass to read them.
Note DCD is sometimes labeled CD. The numbering of the pins on a
female connector is read from right to left, starting with 1 in the
upper right corner (instead of 1 in the upper left corner for the male
connector as shown below). --> direction is out of PC.
<tscreen><verb>
PINOUT of the SERIAL PORT (--> direction is out of PC)
(Note DCD is sometimes labeled CD)
___________ ________________________________________
\1 2 3 4 5/ Looking at pins \1 2 3 4 5 6 7 8 9 10 11 12 13/
\6 7 8 9/ on male connector \14 15 16 17 18 19 20 21 22 23 24 25/
------ -----------------------------------
Pin # Pin # Acronym Full-Name Direction What-it-May-Do/Mean
9-pin 25-pin
3 2 TxD Transmit Data --> Transmits bytes out of PC
@ -3981,6 +4052,18 @@ Pin # Pin # Acronym Full-Name Direction What-it-May-Do/Mean
1 8 DCD Data Carrier Detect<-- Modem connected to another
9 22 RI Ring Indicator <-- Telephone line ringing
5 7 SG Signal Ground
9-Pin DB9 Connector 25-Pin DB-25 Connector
1 DCD Carrier Detect 1 Chasis Ground
2 RxD Receive Data 2 TxD Transmit Data
3 TxD Transmit Data 3 RxD Receive Data
4 DTR Data Terminal Ready 4 RTS Request To Send
5 SG Signal Ground 5 CTS Clear To Send
6 DSR Data Set Ready 6 DSR Data Set Ready
7 RTS Request To Send 7 SG Signal Ground
8 CTS Clear To Send 8 DCD Carrier Detect
9 RI Ring Indicator 20 DTR Data Terminal Ready
22 RI Ring Indicator
</verb></tscreen>
<sect1> Signals May Have No Fixed Meaning
@ -4550,7 +4633,7 @@ meaning of "stty" commands, etc.
<p>
The Linux serial mailing list. To join, send email to <tt><htmlurl
url="mailto:majordomo@vger.rutgers.edu"
name="majordomo@vger.rutgers.edu"></tt>, with ``<tt>subscribe
name="majordomo@vger.kernel.org"></tt>, with ``<tt>subscribe
linux-serial</tt>'' in the message body. If you send ``<tt/help/'' in
the message body, you get a help message. The server also serves
many other Linux lists. Send the ``<tt/lists/'' command for a list