old-www/HOWTO/Remote-Serial-Console-HOWTO/serial-pc-terminal.html

508 lines
10 KiB
HTML

<HTML
><HEAD
><TITLE
>Cable from console port to terminal (or another PC)</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
REL="HOME"
TITLE="Remote Serial Console HOWTO"
HREF="index.html"><LINK
REL="UP"
TITLE="Serial cabling"
HREF="serial.html"><LINK
REL="PREVIOUS"
TITLE="Cable from console port to modem"
HREF="serial-pc-modem.html"><LINK
REL="NEXT"
TITLE="Lengths of serial cables"
HREF="serial-distance.html"></HEAD
><BODY
CLASS="SECTION"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Remote Serial Console HOWTO</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="serial-pc-modem.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 11. Serial cabling</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="serial-distance.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECTION"
><H1
CLASS="SECTION"
><A
NAME="SERIAL-PC-TERMINAL"
></A
>11.3. Cable from console port to terminal (or another PC)</H1
><P
>The <SPAN
CLASS="ACRONYM"
>RS-232</SPAN
> standard allows for, but does
not specify, the interconnection of two computers without
intervening modems. A special cable is required, called a
<SPAN
CLASS="QUOTE"
>"null modem"</SPAN
> cable.</P
><P
>The wiring within the null modem cable depends upon the
handshaking and control signals that are needed. Differing
manufacturers have differing views on this topic, so don't buy a
null modem cable that does not come with a wiring diagram.</P
><P
>Linux needs all of the flow control and modem control signals
to be correctly wired. The correct wiring of a null modem cable is
shown in <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-GOOD1"
>Figure 11-1</A
> with an
alternative shown in <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-GOOD2"
>Figure 11-2</A
>.</P
><P
>Linux uses <SPAN
CLASS="ACRONYM"
>CTS</SPAN
> and <SPAN
CLASS="ACRONYM"
>RTS</SPAN
> to
do handshaking, preventing the computer from overrunning the
terminal and preventing the terminal from overrunning the computer.
If you are connecting two computers together, then you will not get
reliable file transfers without
<SPAN
CLASS="ACRONYM"
>CTS</SPAN
>/<SPAN
CLASS="ACRONYM"
>RTS</SPAN
> handshaking.</P
><P
>Linux uses <SPAN
CLASS="ACRONYM"
>DSR</SPAN
> and <SPAN
CLASS="ACRONYM"
>DCD</SPAN
> to
sense that a terminal is connected. It will then request a login.
If a session is established and <SPAN
CLASS="ACRONYM"
>DCD</SPAN
> falls then
Linux will log out the user.</P
><P
>Linux uses <SPAN
CLASS="ACRONYM"
>DTR</SPAN
> to force the link to be
cleared. It does this after a user logs off to free up the
communications channel.</P
><P
>Either of the null modem designs in <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-GOOD1"
>Figure 11-1</A
> or <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-GOOD2"
>Figure 11-2</A
> meets the requirements of
the Linux kernel. <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-GOOD2"
>Figure 11-2</A
>
may be marginally better when both computers are remotely located,
as the differing states of <SPAN
CLASS="ACRONYM"
>DSR</SPAN
> and
<SPAN
CLASS="ACRONYM"
>DCD</SPAN
> can be used to determine which end of the
null modem cable has become faulty.</P
><P
>All null modem designs have a common flaw. Computers
interconnected with real modems modem will drop Data Set Ready for
some time after the local modem is reset by the local computer
dropping Data Terminal Ready. Most software is designed to
accomodate this slight difference between modem links and null
modem links.</P
><P
>Major security exposures and significant loss of reliability
can occur with incorrectly wired null modem cables, including the
cables in <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-BAD"
>Figure 11-3</A
>, <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-UGLY1"
>Figure 11-4</A
> and <A
HREF="serial-pc-terminal.html#SERIAL-PC-TERMINAL-CABLE-UGLY2"
>Figure 11-5</A
>.</P
><DIV
CLASS="FIGURE"
><A
NAME="SERIAL-PC-TERMINAL-CABLE-GOOD1"
></A
><P
><B
>Figure 11-1. Null modem cable with full status and handshaking</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
> Signal ground ---------------------- Signal ground
Receive data ---------------------- Transmit data
Transmit data ---------------------- Receive data
Ready to send ---------------------- Clear to send
Clear to send ---------------------- Ready to send
Data terminal ready -----------------+---- Data carrier detect
|
+---- Data set ready
Data carrier detect ----+----------------- Data terminal ready
|
Data set ready ----+
Ring indication -- not connected
not connected -- Ring indication</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="FIGURE"
><A
NAME="SERIAL-PC-TERMINAL-CABLE-GOOD2"
></A
><P
><B
>Figure 11-2. Variation on null modem cable with full status and
handshaking</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
> Signal ground ---------------------- Signal ground
Receive data ---------------------- Transmit data
Transmit data ---------------------- Receive data
Ready to send ---------------------- Clear to send
Clear to send ---------------------- Ready to send
Data terminal ready ----+----------------- Data carrier detect
|
Data set ready ----+
+---- Data set ready
|
Data carrier detect ----+------------+---- Data terminal ready
Ring indication -- not connected
not connected -- Ring indication</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><P
>Unfortunately not all <SPAN
CLASS="SYSTEMITEM"
>Linux</SPAN
> boot loaders support the control
signals required by the <SPAN
CLASS="SYSTEMITEM"
>Linux</SPAN
> operating system. This odd state
of affairs may force you to do away with control signals and
handshaking if you need to issue commands to the boot
loader.</P
><P
>There are two ways of defeating the <SPAN
CLASS="ACRONYM"
>RS-232</SPAN
>
handshaking: software and hardware.</P
><P
>If you have a modem then by far the best technique is to
disable the control signals and handshaking by using
<SPAN
CLASS="ACRONYM"
>AT</SPAN
> commands to configure the modem's software.
This allows the handshaking to be restored when the boot loader
authors correct their support for serial connections.</P
><P
>For a null modem cable the best approach is to disable
handshaking in your terminal emulation software.</P
><P
>In the worst case for a null modem you will need a cable that
falsifies the handshaking and control signals. Try not to use
these cables in a production environment.</P
><DIV
CLASS="FIGURE"
><A
NAME="SERIAL-PC-TERMINAL-CABLE-BAD"
></A
><P
><B
>Figure 11-3. Null modem cable with falsified status and
handshaking</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
> Signal ground ---------------------- Signal ground
Receive data ---------------------- Transmit data
Transmit data ---------------------- Receive data
Data terminal ready ---+ +--- Data terminal ready
| |
Clear to send ---+ +--- Clear to send
| |
Data carrier detect ---+ +--- Data terminal ready
| |
Data set ready ---+ +--- Data set ready
Ready to send -- not connected
not connected -- Ready to send
Ring indication -- not connected
not connected -- Ring indication</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><P
>If you are happy with a quick hack, perhaps just to use a
serial console to grab a kernel oops message, then you can
configure some <SPAN
CLASS="APPLICATION"
>getty</SPAN
> programs to ignore
the <SPAN
CLASS="ACRONYM"
>RS-232</SPAN
> status signals. For example,
<SPAN
CLASS="APPLICATION"
>mgetty</SPAN
> has the <TT
CLASS="LITERAL"
>direct</TT
>
option in <TT
CLASS="FILENAME"
>mgetty.conf</TT
>. In this case only a
three-wire or two-wire <SPAN
CLASS="ACRONYM"
>RS-232</SPAN
> null modem cable
is needed.</P
><DIV
CLASS="FIGURE"
><A
NAME="SERIAL-PC-TERMINAL-CABLE-UGLY1"
></A
><P
><B
>Figure 11-4. Null modem cable with no status or handshaking</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
>Signal ground ---------------------- Signal ground
Receive data ---------------------- Transmit data
Transmit data ---------------------- Receive data</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="FIGURE"
><A
NAME="SERIAL-PC-TERMINAL-CABLE-UGLY2"
></A
><P
><B
>Figure 11-5. One-way null modem cable with no status or handshaking</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><FONT
COLOR="#000000"
><PRE
CLASS="PROGRAMLISTING"
>Signal ground ---------------------- Signal ground
Transmit data ---------------------- Receive data</PRE
></FONT
></TD
></TR
></TABLE
></DIV
><P
>Don't use these cables in a production environment.</P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="serial-pc-modem.html"
ACCESSKEY="P"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="serial-distance.html"
ACCESSKEY="N"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>Cable from console port to modem</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="serial.html"
ACCESSKEY="U"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Lengths of serial cables</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>