aboutsummaryrefslogtreecommitdiff
path: root/zh_CN.GB2312/books/handbook/serialcomms/chapter.xml
diff options
context:
space:
mode:
Diffstat (limited to 'zh_CN.GB2312/books/handbook/serialcomms/chapter.xml')
-rw-r--r--zh_CN.GB2312/books/handbook/serialcomms/chapter.xml343
1 files changed, 157 insertions, 186 deletions
diff --git a/zh_CN.GB2312/books/handbook/serialcomms/chapter.xml b/zh_CN.GB2312/books/handbook/serialcomms/chapter.xml
index ba51638920..25b5472cd5 100644
--- a/zh_CN.GB2312/books/handbook/serialcomms/chapter.xml
+++ b/zh_CN.GB2312/books/handbook/serialcomms/chapter.xml
@@ -6,11 +6,10 @@
Original Revision: 1.136
$FreeBSD$
-->
-
-<chapter id="serialcomms">
+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:id="serialcomms">
<title>串口通讯</title>
- <sect1 id="serial-synopsis">
+ <sect1 xml:id="serial-synopsis">
<title>概述</title>
<indexterm><primary>串口通讯</primary></indexterm>
@@ -42,12 +41,10 @@
<itemizedlist>
<listitem>
- <para>如何配置和安装一个新的内核 (<xref
- linkend="kernelconfig"/>)。</para>
+ <para>如何配置和安装一个新的内核 (<xref linkend="kernelconfig"/>)。</para>
</listitem>
<listitem>
- <para>理解 &unix; 的权限和进程 (<xref
- linkend="basics"/>)。</para>
+ <para>理解 &unix; 的权限和进程 (<xref linkend="basics"/>)。</para>
</listitem>
<listitem>
<para>准备您打算在 FreeBSD 中使用的串口设备
@@ -56,21 +53,21 @@
</itemizedlist>
</sect1>
- <sect1 id="serial">
+ <sect1 xml:id="serial">
<title>介绍</title>
<warning>
<para>从 &os; 8.0 开始, 用于串口的设备节点从
- <filename>/dev/cuad<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/cuau<replaceable>N</replaceable></filename>;
+ <filename>/dev/cuadN</filename> 改为了
+ <filename>/dev/cuauN</filename>;
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 改为了
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户需要根据实际情况对这份文档中的例子进行必要的调整。</para>
</warning>
<!-- XXX Write me! -->
- <sect2 id="serial-terminology">
+ <sect2 xml:id="serial-terminology">
<title>术语</title>
<variablelist>
@@ -116,21 +113,21 @@
(至少它不会打扰那些爱争吵的家伙)。</para>
</sect2>
- <sect2 id="serial-cables-ports">
+ <sect2 xml:id="serial-cables-ports">
<title>线缆和端口</title>
<para>要将 modem 或终端与您的 FreeBSD 系统相连,
您的计算机需要一个串口, 以及用于连接串口设备所需的线缆。
如果您比较熟悉硬件及所需要的电缆, 则可以跳过这节。</para>
- <sect3 id="term-cables">
+ <sect3 xml:id="term-cables">
<title>线缆</title>
<para>串口线缆有许多不同的种类。 最常见的两种类型是 null-modem
线缆和标准 (<quote>直联</quote>) RS-232 线缆。
您的硬件说明书中会介绍应使用的线缆种类。</para>
- <sect4 id="term-cables-null">
+ <sect4 xml:id="term-cables-null">
<title>Null-modem线缆</title>
<indexterm>
@@ -158,7 +155,7 @@
<row>
<entry align="left">信号</entry>
<entry align="left">引脚 #</entry>
- <entry></entry>
+ <entry/>
<entry align="left">引脚 #</entry>
<entry align="left">信号</entry>
</row>
@@ -250,7 +247,7 @@
<row>
<entry align="left">信号</entry>
<entry align="left">引脚 #</entry>
- <entry></entry>
+ <entry/>
<entry align="left">引脚 #</entry>
<entry align="left">信号</entry>
</row>
@@ -340,7 +337,7 @@
<row>
<entry align="left">信号</entry>
<entry align="left">引脚 #</entry>
- <entry></entry>
+ <entry/>
<entry align="left">引脚 #</entry>
<entry align="left">信号</entry>
</row>
@@ -434,7 +431,7 @@
CTS 接 DCD、 DTR 接 DSR, 反之亦然。</para>
</sect4>
- <sect4 id="term-cables-std">
+ <sect4 xml:id="term-cables-std">
<title>标准RS-232C线缆</title>
<indexterm><primary>RS-232C cables</primary></indexterm>
@@ -446,13 +443,13 @@
</sect4>
</sect3>
- <sect3 id="term-ports">
+ <sect3 xml:id="term-ports">
<title>端口</title>
<para>串口是FreeBSD主机与终端传输数据的设备。
这节描述了端口的种类和它们在 FreeBSD 上是如何编址的。</para>
- <sect4 id="term-portkinds">
+ <sect4 xml:id="term-portkinds">
<title>端口的种类</title>
<para>有好几种串口。 在采购或制作线缆之前,
@@ -467,7 +464,7 @@
此外, 您也可以通过观察外观来了解所用的端口。</para>
</sect4>
- <sect4 id="term-portnames">
+ <sect4 xml:id="term-portnames">
<title>端口名称Port Names</title>
<para>在FreeBSD中,您可以通过 <filename>/dev</filename>
@@ -476,7 +473,7 @@
<itemizedlist>
<listitem>
<para>呼入端口的名字是
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>,
+ <filename>/dev/ttyuN</filename>,
其中 <replaceable>N</replaceable> 是端口的编号,
从零开始计数。 一般来说,
您使用呼入端口作为终端。 呼入端口要求数据线使用载波检测
@@ -485,7 +482,7 @@
<listitem>
<para>呼出端口的名字是
- <filename>/dev/cuau<replaceable>N</replaceable></filename>。
+ <filename>/dev/cuauN</filename>。
通常并不使用呼出端口作为终端, 而只用于调制解调器。
如果串口线或终端不支持载波检测信号,
则可能必须要使用呼出端口。</para>
@@ -493,9 +490,9 @@
</itemizedlist>
<para>如果您已经连接一个终端到第一个串口 (在 &ms-dos;
- 上是<devicename>COM1</devicename>),
+ 上是<filename>COM1</filename>),
则可以使用 <filename>/dev/ttyu0</filename> 来作为终端。
- 如果它是在第二个串口 (<devicename>COM2</devicename>),
+ 如果它是在第二个串口 (<filename>COM2</filename>),
那就是 <filename>/dev/ttyu1</filename>,等等。</para>
</sect4>
@@ -506,11 +503,11 @@
<title>内核配置</title>
<para>FreeBSD默认支持4个串口。 在&ms-dos;下,这些是
- <devicename>COM1</devicename>,
- <devicename>COM2</devicename>,
- <devicename>COM3</devicename>,
+ <filename>COM1</filename>,
+ <filename>COM2</filename>,
+ <filename>COM3</filename>,
- <devicename>COM4</devicename>。 FreeBSD 目前支持 <quote>dumb</quote>
+ <filename>COM4</filename>。 FreeBSD 目前支持 <quote>dumb</quote>
多口串口卡,如 BocaBoard 1008 和 2016, 以及许多 Digiboard
和 Stallion Technologies 制造的智能多接口卡。 不过,
默认的内核只会寻找标准的COM端口。</para>
@@ -563,15 +560,15 @@ sio3: type 16550A</screen>
<para>在内核中, 大多数设备都是通过 <quote>设备特殊文件</quote> 来访问的,
这些文件一般位于 <filename>/dev</filename> 目录中。
- <devicename>sio</devicename> 是通过
- <filename>/dev/ttyu<replaceable>N</replaceable></filename> (呼入)
- 和 <filename>/dev/cuau<replaceable>N</replaceable></filename>
+ <filename>sio</filename> 是通过
+ <filename>/dev/ttyuN</filename> (呼入)
+ 和 <filename>/dev/cuauN</filename>
(呼出) 设备来访问的。 此外, FreeBSD 也提供了初始化设备
- (<filename>/dev/ttyu<replaceable>N</replaceable>.init</filename> 和
- <filename>/dev/cuau<replaceable>N</replaceable>.init</filename>)
+ (<filename>/dev/ttyuN.init</filename> 和
+ <filename>/dev/cuauN.init</filename>)
以及锁设备
- (<filename>/dev/ttyu<replaceable>N</replaceable>.lock</filename> 和
- <filename>/dev/cuau<replaceable>N</replaceable>.lock</filename>)。
+ (<filename>/dev/ttyuN.lock</filename> 和
+ <filename>/dev/cuauN.lock</filename>)。
初始化设备用于在打开端口时初始化其通讯参数, 例如使用
<literal>RTS/CTS</literal> 信号进行流控制的调制解调器的
<literal>crtscts</literal>。 锁设备则用于在端口上提供一个锁标志,
@@ -581,14 +578,14 @@ sio3: type 16550A</screen>
</sect2>
- <sect2 id="serial-hw-config">
+ <sect2 xml:id="serial-hw-config">
<title>串口配置</title>
- <indexterm><primary><devicename>ttyu</devicename></primary></indexterm>
- <indexterm><primary><devicename>cuau</devicename></primary></indexterm>
+ <indexterm><primary><filename>ttyu</filename></primary></indexterm>
+ <indexterm><primary><filename>cuau</filename></primary></indexterm>
- <para><devicename>ttyu<replaceable>N</replaceable></devicename> (或
- <devicename>cuau<replaceable>N</replaceable></devicename>)
+ <para><filename>ttyuN</filename> (或
+ <filename>cuauN</filename>)
设备是您将要打开的应用程序的一般设备。 当进程打开某个设备时,
它将有一个终端 I/O 设置的默认配置。 您可以在命令行看看这些设置:</para>
@@ -597,7 +594,7 @@ sio3: type 16550A</screen>
<para>当您修改了这个设备的设置,这个设置会生效,除非设备被关闭。
当它被重新打开时,它将回到默认设置。 要修改默认设置,您可以打开和调整
<quote>初始状态</quote> 设备的设置。例如,
- 要为<devicename>ttyu5</devicename> 打开
+ 要为<filename>ttyu5</filename> 打开
<option>CLOCAL</option> 模式,8位通讯和默认的 <option>XON/XOFF</option> 流控制,
输入:</para>
@@ -614,39 +611,35 @@ sio3: type 16550A</screen>
<para>为了防止应用程序修改某些设置,
应修改 <quote>lock state</quote>(锁状态) 设备。 例如, 要把
- <devicename>ttyu5</devicename> 的速率锁定为 57600&nbsp;bps, 输入:</para>
+ <filename>ttyu5</filename> 的速率锁定为 57600&nbsp;bps, 输入:</para>
<screen>&prompt.root; <userinput>stty -f /dev/ttyu5.lock 57600</userinput></screen>
- <para>现在,一个打开<devicename>ttyu5</devicename>
+ <para>现在,一个打开<filename>ttyu5</filename>
和设法改变端口速度的应用程序将被固定在57600bit/s。很自然地,
您需要确定初始状态,然后用root帐户锁定状态设备的写入功能。</para>
- <para>很显然,您应该只让 <username>root</username>
+ <para>很显然,您应该只让 <systemitem class="username">root</systemitem>
用户可以初始化或锁定设备的状态。</para>
</sect2>
</sect1>
- <sect1 id="term">
- <sect1info>
+ <sect1 xml:id="term">
+ <info><title>终端</title>
<authorgroup>
- <author>
- <firstname>Sean</firstname>
- <surname>Kelly</surname>
- <contrib>Contributed by </contrib>
- </author>
+ <author><personname><firstname>Sean</firstname><surname>Kelly</surname></personname><contrib>Contributed by </contrib></author>
<!-- 28 July 1996 -->
</authorgroup>
- </sect1info>
- <title>终端</title>
+ </info>
+
<warning>
<para>从 &os; 8.0 开始, 用于串口的设备节点从
- <filename>/dev/cuad<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/cuau<replaceable>N</replaceable></filename>;
+ <filename>/dev/cuadN</filename> 改为了
+ <filename>/dev/cuauN</filename>;
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 改为了
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户需要根据实际情况对这份文档中的例子进行必要的调整。</para>
</warning>
@@ -656,7 +649,7 @@ sio3: type 16550A</screen>
终端提供了一个方便和低成本的访问 FreeBSD 系统的方法。
这节描述了如何在 FreeBSD 上使用终端。</para>
- <sect2 id="term-uses">
+ <sect2 xml:id="term-uses">
<title>终端的用法和类型</title>
<para>早期的 &unix; 系统没有控制台。
@@ -693,7 +686,7 @@ sio3: type 16550A</screen>
<para>下面一小节将描述每一种终端。</para>
- <sect3 id="term-dumb">
+ <sect3 xml:id="term-dumb">
<title>哑终端</title>
<para>哑终端需要专门的好几种硬件,让您通过串口线连接到计算机。
@@ -707,7 +700,7 @@ sio3: type 16550A</screen>
<para>哑终端被广泛用于那些不需要图形应用的工作中。</para>
</sect3>
- <sect3 id="term-pcs">
+ <sect3 xml:id="term-pcs">
<title>充当终端的PC</title>
<para>假如 <link linkend="term-dumb">哑终端</link> 的功能仅限于显示、
@@ -727,10 +720,10 @@ sio3: type 16550A</screen>
<para>如果要从运行 &os; 的计算机上通过串口连接到另一系统,
可以使用:</para>
- <screen>&prompt.root; <userinput>cu -l <replaceable>串口设备</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>cu -l 串口设备</userinput></screen>
<para>此处 <quote>串口设备</quote> 表示您计算机上某个串口对应的设备名。
- <devicename>/dev/cuau<replaceable>N</replaceable></devicename>。</para>
+ <filename>/dev/cuauN</filename>。</para>
<para>此处的 <quote>N</quote> 表示串口的编号。</para>
@@ -738,7 +731,7 @@ sio3: type 16550A</screen>
<para>请注意在 &os; 中设备的编号是从零而非一开始的
(这一点与另一些系统, 如基于 &ms-dos; 的系统不同)。
因此, 在基于 &ms-dos; 系统中的
- <devicename>COM1</devicename> 在 &os;
+ <filename>COM1</filename> 在 &os;
中通常叫做 <filename>/dev/cuau0</filename>。</para>
</note>
@@ -746,11 +739,11 @@ sio3: type 16550A</screen>
<para>其他一些人可能喜欢使用另一些来自 Ports 套件的程序。
Ports 中提供了几个与 &man.cu.1; 和
&man.tip.1; 类似的工具,
- 例如 <filename role="package">comms/minicom</filename>。</para>
+ 例如 <package>comms/minicom</package>。</para>
</note>
</sect3>
- <sect3 id="term-x">
+ <sect3 xml:id="term-x">
<title>X 终端</title>
<para>X终端是最复杂的终端系统。它们通常需要使用以太网来连接。
@@ -761,7 +754,7 @@ sio3: type 16550A</screen>
</sect3>
</sect2>
- <sect2 id="term-config">
+ <sect2 xml:id="term-config">
<title>配置</title>
<para>这节描述了您在一个终端上启用一个登录会话时, 需要在 FreeBSD
@@ -777,7 +770,7 @@ sio3: type 16550A</screen>
<command>login</command>程序。</para>
<para>然而,要为您的FreeBSD系统配置终端,您需要以
- <username>root</username> 身份执行下面的步骤:</para>
+ <systemitem class="username">root</systemitem> 身份执行下面的步骤:</para>
<procedure>
<step>
@@ -816,26 +809,26 @@ sio3: type 16550A</screen>
您可以参考 &man.gettytab.5; 和 &man.getty.8;
的联机手册了解更多信息。</para>
- <sect3 id="term-etcttys">
+ <sect3 xml:id="term-etcttys">
<title>添加一个记录到<filename>/etc/ttys</filename></title>
<para><filename>/etc/ttys</filename>文件列出了您
FreeBSD系统上允许登录的所有端口。 例如, 第一个虚拟控制台
- <devicename>ttyv0</devicename> 在这个文件中有一个记录。
+ <filename>ttyv0</filename> 在这个文件中有一个记录。
您可以使用这个记录登录进控制台。
这个文件也包含其他虚拟控制台的记录,串口,和伪 ttys 终端。
对于一个硬连线的终端, 只要列出串口的
<filename>/dev</filename> 记录而不需要
<filename>/dev</filename> 部分 (例如,
<filename>/dev/ttyv0</filename> 可以被列为
- <devicename>ttyv0</devicename>)。</para>
+ <filename>ttyv0</filename>)。</para>
<para>默认的 FreeBSD 安装包括一个支持最初四个串口
- <devicename>ttyu0</devicename> 到 <devicename>ttyu3</devicename>
+ <filename>ttyu0</filename> 到 <filename>ttyu3</filename>
的<filename>/etc/ttys</filename> 文件。
如果您从那些端口中某一个使用终端,您不需要添加另一个记录。</para>
- <example id="ex-etc-ttys">
+ <example xml:id="ex-etc-ttys">
<title>在
<filename>/etc/ttys</filename> 中增加终端记录</title>
@@ -844,12 +837,7 @@ sio3: type 16550A</screen>
VT-100 终端的286IBM PC。 在 <filename>/etc/ttys</filename>
文件中的相应的记录是这样的:</para>
- <programlisting>ttyu1<co
- id="co-ttys-line1col1"/> "/usr/libexec/getty std.38400"<co
- id="co-ttys-line1col2"/> wy50<co
- id="co-ttys-line1col3"/> on<co
- id="co-ttys-line1col4"/> insecure<co
- id="co-ttys-line1col5"/>
+ <programlisting>ttyu1<co xml:id="co-ttys-line1col1"/> "/usr/libexec/getty std.38400"<co xml:id="co-ttys-line1col2"/> wy50<co xml:id="co-ttys-line1col3"/> on<co xml:id="co-ttys-line1col4"/> insecure<co xml:id="co-ttys-line1col5"/>
ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
</programlisting>
@@ -905,9 +893,9 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
<callout arearefs="co-ttys-line1col5">
<para>最后部分被用来指定端口是否安全。
- 标记一个安全的端口意味着您信任它允许用 <username>root</username>
+ 标记一个安全的端口意味着您信任它允许用 <systemitem class="username">root</systemitem>
帐户从那个端口登录。 不安全的端口不允许
- <username>root</username>登录。 在一个不安全的端口上,
+ <systemitem class="username">root</systemitem>登录。 在一个不安全的端口上,
用户必须用无特权的帐户登录, 然后使用
<command>su</command> 或一个相似的机制来获得超级用户的权限。</para>
</callout>
@@ -915,7 +903,7 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
</example>
</sect3>
- <sect3 id="term-hup">
+ <sect3 xml:id="term-hup">
<title>重新读取<filename>/etc/ttys</filename>来强制<command>init</command>
</title>
@@ -934,7 +922,7 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
</sect3>
</sect2>
- <sect2 id="term-debug">
+ <sect2 xml:id="term-debug">
<title>您的连接可能出现的问题</title>
<para>即使您小心翼翼地注意细节,您仍然可能会在设置终端时出错。
@@ -960,7 +948,7 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
<screen>&prompt.root; <userinput>ps -axww|grep getty</userinput></screen>
<para>您将看到一个终端的记录。例如,下面的显示表明一个<command>getty</command>
- 正在第二个串口 <devicename>ttyu1</devicename> 运行,
+ 正在第二个串口 <filename>ttyu1</filename> 运行,
正在 <filename>/etc/gettytab</filename> 中使用 <literal>std.38400</literal>
的记录:</para>
@@ -1008,32 +996,24 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
</sect2>
</sect1>
- <sect1 id="dialup">
- <sect1info>
+ <sect1 xml:id="dialup">
+ <info><title>拨入服务</title>
<authorgroup>
- <author>
- <firstname>Guy</firstname>
- <surname>Helmer</surname>
- <contrib>Contributed by </contrib>
- </author>
+ <author><personname><firstname>Guy</firstname><surname>Helmer</surname></personname><contrib>Contributed by </contrib></author>
</authorgroup>
<authorgroup>
- <author>
- <firstname>Sean</firstname>
- <surname>Kelly</surname>
- <contrib>Additions by </contrib>
- </author>
+ <author><personname><firstname>Sean</firstname><surname>Kelly</surname></personname><contrib>Additions by </contrib></author>
</authorgroup>
- </sect1info>
- <title>拨入服务</title>
+ </info>
+
<warning>
<para>从 &os; 8.0 开始, 用于串口的设备节点从
- <filename>/dev/cuad<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/cuau<replaceable>N</replaceable></filename>;
+ <filename>/dev/cuadN</filename> 改为了
+ <filename>/dev/cuauN</filename>;
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 改为了
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户需要根据实际情况对这份文档中的例子进行必要的调整。</para>
</warning>
@@ -1062,7 +1042,7 @@ ttyu5 "/usr/libexec/getty std.19200" vt100 on insecure
<para>如果您使用一个外置的 modem,那您将需要适当的电缆线。
一个标准的串口线应当足够长以至普通的信号能够连接上:</para>
- <table frame="none" pgwide="1" id="serialcomms-signal-names">
+ <table frame="none" pgwide="1" xml:id="serialcomms-signal-names">
<title>信号名称</title>
<tgroup cols="2">
@@ -1303,7 +1283,7 @@ vq|VH57600|Very High Speed Modem at 57600,8-bit:\
</sect4>
</sect3>
- <sect3 id="dialup-ttys">
+ <sect3 xml:id="dialup-ttys">
<title><filename>/etc/ttys</filename></title>
<indexterm>
<primary><filename>/etc/ttys</filename></primary>
@@ -1317,11 +1297,11 @@ vq|VH57600|Very High Speed Modem at 57600,8-bit:\
<programlisting>ttyu0 "/usr/libexec/getty <replaceable>xxx</replaceable>" dialup on</programlisting>
<para>上面的第一条是这个记录的设备特定文件 &mdash;
- <devicename>ttyu0</devicename> 表示
+ <filename>ttyu0</filename> 表示
<filename>/dev/ttyu0</filename>
是这个 <command>getty</command> 将被监视的文件。 第二条
<literal>"/usr/libexec/getty
- <replaceable>xxx</replaceable>"</literal>
+ xxx"</literal>
是将运行在设备上的进程 <command>init</command>。
第三条,dialup,是默认的终端类型。 第四个参数,
<literal>on</literal>, 指出了线路是可操作的
@@ -1390,7 +1370,7 @@ vq|VH57600|Very High Speed Modem at 57600,8-bit:\
为调制解调器设置硬件流控制标志。</para>
<para>例如, 在 1 号串口
- (<devicename>COM2</devicename>) 拨入和拨出设备上配置 <literal>termios</literal> 标志
+ (<filename>COM2</filename>) 拨入和拨出设备上配置 <literal>termios</literal> 标志
<varname>crtscts</varname>, 可以通过在
<filename>/etc/rc.d/serial</filename> 增加下面的设置来实现:</para>
<programlisting># Serial port initial configuration
@@ -1567,14 +1547,14 @@ AT&amp;B2&amp;W</programlisting>
因为 <command>getty</command> 无法打开通讯端口。</para>
<para>如果您没有看到任何 <command>getty</command> 进程等待打开想要的
- <devicename>ttyu<replaceable>N</replaceable></devicename> 端口,
+ <filename>ttyuN</filename> 端口,
在 <filename>/etc/ttys</filename> 中双击您的记录看看那儿是否有错误。
另外,检查日志文件 <filename>/var/log/messages</filename>
看看是否有一些来自 <command>init</command> 或
<command>getty</command> 的问题日志。 如果有任何信息,
仔细检查配置文件 <filename>/etc/ttys</filename> 和
<filename>/etc/gettytab</filename>,还有相应的设备文件
- <devicename>/dev/ttyu<replaceable>N</replaceable></devicename>,
+ <filename>/dev/ttyuN</filename>,
是否有错误,丢失记录,或丢失了设备指定文件。</para>
</sect3>
@@ -1619,16 +1599,16 @@ AT&amp;B2&amp;W</programlisting>
</sect1>
- <sect1 id="dialout">
+ <sect1 xml:id="dialout">
<title>拨出设备</title>
<warning>
<para>从 &os; 8.0 开始, 用于串口的设备节点从
- <filename>/dev/cuad<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/cuau<replaceable>N</replaceable></filename>;
+ <filename>/dev/cuadN</filename> 改为了
+ <filename>/dev/cuauN</filename>;
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 改为了
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户需要根据实际情况对这份文档中的例子进行必要的调整。</para>
</warning>
@@ -1643,7 +1623,7 @@ AT&amp;B2&amp;W</programlisting>
上下载一个文件。 如果您必须 FTP 一些东西, 而 PPP 断了,
使用终端会话来 FTP 它们。 然后使用 zmodem 来把它们传输到您的机器上。</para>
- <sect2 id="hayes-unsupported">
+ <sect2 xml:id="hayes-unsupported">
<title>我的Stock Hayes Modem不被支持,我该怎么办?</title>
<para>事实上, 联机手册对于这个的描述已经过时了。 一个通用的
@@ -1661,7 +1641,7 @@ AT&amp;B2&amp;W</programlisting>
试试 <command>ATS7=45&amp;W</command>。</para>
</sect2>
- <sect2 id="direct-at">
+ <sect2 xml:id="direct-at">
<title>我如何输入这些 AT 命令?</title>
<indexterm>
@@ -1677,10 +1657,10 @@ AT&amp;B2&amp;W</programlisting>
<para>此处应使用您的 modem 所支持的最高 br bps 速率。
接下来, 输入 <command>tip cuau0</command> 就可以连到 modem 上了。</para>
- <para>此外, 也可以 <username>root</username> 身份执行 <command>cu</command>
+ <para>此外, 也可以 <systemitem class="username">root</systemitem> 身份执行 <command>cu</command>
命令:</para>
- <screen>&prompt.root; <userinput>cu -l<replaceable>line</replaceable> -s<replaceable>speed</replaceable></userinput></screen>
+ <screen>&prompt.root; <userinput>cu -lline -sspeed</userinput></screen>
<para><replaceable>line</replaceable> 是串口
(例如 <filename>/dev/cuau0</filename>) 而
@@ -1689,7 +1669,7 @@ AT&amp;B2&amp;W</programlisting>
之后, 按 <command>~.</command> 即可退出。</para>
</sect2>
- <sect2 id="gt-failure">
+ <sect2 xml:id="gt-failure">
<title>现在pn <literal>@</literal>标记不能工作?</title>
<para>在电话号码中的 <literal>@</literal> 标记告诉计算机在
@@ -1700,7 +1680,7 @@ AT&amp;B2&amp;W</programlisting>
<programlisting>pn=\@</programlisting>
</sect2>
- <sect2 id="dial-command-line">
+ <sect2 xml:id="dial-command-line">
<title>我如何在命令行拨电话号码?</title>
<para>在您的 <filename>/etc/remote</filename> 文件中通常放着一个叫做
@@ -1725,7 +1705,7 @@ tip57600|Dial any phone number at 57600 bps:\
<screen>&prompt.root; <userinput>cu 5551234 -s 115200</userinput></screen>
</sect2>
- <sect2 id="set-bps">
+ <sect2 xml:id="set-bps">
<title>这么做时是否每次都需要重新输入 bps 速率?</title>
<para>添加一项 <literal>tip1200</literal> 或
@@ -1735,11 +1715,11 @@ tip57600|Dial any phone number at 57600 bps:\
虽然您并不需要使用 1200&nbsp;bps。</para>
</sect2>
- <sect2 id="terminal-server">
+ <sect2 xml:id="terminal-server">
<title>我通过一个终端服务器访问了很多主机。</title>
<para>除非每次都要等到您连接到主机然后键入
- <command>CONNECT <replaceable>host</replaceable></command>,
+ <command>CONNECT host</command>,
否则使用 <command>tip</command> 的 <literal>cm</literal> 功能。
例如, 在 <filename>/etc/remote</filename> 中的这些记录:</para>
@@ -1751,12 +1731,12 @@ deep13:Gizmonics Institute terminal server:\
:dv=/dev/cuau2:br#38400:at=hayes:du:pa=none:pn=5551234:</programlisting>
<para>将让您键入 <command>tip pain</command> 或 <command>tip
- muffin</command> 连接到主机 <hostid>pain</hostid> 或
- <hostid>muffin</hostid>, 和 <command>tip deep13</command>
+ muffin</command> 连接到主机 <systemitem>pain</systemitem> 或
+ <systemitem>muffin</systemitem>, 和 <command>tip deep13</command>
连接到终端服务器。</para>
</sect2>
- <sect2 id="tip-multiline">
+ <sect2 xml:id="tip-multiline">
<title><command>tip</command>能为每个站点试用多个线路吗?</title>
<para>经常有一个问题, 一个大学有几个modem线路, 几千个学生设法使用它们。</para>
@@ -1781,7 +1761,7 @@ big-university 5551114</programlisting>
如果想继续测试, 隔一段时间再运行 <command>tip</command>。</para>
</sect2>
- <sect2 id="multi-controlp">
+ <sect2 xml:id="multi-controlp">
<title>为什么我必须键入
<keycombo action="simul">
<keycap>Ctrl</keycap>
@@ -1799,7 +1779,7 @@ big-university 5551114</programlisting>
下一个字符是文字的数据。您可以用 <command>~s</command>
给任何其他的字符设置强制字符,这意思是 <quote>设置一个变量</quote>。</para>
- <para>在新的一行键入 <command>~sforce=<replaceable>single-char</replaceable></command>。
+ <para>在新的一行键入 <command>~sforce=single-char</command>。
<replaceable>single-char</replaceable> 是任何简单的字符。 如果您遗漏了
<replaceable>single-char</replaceable>, 那强制字符就是空字符,
这可以键入
@@ -1823,7 +1803,7 @@ big-university 5551114</programlisting>
<programlisting>force=<replaceable>single-char</replaceable></programlisting>
</sect2>
- <sect2 id="uppercase">
+ <sect2 xml:id="uppercase">
<title>突然我键入的每一样东西都变成了大写??</title>
<para>您一定是键入了
@@ -1857,7 +1837,7 @@ raisechar=^^</programlisting>
</sect2>
- <sect2 id="tip-filetransfer">
+ <sect2 xml:id="tip-filetransfer">
<title>如何用 <command>tip</command> 做文件传输?</title>
<para>如果您正在与另一台 &unix; 系统对话, 您可以用
@@ -1880,49 +1860,41 @@ raisechar=^^</programlisting>
<para>由于没有错误校验, 所以您需要使用其他协议, 如 zmodem。</para>
</sect2>
- <sect2 id="zmodem-tip">
+ <sect2 xml:id="zmodem-tip">
<title>我如何用<command>tip</command>运行zmodem?</title>
<para>要接收这些文件,可以在远程终端启动发送程序。然后,键入
<command>~C rz</command> 在本地开始接收它们。 要发送文件,
可以在远程终端启动接收程序。 然后, 键入 <command>~C sz
- <replaceable>files</replaceable></command>
+ files</command>
把它们发送到远程系统。</para>
</sect2>
</sect1>
- <sect1 id="serialconsole-setup">
- <sect1info>
+ <sect1 xml:id="serialconsole-setup">
+ <info><title>设置串口控制台</title>
<authorgroup>
- <author>
- <firstname>Kazutaka</firstname>
- <surname>YOKOTA</surname>
- <contrib>Contributed by </contrib>
- </author>
+ <author><personname><firstname>Kazutaka</firstname><surname>YOKOTA</surname></personname><contrib>Contributed by </contrib></author>
</authorgroup>
<authorgroup>
- <author>
- <firstname>Bill</firstname>
- <surname>Paul</surname>
- <contrib>Based on a document by </contrib>
- </author>
+ <author><personname><firstname>Bill</firstname><surname>Paul</surname></personname><contrib>Based on a document by </contrib></author>
</authorgroup>
- </sect1info>
- <title>设置串口控制台</title>
+ </info>
+
<warning>
<para>从 &os; 8.0 开始, 用于串口的设备节点从
- <filename>/dev/cuad<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/cuau<replaceable>N</replaceable></filename>;
+ <filename>/dev/cuadN</filename> 改为了
+ <filename>/dev/cuauN</filename>;
- <filename>/dev/ttyd<replaceable>N</replaceable></filename> 改为了
- <filename>/dev/ttyu<replaceable>N</replaceable></filename>。
+ <filename>/dev/ttydN</filename> 改为了
+ <filename>/dev/ttyuN</filename>。
&os;&nbsp;7.X 用户需要根据实际情况对这份文档中的例子进行必要的调整。</para>
</warning>
<indexterm><primary>serial console</primary></indexterm>
- <sect2 id="serialconsole-intro">
+ <sect2 xml:id="serialconsole-intro">
<title>介绍</title>
<para>FreeBSD可以通过一个串口只使用一个哑 (dumb) 终端就可以启动一个系统。
@@ -1938,7 +1910,7 @@ raisechar=^^</programlisting>
</sect2>
- <sect2 id="serialconsole-howto-fast">
+ <sect2 xml:id="serialconsole-howto-fast">
<title>串口控制台的配置, 简明版</title>
<para>这一节假定您使用默认的配置, 只希望迅速地获得关于配置串口控制台的概览。</para>
@@ -1946,7 +1918,7 @@ raisechar=^^</programlisting>
<procedure>
<step>
- <para>使用串口电缆连接 <devicename>COM1</devicename>
+ <para>使用串口电缆连接 <filename>COM1</filename>
和控制终端。</para>
</step>
@@ -1958,7 +1930,7 @@ raisechar=^^</programlisting>
<step>
<para>编辑 <filename>/etc/ttys</filename> 并把
- <devicename>ttyu0</devicename> 的
+ <filename>ttyu0</filename> 的
<literal>off</literal> 改为 <literal>on</literal>,
<literal>dialup</literal> 改为 <literal>vt100</literal>。
否则通过串口控制台上将不会提示输入口令,
@@ -1975,7 +1947,7 @@ raisechar=^^</programlisting>
<xref linkend="serialconsole-howto"/> 找到。</para>
</sect2>
- <sect2 id="serialconsole-howto">
+ <sect2 xml:id="serialconsole-howto">
<title>串口控制台的设置</title>
<procedure>
@@ -2021,20 +1993,20 @@ raisechar=^^</programlisting>
</step>
<step>
- <para>插一个哑 (dumb) 终端到<devicename>COM1</devicename>:(<devicename>sio0</devicename>)。</para>
+ <para>插一个哑 (dumb) 终端到<filename>COM1</filename>:(<filename>sio0</filename>)。</para>
<para>如果您没有哑终端, 可以使用一个比较老的带有一个 modem
程序的PC/XT机器, 或在其他 &unix; 机器上的串口。 如果您没有
- <devicename>COM1</devicename>: (<devicename>sio0</devicename>),
+ <filename>COM1</filename>: (<filename>sio0</filename>),
去找一个。 这时, 您就不能只能选择
- <devicename>COM1</devicename>:来启动系统。
- 如果您已经在另一台设备上使用 <devicename>COM1</devicename>,
+ <filename>COM1</filename>:来启动系统。
+ 如果您已经在另一台设备上使用 <filename>COM1</filename>,
您必须临时删除那个设备, 然后安装一个新的系统引导块和内核。</para>
</step>
<step>
- <para>确信您的内核配置文件已经为 <devicename>COM1</devicename>:
- (<devicename>sio0</devicename>) 设置了适当的标记:</para>
+ <para>确信您的内核配置文件已经为 <filename>COM1</filename>:
+ (<filename>sio0</filename>) 设置了适当的标记:</para>
<para>有关的标记是:</para>
@@ -2073,8 +2045,7 @@ raisechar=^^</programlisting>
<literal>0x10</literal>) 并让它不能用于普通的使用。
您不应在希望作为控制台的串口单元上设置这个标志。
这一标志是为内核远程调试准备的。
- 参见 <ulink
- url="&url.books.developers-handbook;/index.html">开发者手册</ulink>
+ 参见 <link xlink:href="&url.books.developers-handbook;/index.html">开发者手册</link>
以了解关于远程调试更进一步的情况。</para>
</listitem>
</varlistentry>
@@ -2242,13 +2213,13 @@ boot:</screen>
参考 <xref linkend="serialconsole-loader"/>。</para>
</sect2>
- <sect2 id="serialconsole-summary">
+ <sect2 xml:id="serialconsole-summary">
<title>摘要</title>
<para>这是几个在这章要讨论的几个设置和选择的控制台的摘要。</para>
<sect3>
- <title>例1: 您为 <devicename>sio0</devicename> 设置标记 0x10</title>
+ <title>例1: 您为 <filename>sio0</filename> 设置标记 0x10</title>
<programlisting>device sio0 flags 0x10</programlisting>
@@ -2311,7 +2282,7 @@ boot:</screen>
</sect3>
<sect3>
- <title>例2:您为 <devicename>sio0</devicename> 设置标记为 0x30</title>
+ <title>例2:您为 <filename>sio0</filename> 设置标记为 0x30</title>
<programlisting>device sio0 flags 0x30</programlisting>
@@ -2374,7 +2345,7 @@ boot:</screen>
</sect3>
</sect2>
- <sect2 id="serialconsole-tips">
+ <sect2 xml:id="serialconsole-tips">
<title>串口控制台的提示</title>
<sect3>
@@ -2386,7 +2357,7 @@ boot:</screen>
<itemizedlist>
<listitem>
- <para>将 <makevar>BOOT_COMCONSOLE_SPEED</makevar> 配置为希望的速率,
+ <para>将 <varname>BOOT_COMCONSOLE_SPEED</varname> 配置为希望的速率,
并重新编译引导块。 请参见 <xref linkend="serialconsole-com2"/>
以了解如何联编和安装新的引导块。</para>
@@ -2422,11 +2393,11 @@ console="comconsole,vidconsole"</programlisting>
</itemizedlist>
</sect3>
- <sect3 id="serialconsole-com2">
- <title>使用 <devicename>sio0</devicename> 以外的串口
+ <sect3 xml:id="serialconsole-com2">
+ <title>使用 <filename>sio0</filename> 以外的串口
作为控制台</title>
- <para>使用串口而不是 <devicename>sio0</devicename>
+ <para>使用串口而不是 <filename>sio0</filename>
作为控制台需要做一些重编译。 如果您无论如何都要使用另一个串口,
重新编译引导块, 启动引导器和内核。</para>
@@ -2439,16 +2410,16 @@ console="comconsole,vidconsole"</programlisting>
<para>编辑 <filename>/etc/make.conf</filename> 文件, 然后设置
<literal>BOOT_COMCONSOLE_PORT</literal>作为您要使用
(<literal>0x3f8</literal>、 <literal>0x2f8</literal>、 0x3E8
- 或 0x2E8) 端口的地址。 只有 <devicename>sio0</devicename> 到
- <devicename>sio3</devicename> (<devicename>COM1</devicename> 到
- <devicename>COM4</devicename>) 都可以使用; 但多口串口卡将不会工作。
+ 或 0x2E8) 端口的地址。 只有 <filename>sio0</filename> 到
+ <filename>sio3</filename> (<filename>COM1</filename> 到
+ <filename>COM4</filename>) 都可以使用; 但多口串口卡将不会工作。
不需要任何中断设置。</para>
</step>
<step>
<para>创建一个定制的内核配置文件, 在您要使用的串口添加合适的标记。
- 例如, 如果要将 <devicename>sio1</devicename>
- (<devicename>COM2</devicename>) 作为控制台:</para>
+ 例如, 如果要将 <filename>sio1</filename>
+ (<filename>COM2</filename>) 作为控制台:</para>
<programlisting>device sio1 flags 0x10</programlisting>
@@ -2479,7 +2450,7 @@ console="comconsole,vidconsole"</programlisting>
</procedure>
</sect3>
- <sect3 id="serialconsole-ddb">
+ <sect3 xml:id="serialconsole-ddb">
<title>通过串口线进入DDB调试器</title>
<programlisting>options BREAK_TO_DEBUGGER
@@ -2500,9 +2471,9 @@ ttyu1 "/usr/libexec/getty std.9600" unknown off secure
ttyu2 "/usr/libexec/getty std.9600" unknown off secure
ttyu3 "/usr/libexec/getty std.9600" unknown off secure</programlisting>
- <para><devicename>ttyu0</devicename> 到
- <devicename>ttyu3</devicename> 相当于
- <devicename>COM1</devicename> 到 <devicename>COM4</devicename>。
+ <para><filename>ttyu0</filename> 到
+ <filename>ttyu3</filename> 相当于
+ <filename>COM1</filename> 到 <filename>COM4</filename>。
可以打开或关闭某个端口。 如果您已经改变了串口的速度,
还必须改掉标准的 <literal>9600</literal>
与当前的例如 <literal>19200</literal> 相匹配。</para>
@@ -2513,7 +2484,7 @@ ttyu3 "/usr/libexec/getty std.9600" unknown off secure</programlisting>
</sect3>
</sect2>
- <sect2 id="serialconsole-loader">
+ <sect2 xml:id="serialconsole-loader">
<title>从启动引导器修改控制台</title>
<para>前面一节描述了如何通过调整引导块来设定串口控制台。
@@ -2557,15 +2528,15 @@ ttyu3 "/usr/libexec/getty std.9600" unknown off secure</programlisting>
</sect3>
<sect3>
- <title>使用串口而不是<devicename>sio0</devicename>作为控制台</title>
+ <title>使用串口而不是<filename>sio0</filename>作为控制台</title>
- <para>要使用一个串口而不是 <devicename>sio0</devicename> 作为串口控制台
+ <para>要使用一个串口而不是 <filename>sio0</filename> 作为串口控制台
需要重新编译启动引导器。下面的步骤跟
<xref linkend="serialconsole-com2"/> 描述的相似。</para>
</sect3>
</sect2>
- <sect2 id="serialconsole-caveats">
+ <sect2 xml:id="serialconsole-caveats">
<title>警告</title>
<para>这篇文章本意是想告诉人们如何设定没有显示设备或键盘的专用服务器。