White space fix only. Translators can ignore.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-05-07 20:37:48 +00:00
parent 67995497aa
commit e3d8bc4dd2
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44790

View file

@ -104,59 +104,57 @@
</variablelist> </variablelist>
<para>When referring to communication data rates, this section <para>When referring to communication data rates, this section
does not use the term <firstterm>baud</firstterm>. Baud refers to the does not use the term <firstterm>baud</firstterm>. Baud refers
number of electrical state transitions made in a to the number of electrical state transitions made in a period
period of time, while <acronym>bps</acronym> is the of time, while <acronym>bps</acronym> is the correct term to
correct term to use.</para> use.</para>
<para>To connect a serial terminal to a &os; system, a <para>To connect a serial terminal to a &os; system, a serial port
serial port on the computer and the proper cable to connect to on the computer and the proper cable to connect to the serial
the serial device are needed. Users who are already familiar device are needed. Users who are already familiar with serial
with serial hardware and cabling can safely skip this hardware and cabling can safely skip this section.</para>
section.</para>
<sect2 xml:id="term-cables-null"> <sect2 xml:id="term-cables-null">
<title>Serial Cables and Ports</title> <title>Serial Cables and Ports</title>
<para>There are several different kinds of serial cables. The <para>There are several different kinds of serial cables. The
two most common types are null-modem cables and standard two most common types are null-modem cables and standard
<acronym>RS-232</acronym> cables. The documentation for the hardware should <acronym>RS-232</acronym> cables. The documentation for the
describe the type of cable required.</para> hardware should describe the type of cable required.</para>
<para>These two types of cables differ in how the wires are <para>These two types of cables differ in how the wires are
connected to the connector. Each wire represents a signal, connected to the connector. Each wire represents a signal,
with the defined signals summarized in <xref with the defined signals summarized in <xref
linkend="serialcomms-signal-names"/>. A standard serial linkend="serialcomms-signal-names"/>. A standard serial
cable passes all of the <acronym>RS-232C</acronym> signals cable passes all of the <acronym>RS-232C</acronym> signals
straight through. For example, the <quote>Transmitted Data</quote> pin on straight through. For example, the <quote>Transmitted
one end of the cable goes to the <quote>Transmitted Data</quote> pin on one end of the cable goes to the
Data</quote> pin on the other end. This is the type of <quote>Transmitted Data</quote> pin on the other end. This is
cable used to connect a modem to the &os; system, and is also the type of cable used to connect a modem to the &os; system,
appropriate for some terminals.</para> and is also appropriate for some terminals.</para>
<para>A null-modem cable <para>A null-modem cable switches the <quote>Transmitted
switches the <quote>Transmitted Data</quote> pin of the Data</quote> pin of the connector on one end with the
connector on one end with the <quote>Received <quote>Received Data</quote> pin on the other end. The
Data</quote> pin on the other end. The connector can be connector can be either a <acronym>DB-25</acronym> or a
either a <acronym>DB-25</acronym> or a
<acronym>DB-9</acronym>.</para> <acronym>DB-9</acronym>.</para>
<para>A null-modem cable can be constructed <para>A null-modem cable can be constructed using the pin
using the pin connections summarized in <xref connections summarized in <xref linkend="nullmodem-db25"/>,
linkend="nullmodem-db25"/>, <xref <xref linkend="nullmodem-db9"/>, and <xref
linkend="nullmodem-db9"/>, and <xref linkend="nullmodem-db9-25"/>. While the standard calls for
linkend="nullmodem-db9-25"/>. While the standard a straight-through pin 1 to pin 1 <quote>Protective
calls for a straight-through pin 1 to pin 1 Ground</quote> line, it is often omitted. Some terminals
<quote>Protective Ground</quote> line, it is often work using only pins 2, 3, and 7, while others require
omitted. Some terminals work using only pins 2, 3, and 7, different configurations. When in doubt, refer to the
while others require different configurations. When in doubt, documentation for the hardware.</para>
refer to the documentation for the hardware.</para>
<indexterm> <indexterm>
<primary>null-modem cable</primary> <primary>null-modem cable</primary>
</indexterm> </indexterm>
<table frame="none" pgwide="1" xml:id="serialcomms-signal-names"> <table frame="none" pgwide="1"
xml:id="serialcomms-signal-names">
<title><acronym>RS-232C</acronym> Signal Names</title> <title><acronym>RS-232C</acronym> Signal Names</title>
<tgroup cols="2"> <tgroup cols="2">
@ -494,13 +492,13 @@
constructing a cable, make sure it will fit the ports on the constructing a cable, make sure it will fit the ports on the
terminal and on the &os; system.</para> terminal and on the &os; system.</para>
<para>Most terminals have <acronym>DB-25</acronym> ports. Personal computers may <para>Most terminals have <acronym>DB-25</acronym> ports.
have <acronym>DB-25</acronym> or <acronym>DB-9</acronym> Personal computers may have <acronym>DB-25</acronym> or
ports. A multiport serial card may have <acronym>DB-9</acronym> ports. A multiport serial card may
<acronym>RJ-12</acronym> or <acronym>RJ-45/</acronym> ports. have <acronym>RJ-12</acronym> or <acronym>RJ-45/</acronym>
See the documentation that accompanied the hardware for ports. See the documentation that accompanied the hardware
specifications on the kind of port or visually verify the type for specifications on the kind of port or visually verify the
of port.</para> type of port.</para>
<para>In &os;, each serial port is accessed through an entry in <para>In &os;, each serial port is accessed through an entry in
<filename>/dev</filename>. There are two different kinds of <filename>/dev</filename>. There are two different kinds of
@ -516,10 +514,10 @@
<filename>/dev/ttyu0</filename> to refer to the terminal. <filename>/dev/ttyu0</filename> to refer to the terminal.
If the terminal is on the second serial port If the terminal is on the second serial port
(<filename>COM2</filename>), use (<filename>COM2</filename>), use
<filename>/dev/ttyu1</filename>, and so forth. Generally, the call-in port is used <filename>/dev/ttyu1</filename>, and so forth. Generally,
for terminals. Call-in ports require that the serial line the call-in port is used for terminals. Call-in ports
assert the <quote>Data Carrier Detect</quote> require that the serial line assert the <quote>Data
signal to work correctly.</para> Carrier Detect</quote> signal to work correctly.</para>
</listitem> </listitem>
<listitem> <listitem>
@ -527,17 +525,17 @@
<filename>/dev/cuau<replaceable>N</replaceable></filename> <filename>/dev/cuau<replaceable>N</replaceable></filename>
on &os; versions 10.x and higher and on &os; versions 10.x and higher and
<filename>/dev/cuad<replaceable>N</replaceable></filename> <filename>/dev/cuad<replaceable>N</replaceable></filename>
on &os; versions 9.x and lower. on &os; versions 9.x and lower. Call-out ports are
Call-out ports are usually not used for terminals, but are usually not used for terminals, but are used for modems.
used for modems. The call-out port can be used if the The call-out port can be used if the serial cable or the
serial cable or the terminal does not support the <quote>Data Carrier Detect</quote> terminal does not support the <quote>Data Carrier
signal.</para> Detect</quote> signal.</para>
</listitem> </listitem>
</itemizedlist> </itemizedlist>
<para>&os; also provides initialization <para>&os; also provides initialization devices
devices (<filename>/dev/ttyu<replaceable>N</replaceable>.init</filename>
(<filename>/dev/ttyu<replaceable>N</replaceable>.init</filename> and and
<filename>/dev/cuau<replaceable>N</replaceable>.init</filename> <filename>/dev/cuau<replaceable>N</replaceable>.init</filename>
or or
<filename>/dev/cuad<replaceable>N</replaceable>.init</filename>) <filename>/dev/cuad<replaceable>N</replaceable>.init</filename>)
@ -553,9 +551,9 @@
<literal>RTS/CTS</literal> signaling for flow control. The <literal>RTS/CTS</literal> signaling for flow control. The
locking devices are used to lock flags on ports to prevent locking devices are used to lock flags on ports to prevent
users or programs changing certain parameters. Refer to users or programs changing certain parameters. Refer to
&man.termios.4;, &man.sio.4;, and &man.stty.1; for &man.termios.4;, &man.sio.4;, and &man.stty.1; for information
information on terminal settings, locking and initializing on terminal settings, locking and initializing devices, and
devices, and setting terminal options, respectively.</para> setting terminal options, respectively.</para>
</sect2> </sect2>
<sect2 xml:id="serial-hw-config"> <sect2 xml:id="serial-hw-config">
@ -564,12 +562,11 @@
<para>By default, &os; supports four serial ports which are <para>By default, &os; supports four serial ports which are
commonly known as <filename>COM1</filename>, commonly known as <filename>COM1</filename>,
<filename>COM2</filename>, <filename>COM3</filename>, and <filename>COM2</filename>, <filename>COM3</filename>, and
<filename>COM4</filename>. &os; also supports <filename>COM4</filename>. &os; also supports dumb multi-port
dumb multi-port serial interface cards, such as serial interface cards, such as the BocaBoard 1008 and 2016,
the BocaBoard 1008 and 2016, as well as more intelligent as well as more intelligent multi-port cards such as those
multi-port cards such as those made by Digiboard. However, made by Digiboard. However, the default kernel only looks for
the default kernel only looks for the the standard <filename>COM</filename> ports.</para>
standard <filename>COM</filename> ports.</para>
<para>To see if the system recognizes the serial ports, look for <para>To see if the system recognizes the serial ports, look for
system boot messages that start with system boot messages that start with
@ -577,17 +574,18 @@
<screen>&prompt.root; <userinput>grep uart /var/run/dmesg.boot</userinput></screen> <screen>&prompt.root; <userinput>grep uart /var/run/dmesg.boot</userinput></screen>
<para>If the system does not recognize all of the needed serial ports, <para>If the system does not recognize all of the needed serial
additional entries can be added to ports, additional entries can be added to
<filename>/boot/device.hints</filename>. This file already <filename>/boot/device.hints</filename>. This file already
contains <literal>hint.uart.0.*</literal> entries for contains <literal>hint.uart.0.*</literal> entries for
<filename>COM1</filename> and <literal>hint.uart.1.*</literal> entries <filename>COM1</filename> and <literal>hint.uart.1.*</literal>
for <filename>COM2</filename>. When adding a port entry for entries for <filename>COM2</filename>. When adding a port
<filename>COM3</filename> use entry for <filename>COM3</filename> use
<literal>0x3E8</literal>, and for <filename>COM4</filename> use <literal>0x3E8</literal>, and for <filename>COM4</filename>
<literal>0x2E8</literal>. Common <acronym>IRQ</acronym> addresses use <literal>0x2E8</literal>. Common <acronym>IRQ</acronym>
are <literal>5</literal> for <filename>COM3</filename> and addresses are <literal>5</literal> for
<literal>9</literal> for <filename>COM4</filename>.</para> <filename>COM3</filename> and <literal>9</literal> for
<filename>COM4</filename>.</para>
<indexterm><primary><filename>ttyu</filename></primary></indexterm> <indexterm><primary><filename>ttyu</filename></primary></indexterm>
<indexterm><primary><filename>cuau</filename></primary></indexterm> <indexterm><primary><filename>cuau</filename></primary></indexterm>
@ -599,17 +597,16 @@
<screen>&prompt.root; <userinput>stty -a -f /dev/<replaceable>ttyu1</replaceable></userinput></screen> <screen>&prompt.root; <userinput>stty -a -f /dev/<replaceable>ttyu1</replaceable></userinput></screen>
<para>System-wide initialization of serial devices is <para>System-wide initialization of serial devices is controlled
controlled by <filename>/etc/rc.d/serial</filename>. This by <filename>/etc/rc.d/serial</filename>. This file affects
file affects the default settings of serial devices. To the default settings of serial devices. To change the
change the settings for a device, use <command>stty</command>. settings for a device, use <command>stty</command>. By
By default, the changed settings default, the changed settings are in effect until the device
are in effect until the device is closed and when the device is is closed and when the device is reopened, it goes back to the
reopened, it goes back to the default set. To permanently default set. To permanently change the default set, open and
change the default set, open and adjust the settings of the adjust the settings of the initialization device. For
initialization device. For example, to turn on example, to turn on <option>CLOCAL</option> mode, 8 bit
<option>CLOCAL</option> mode, 8 bit communication, and communication, and <option>XON/XOFF</option> flow control for
<option>XON/XOFF</option> flow control for
<filename>ttyu5</filename>, type:</para> <filename>ttyu5</filename>, type:</para>
<screen>&prompt.root; <userinput>stty -f /dev/ttyu5.init clocal cs8 ixon ixoff</userinput></screen> <screen>&prompt.root; <userinput>stty -f /dev/ttyu5.init clocal cs8 ixon ixoff</userinput></screen>
@ -620,15 +617,15 @@
</indexterm> </indexterm>
<para>To prevent certain settings from being changed by an <para>To prevent certain settings from being changed by an
application, make adjustments to the locking application, make adjustments to the locking device. For
device. For example, to lock the speed of example, to lock the speed of <filename>ttyu5</filename> to
<filename>ttyu5</filename> to 57600&nbsp;bps, type:</para> 57600&nbsp;bps, type:</para>
<screen>&prompt.root; <userinput>stty -f /dev/ttyu5.lock 57600</userinput></screen> <screen>&prompt.root; <userinput>stty -f /dev/ttyu5.lock 57600</userinput></screen>
<para>Now, any application that opens <para>Now, any application that opens <filename>ttyu5</filename>
<filename>ttyu5</filename> and tries to change the speed and tries to change the speed of the port will be stuck with
of the port will be stuck with 57600&nbsp;bps.</para> 57600&nbsp;bps.</para>
</sect2> </sect2>
</sect1> </sect1>
@ -761,10 +758,10 @@
<title>Terminal Configuration</title> <title>Terminal Configuration</title>
<para>This section describes how to configure a &os; system to <para>This section describes how to configure a &os; system to
enable a login session on a serial terminal. It assumes that the enable a login session on a serial terminal. It assumes that
system recognizes the serial port to which the the system recognizes the serial port to which the terminal is
terminal is connected and that the terminal is connected and that the terminal is connected with the correct
connected with the correct cable.</para> cable.</para>
<para>In &os;, <command>init</command> reads <para>In &os;, <command>init</command> reads
<filename>/etc/ttys</filename> and starts a <filename>/etc/ttys</filename> and starts a
@ -774,17 +771,17 @@
program. The ports on the &os; system which allow logins are program. The ports on the &os; system which allow logins are
listed in <filename>/etc/ttys</filename>. For example, the listed in <filename>/etc/ttys</filename>. For example, the
first virtual console, <filename>ttyv0</filename>, has an first virtual console, <filename>ttyv0</filename>, has an
entry in this file, allowing logins on the console. This entry in this file, allowing logins on the console. This file
file also contains entries for the other virtual consoles, also contains entries for the other virtual consoles, serial
serial ports, and pseudo-ttys. For a hardwired terminal, ports, and pseudo-ttys. For a hardwired terminal, the serial
the serial port's <filename>/dev</filename> entry is listed port's <filename>/dev</filename> entry is listed without the
without the <literal>/dev</literal> part. For example, <literal>/dev</literal> part. For example,
<filename>/dev/ttyv0</filename> is listed as <filename>/dev/ttyv0</filename> is listed as
<literal>ttyv0</literal>.</para> <literal>ttyv0</literal>.</para>
<para>The default <para>The default <filename>/etc/ttys</filename> configures
<filename>/etc/ttys</filename> configures support for the first support for the first four serial ports,
four serial ports, <filename>ttyu0</filename> through <filename>ttyu0</filename> through
<filename>ttyu3</filename>:</para> <filename>ttyu3</filename>:</para>
<programlisting>ttyu0 "/usr/libexec/getty std.9600" dialup off secure <programlisting>ttyu0 "/usr/libexec/getty std.9600" dialup off secure
@ -792,22 +789,20 @@ ttyu1 "/usr/libexec/getty std.9600" dialup off secure
ttyu2 "/usr/libexec/getty std.9600" dialup off secure ttyu2 "/usr/libexec/getty std.9600" dialup off secure
ttyu3 "/usr/libexec/getty std.9600" dialup off secure</programlisting> ttyu3 "/usr/libexec/getty std.9600" dialup off secure</programlisting>
<para>When attaching a terminal to <para>When attaching a terminal to one of those ports, modify
one of those ports, modify the default entry to set the the default entry to set the required speed and terminal type,
required speed and terminal type, to turn the device to turn the device <literal>on</literal> and, if needed, to
<literal>on</literal> and, if needed, to change the port's change the port's <literal>secure</literal> setting. If the
<literal>secure</literal> setting. If the terminal is terminal is connected to another port, add an entry for the
connected to another port, add an entry for the port.</para> port.</para>
<para><xref linkend="ex-etc-ttys"/> configures two <para><xref linkend="ex-etc-ttys"/> configures two terminals in
terminals in <filename>/etc/ttys</filename>. The first <filename>/etc/ttys</filename>. The first entry configures a
entry configures a Wyse-50 Wyse-50 connected to <filename>COM2</filename>. The second
connected to <filename>COM2</filename>. The second entry entry configures an old computer running
configures an old computer running <application>Procomm</application> terminal software emulating
<application>Procomm</application> terminal software a VT-100 terminal. The computer is connected to the sixth
emulating a VT-100 terminal. The computer is connected serial port on a multi-port serial card.</para>
to the sixth serial port on
a multi-port serial card.</para>
<example xml:id="ex-etc-ttys"> <example xml:id="ex-etc-ttys">
<title>Configuring Terminal Entries</title> <title>Configuring Terminal Entries</title>
@ -817,83 +812,81 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
<calloutlist> <calloutlist>
<callout arearefs="co-ttys-line1col1"> <callout arearefs="co-ttys-line1col1">
<para>The first field specifies the device name of <para>The first field specifies the device name of the
the serial terminal.</para> serial terminal.</para>
</callout> </callout>
<callout arearefs="co-ttys-line1col2"> <callout arearefs="co-ttys-line1col2">
<para>The second field tells <para>The second field tells <command>getty</command> to
<command>getty</command> to initialize and open the initialize and open the line, set the line speed, prompt
line, set the line speed, prompt for a user name, and for a user name, and then execute the
then execute the <command>login</command> program. The optional <command>login</command> program. The optional
<firstterm>getty type</firstterm> configures <firstterm>getty type</firstterm> configures
characteristics on the terminal line, like characteristics on the terminal line, like
<acronym>bps</acronym> rate and parity. The available <acronym>bps</acronym> rate and parity. The available
getty types are listed in getty types are listed in
<filename>/etc/gettytab</filename>. In <filename>/etc/gettytab</filename>. In almost all
almost all cases, the getty types that start with cases, the getty types that start with
<literal>std</literal> will work for hardwired <literal>std</literal> will work for hardwired terminals
terminals as these entries ignore parity. There is as these entries ignore parity. There is a
a <literal>std</literal> entry for each <literal>std</literal> entry for each
<acronym>bps</acronym> rate from 110 to 115200. Refer to <acronym>bps</acronym> rate from 110 to 115200. Refer
&man.gettytab.5; for more information.</para> to &man.gettytab.5; for more information.</para>
<para>When setting the getty <para>When setting the getty type, make sure to match the
type, make sure to match communications settings used by the terminal. For this
the communications settings used by the terminal. For example, the Wyse-50 uses no parity and connects at
this example, the Wyse-50 uses no parity and 38400&nbsp;bps. The computer uses no parity and
connects at 38400&nbsp;bps. The computer uses no connects at 19200&nbsp;bps.</para>
parity and connects at 19200&nbsp;bps.</para>
</callout> </callout>
<callout arearefs="co-ttys-line1col3"> <callout arearefs="co-ttys-line1col3">
<para>The third field is the type of terminal. For dial-up ports, <para>The third field is the type of terminal. For
<literal>unknown</literal> or dial-up ports, <literal>unknown</literal> or
<literal>dialup</literal> is typically used since <literal>dialup</literal> is typically used since users
users may dial up with practically any type of may dial up with practically any type of terminal or
terminal or software. Since the terminal type does software. Since the terminal type does not change for
not change for hardwired terminals, a real terminal hardwired terminals, a real terminal type from
type from <filename>/etc/termcap</filename> can be specified. <filename>/etc/termcap</filename> can be specified. For
For this example, the Wyse-50 uses the real this example, the Wyse-50 uses the real terminal type
terminal type while the computer running while the computer running
<application>Procomm</application> is set to <application>Procomm</application> is set to emulate a
emulate a VT-100.</para> VT-100.</para>
</callout> </callout>
<callout arearefs="co-ttys-line1col4"> <callout arearefs="co-ttys-line1col4">
<para>The fourth field specifies if the port should be <para>The fourth field specifies if the port should be
enabled. To enable logins on this port, this enabled. To enable logins on this port, this field must
field must be set to <literal>on</literal>.</para> be set to <literal>on</literal>.</para>
</callout> </callout>
<callout arearefs="co-ttys-line1col5"> <callout arearefs="co-ttys-line1col5">
<para>The final field is used to specify whether the <para>The final field is used to specify whether the port
port is secure. Marking a port as is secure. Marking a port as <literal>secure</literal>
<literal>secure</literal> means that it is trusted means that it is trusted enough to allow <systemitem
enough to allow <systemitem
class="username">root</systemitem> to login from that class="username">root</systemitem> to login from that
port. Insecure ports do not allow <systemitem port. Insecure ports do not allow <systemitem
class="username">root</systemitem> logins. On an class="username">root</systemitem> logins. On an
insecure port, users must login from unprivileged insecure port, users must login from unprivileged
accounts and then use <command>su</command> or a similar accounts and then use <command>su</command> or a similar
mechanism to gain superuser privileges, as described mechanism to gain superuser privileges, as described in
in <xref linkend="users-superuser"/>. For security reasons, <xref linkend="users-superuser"/>. For security
it is recommended to change this setting to reasons, it is recommended to change this setting to
<literal>insecure</literal>.</para> <literal>insecure</literal>.</para>
</callout> </callout>
</calloutlist> </calloutlist>
</example> </example>
<para>After making any changes to <para>After making any changes to
<filename>/etc/ttys</filename>, send a SIGHUP (hangup) <filename>/etc/ttys</filename>, send a SIGHUP (hangup) signal
signal to the <command>init</command> process to force it to to the <command>init</command> process to force it to re-read
re-read its configuration file:</para> its configuration file:</para>
<screen>&prompt.root; <userinput>kill -HUP 1</userinput></screen> <screen>&prompt.root; <userinput>kill -HUP 1</userinput></screen>
<para>Since <command>init</command> is always the first process <para>Since <command>init</command> is always the first process
run on a system, it always has a process run on a system, it always has a process <acronym>ID</acronym>
<acronym>ID</acronym> of <literal>1</literal>.</para> of <literal>1</literal>.</para>
<para>If everything is set up correctly, all cables are in <para>If everything is set up correctly, all cables are in
place, and the terminals are powered up, a place, and the terminals are powered up, a
@ -916,8 +909,8 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
emulation software on the correct serial port.</para> emulation software on the correct serial port.</para>
<para>Make sure the cable is connected firmly to both the <para>Make sure the cable is connected firmly to both the
terminal and the &os; computer. Make sure it is the terminal and the &os; computer. Make sure it is the right
right kind of cable.</para> kind of cable.</para>
<para>Make sure the terminal and &os; agree on the <para>Make sure the terminal and &os; agree on the
<acronym>bps</acronym> rate and parity settings. For a video <acronym>bps</acronym> rate and parity settings. For a video
@ -926,11 +919,11 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
sure paper and ink are in good supply.</para> sure paper and ink are in good supply.</para>
<para>Use <command>ps</command> to make sure that a <para>Use <command>ps</command> to make sure that a
<command>getty</command> process is <command>getty</command> process is running and serving the
running and serving the terminal. For example, terminal. For example, the following listing shows that a
the following listing shows that a <command>getty</command> is <command>getty</command> is running on the second serial port,
running on the second serial port, <filename>ttyu1</filename>, <filename>ttyu1</filename>, and is using the
and is using the <literal>std.38400</literal> entry in <literal>std.38400</literal> entry in
<filename>/etc/gettytab</filename>:</para> <filename>/etc/gettytab</filename>:</para>
<screen>&prompt.root; <userinput>ps -axww|grep ttyu</userinput> <screen>&prompt.root; <userinput>ps -axww|grep ttyu</userinput>
@ -996,37 +989,40 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
<indexterm><primary>dial-in service</primary></indexterm> <indexterm><primary>dial-in service</primary></indexterm>
<para>Configuring a &os; system for dial-in service is similar <para>Configuring a &os; system for dial-in service is similar to
to configuring terminals, except that modems are used instead of configuring terminals, except that modems are used instead of
terminal devices. &os; supports both external and internal terminal devices. &os; supports both external and internal
modems.</para> modems.</para>
<para>External modems are more convenient because <para>External modems are more convenient because they often can
they often can be configured via parameters be configured via parameters stored in non-volatile
stored in non-volatile <acronym>RAM</acronym> and they usually provide lighted <acronym>RAM</acronym> and they usually provide lighted
indicators that display the state of important <acronym>RS-232</acronym> signals, indicators that display the state of important
indicating whether the modem is operating properly.</para> <acronym>RS-232</acronym> signals, indicating whether the modem
is operating properly.</para>
<para>Internal modems usually lack non-volatile <acronym>RAM</acronym>, so their <para>Internal modems usually lack non-volatile
configuration may be limited to setting <acronym>DIP</acronym> switches. If the <acronym>RAM</acronym>, so their configuration may be limited to
internal modem has any signal indicator lights, they are setting <acronym>DIP</acronym> switches. If the internal modem
difficult to view when the system's cover is in place.</para> has any signal indicator lights, they are difficult to view when
the system's cover is in place.</para>
<indexterm><primary>modem</primary></indexterm> <indexterm><primary>modem</primary></indexterm>
<para>When using an external modem, a proper cable is needed. A <para>When using an external modem, a proper cable is needed. A
standard <acronym>RS-232C</acronym> serial cable should suffice.</para> standard <acronym>RS-232C</acronym> serial cable should
suffice.</para>
<para>&os; needs the <acronym>RTS</acronym> and <para>&os; needs the <acronym>RTS</acronym> and
<acronym>CTS</acronym> signals for flow control at speeds <acronym>CTS</acronym> signals for flow control at speeds above
above 2400&nbsp;bps, the <acronym>CD</acronym> signal to 2400&nbsp;bps, the <acronym>CD</acronym> signal to detect when a
detect when a call has been answered or the line has been hung call has been answered or the line has been hung up, and the
up, and the <acronym>DTR</acronym> signal to reset the modem <acronym>DTR</acronym> signal to reset the modem after a session
after a session is complete. Some cables are wired without all is complete. Some cables are wired without all of the needed
of the needed signals, so if a login session does not go away signals, so if a login session does not go away when the line
when the line hangs up, there may be a problem with the hangs up, there may be a problem with the cable. Refer to <xref
cable. Refer to <xref linkend="term-cables-null"/> for more linkend="term-cables-null"/> for more information about these
information about these signals.</para> signals.</para>
<para>Like other &unix;-like operating systems, &os; uses the <para>Like other &unix;-like operating systems, &os; uses the
hardware signals to find out when a call has been answered or a hardware signals to find out when a call has been answered or a
@ -1037,21 +1033,21 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
<para>&os; supports the <acronym>NS8250</acronym>, <para>&os; supports the <acronym>NS8250</acronym>,
<acronym>NS16450</acronym>, <acronym>NS16550</acronym>, and <acronym>NS16450</acronym>, <acronym>NS16550</acronym>, and
<acronym>NS16550A</acronym>-based <acronym>RS-232C</acronym> <acronym>NS16550A</acronym>-based <acronym>RS-232C</acronym>
(<acronym>CCITT</acronym> V.24) communications (<acronym>CCITT</acronym> V.24) communications interfaces. The
interfaces. The 8250 and 16450 devices have single-character 8250 and 16450 devices have single-character buffers. The 16550
buffers. The 16550 device provides a 16-character buffer, device provides a 16-character buffer, which allows for better
which allows for better system performance. Bugs in plain system performance. Bugs in plain 16550 devices prevent the use
16550 devices prevent the use of the 16-character buffer, so use of the 16-character buffer, so use 16550A devices if possible.
16550A devices if possible. Because single-character-buffer Because single-character-buffer devices require more work by the
devices require more work by the operating system than the operating system than the 16-character-buffer devices,
16-character-buffer devices, 16550A-based serial interface 16550A-based serial interface cards are preferred. If the
cards are preferred. If the system has many active serial system has many active serial ports or will have a heavy load,
ports or will have a heavy load, 16550A-based cards are better 16550A-based cards are better for low-error-rate
for low-error-rate communications.</para> communications.</para>
<para>The rest of this section demonstrates how to configure a <para>The rest of this section demonstrates how to configure a
modem to receive incoming connections, how to communicate modem to receive incoming connections, how to communicate with
with the modem, and offers some troubleshooting tips.</para> the modem, and offers some troubleshooting tips.</para>
<sect2 xml:id="dialup-ttys"> <sect2 xml:id="dialup-ttys">
<title>Modem Configuration</title> <title>Modem Configuration</title>
@ -1060,77 +1056,70 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure</programlisting>
<para>As with terminals, <command>init</command> spawns a <para>As with terminals, <command>init</command> spawns a
<command>getty</command> process for each configured serial <command>getty</command> process for each configured serial
port used for dial-in connections. When a user dials the port used for dial-in connections. When a user dials the
modem's line and the modems connect, modem's line and the modems connect, the <quote>Carrier
the <quote>Carrier Detect</quote> signal is reported by Detect</quote> signal is reported by the modem. The kernel
the modem. The kernel notices that the carrier has been notices that the carrier has been detected and instructs
detected and instructs <command>getty</command> to open the <command>getty</command> to open the port and display a
port and display a
<prompt>login:</prompt> prompt at the specified initial line <prompt>login:</prompt> prompt at the specified initial line
speed. In a typical configuration, if garbage characters are speed. In a typical configuration, if garbage characters are
received, usually due to the modem's connection speed received, usually due to the modem's connection speed being
being different than the configured speed, different than the configured speed, <command>getty</command>
<command>getty</command> tries adjusting the line speeds until tries adjusting the line speeds until it receives reasonable
it receives reasonable characters. After the user enters their login name, characters. After the user enters their login name,
<command>getty</command> executes <command>getty</command> executes <command>login</command>,
<command>login</command>, which completes the login process which completes the login process by asking for the user's
by asking for the user's password and then starting the user's password and then starting the user's shell.</para>
shell.</para>
<indexterm> <indexterm>
<primary><command>/usr/bin/login</command></primary> <primary><command>/usr/bin/login</command></primary>
</indexterm> </indexterm>
<para>There are two schools of thought regarding dial-up modems. <para>There are two schools of thought regarding dial-up modems.
One confiuration method is to set the modems and One confiuration method is to set the modems and systems so
systems so that no matter at what speed a remote user dials that no matter at what speed a remote user dials in, the
in, the dial-in <acronym>RS-232</acronym> dial-in <acronym>RS-232</acronym> interface runs at a locked
interface runs at a speed. The benefit of this configuration is that the remote
locked speed. The benefit of this configuration is that the user always sees a system login prompt immediately. The
remote user always sees a system login prompt immediately. downside is that the system does not know what a user's true
The downside is that the system does not know what a user's data rate is, so full-screen programs like
true data rate is, so full-screen programs like
<application>Emacs</application> will not adjust their <application>Emacs</application> will not adjust their
screen-painting methods to make their response better for screen-painting methods to make their response better for
slower connections.</para> slower connections.</para>
<para>The second method is to configure the <acronym>RS-232</acronym> interface <para>The second method is to configure the
to vary its speed based on the remote user's connection speed. <acronym>RS-232</acronym> interface to vary its speed based on
Because the remote user's connection speed. Because
<command>getty</command> does not understand any particular <command>getty</command> does not understand any particular
modem's connection speed reporting, it modem's connection speed reporting, it gives a
gives a <prompt>login:</prompt> message at an initial speed <prompt>login:</prompt> message at an initial speed and
and watches the characters that come back in response. If the watches the characters that come back in response. If the
user sees junk, they should press user sees junk, they should press <keycap>Enter</keycap> until
<keycap>Enter</keycap> until they see a recognizable prompt. they see a recognizable prompt. If the data rates do not
If the data rates do not match, <command>getty</command> sees match, <command>getty</command> sees anything the user types
anything the user types as junk, tries as junk, tries the next speed, and gives the
the next speed, and gives the <prompt>login:</prompt> prompt <prompt>login:</prompt> prompt again. This procedure normally
again. This procedure normally only takes a keystroke or two only takes a keystroke or two before the user sees a good
before the user sees a good prompt. This login sequence does prompt. This login sequence does not look as clean as the
not look as clean as the locked-speed method, locked-speed method, but a user on a low-speed connection
but a user on a low-speed connection should receive better should receive better interactive response from full-screen
interactive response from full-screen programs.</para> programs.</para>
<para>When locking a modem's data communications rate at a <para>When locking a modem's data communications rate at a
particular speed, no changes to particular speed, no changes to
<filename>/etc/gettytab</filename> should be needed. <filename>/etc/gettytab</filename> should be needed. However,
However, for a matching-speed for a matching-speed configuration, additional entries may be
configuration, additional entries may be required in required in order to define the speeds to use for the modem.
order to define the speeds to use This example configures a 14.4&nbsp;Kbps modem with a top
for the modem. This example configures a interface speed of 19.2&nbsp;Kbps using 8-bit, no parity
14.4&nbsp;Kbps modem with a top interface speed of connections. It configures <command>getty</command> to start
19.2&nbsp;Kbps using 8-bit, no parity connections. It the communications rate for a V.32bis connection at
configures <command>getty</command> to start the 19.2&nbsp;Kbps, then cycles through 9600&nbsp;bps,
communications rate for a V.32bis connection at 2400&nbsp;bps, 1200&nbsp;bps, 300&nbsp;bps, and back to
19.2&nbsp;Kbps, then cycles 19.2&nbsp;Kbps. Communications rate cycling is implemented
through 9600&nbsp;bps, 2400&nbsp;bps, with the <literal>nx=</literal> (next table) capability. Each
1200&nbsp;bps, 300&nbsp;bps, and back to 19.2&nbsp;Kbps. line uses a <literal>tc=</literal> (table continuation) entry
Communications rate cycling is implemented with the to pick up the rest of the settings for a particular data
<literal>nx=</literal> (next table) rate.</para>
capability. Each line uses a
<literal>tc=</literal> (table continuation)
entry to pick up the rest of the
settings for a particular data rate.</para>
<programlisting># <programlisting>#
# Additions for a V.32bis Modem # Additions for a V.32bis Modem
@ -1165,51 +1154,48 @@ vp|VH9600|Very High Speed Modem at 9600,8-bit:\
vq|VH57600|Very High Speed Modem at 57600,8-bit:\ vq|VH57600|Very High Speed Modem at 57600,8-bit:\
:nx=VH9600:tc=std.57600:</programlisting> :nx=VH9600:tc=std.57600:</programlisting>
<para>For a slow <acronym>CPU</acronym> or a heavily loaded system without <para>For a slow <acronym>CPU</acronym> or a heavily loaded
16550A-based serial ports, this configuration may produce system without 16550A-based serial ports, this configuration
<errorname>sio</errorname> may produce <errorname>sio</errorname>
<quote>silo</quote> errors at 57.6&nbsp;Kbps.</para> <quote>silo</quote> errors at 57.6&nbsp;Kbps.</para>
<indexterm> <indexterm>
<primary><filename>/etc/ttys</filename></primary> <primary><filename>/etc/ttys</filename></primary>
</indexterm> </indexterm>
<para>The configuration of <filename>/etc/ttys</filename> <para>The configuration of <filename>/etc/ttys</filename> is
is similar to <xref linkend="ex-etc-ttys"/>, similar to <xref linkend="ex-etc-ttys"/>, but a different
but a different
argument is passed to <command>getty</command> and argument is passed to <command>getty</command> and
<literal>dialup</literal> is used for the terminal type. <literal>dialup</literal> is used for the terminal type.
Replace Replace <replaceable>xxx</replaceable> with the process
<replaceable>xxx</replaceable> with the process
<command>init</command> will run on the device:</para> <command>init</command> will run on the device:</para>
<programlisting>ttyu0 "/usr/libexec/getty <replaceable>xxx</replaceable>" dialup on</programlisting> <programlisting>ttyu0 "/usr/libexec/getty <replaceable>xxx</replaceable>" dialup on</programlisting>
<para>The <literal>dialup</literal> terminal type can be <para>The <literal>dialup</literal> terminal type can be
changed. For example, setting <literal>vt102</literal> as the changed. For example, setting <literal>vt102</literal> as the
default terminal type allows users to use <acronym>VT102</acronym> emulation on default terminal type allows users to use
their remote systems.</para> <acronym>VT102</acronym> emulation on their remote
systems.</para>
<para>For a locked-speed configuration, specify the speed with <para>For a locked-speed configuration, specify the speed with
a valid type listed in a valid type listed in <filename>/etc/gettytab</filename>.
<filename>/etc/gettytab</filename>.
This example is for a modem whose port speed is locked at This example is for a modem whose port speed is locked at
19.2&nbsp;Kbps:</para> 19.2&nbsp;Kbps:</para>
<programlisting>ttyu0 "/usr/libexec/getty std.<replaceable>19200</replaceable>" dialup on</programlisting> <programlisting>ttyu0 "/usr/libexec/getty std.<replaceable>19200</replaceable>" dialup on</programlisting>
<para>In a matching-speed configuration, the <para>In a matching-speed configuration, the entry needs to
entry needs to reference the reference the appropriate beginning <quote>auto-baud</quote>
appropriate beginning <quote>auto-baud</quote> entry in entry in <filename>/etc/gettytab</filename>. To continue the
<filename>/etc/gettytab</filename>. To continue the example example for a matching-speed modem that starts at
for a matching-speed modem that 19.2&nbsp;Kbps, use this entry:</para>
starts at 19.2&nbsp;Kbps, use this entry:</para>
<programlisting>ttyu0 "/usr/libexec/getty V19200" dialup on</programlisting> <programlisting>ttyu0 "/usr/libexec/getty V19200" dialup on</programlisting>
<para>After editing <filename>/etc/ttys</filename>, wait until <para>After editing <filename>/etc/ttys</filename>, wait until
the modem is properly configured and the modem is properly configured and connected before
connected before signaling <command>init</command>:</para> signaling <command>init</command>:</para>
<screen>&prompt.root; <userinput>kill -HUP 1</userinput></screen> <screen>&prompt.root; <userinput>kill -HUP 1</userinput></screen>
@ -1219,14 +1205,12 @@ vq|VH57600|Very High Speed Modem at 57600,8-bit:\
</indexterm> </indexterm>
<para>High-speed modems, like <acronym>V.32</acronym>, <para>High-speed modems, like <acronym>V.32</acronym>,
<acronym>V.32bis</acronym>, and <acronym>V.34</acronym> modems, <acronym>V.32bis</acronym>, and <acronym>V.34</acronym>
use hardware (<literal>RTS/CTS</literal>) flow modems, use hardware (<literal>RTS/CTS</literal>) flow
control. Use <command>stty</command> to set the control. Use <command>stty</command> to set the hardware flow
hardware flow control flag for the modem control flag for the modem port. This example sets the
port. This example sets the <varname>crtscts</varname> flag on <filename>COM2</filename>'s
<varname>crtscts</varname> flag on dial-in and dial-out initialization devices:</para>
<filename>COM2</filename>'s dial-in and dial-out
initialization devices:</para>
<screen>&prompt.root; <userinput>stty -f /dev/ttyu1.init crtscts</userinput> <screen>&prompt.root; <userinput>stty -f /dev/ttyu1.init crtscts</userinput>
&prompt.root; <userinput>stty -f /dev/cuau1.init crtscts</userinput></screen> &prompt.root; <userinput>stty -f /dev/cuau1.init crtscts</userinput></screen>
@ -1365,10 +1349,10 @@ AT&amp;B2&amp;W</programlisting>
modem's current operating parameters in a somewhat modem's current operating parameters in a somewhat
human-readable fashion. On the &usrobotics; &sportster; human-readable fashion. On the &usrobotics; &sportster;
14,400 external modem, <command>ATI5</command> displays the 14,400 external modem, <command>ATI5</command> displays the
settings that are stored in the non-volatile RAM. To see settings that are stored in the non-volatile RAM. To see the
the true operating parameters of the modem, as influenced by true operating parameters of the modem, as influenced by the
the modem's DIP switch settings, use <command>ATZ</command> modem's DIP switch settings, use <command>ATZ</command> and
and then <command>ATI4</command>.</para> then <command>ATI4</command>.</para>
<para>For a different brand of modem, check the modem's manual <para>For a different brand of modem, check the modem's manual
to see how to double-check the modem's configuration to see how to double-check the modem's configuration