aboutsummaryrefslogtreecommitdiff
path: root/zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml
diff options
context:
space:
mode:
authorFukang Chen <loader@FreeBSD.org>2008-02-09 13:33:16 +0000
committerFukang Chen <loader@FreeBSD.org>2008-02-09 13:33:16 +0000
commited5b888f26ebf2119fcaf6d8b3e9024f22cd1105 (patch)
tree4e147a93dd2031d4c7adc4c6a247edc2c1bbeed3 /zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml
parentc377caa7c2d7a5d2b74787d4c80709733c862f3a (diff)
Notes
Diffstat (limited to 'zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml')
-rw-r--r--zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml83
1 files changed, 80 insertions, 3 deletions
diff --git a/zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml b/zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml
index 245626fe7e..027087371b 100644
--- a/zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml
+++ b/zh_CN.GB2312/books/handbook/kernelconfig/chapter.sgml
@@ -2,7 +2,7 @@
The FreeBSD Documentation Project
The FreeBSD Chinese Documentation Project
- Original Revision: 1.176
+ Original Revision: 1.180
$FreeBSD$
-->
@@ -115,6 +115,77 @@
</itemizedlist>
</sect1>
+ <sect1 id="kernelconfig-devices">
+ <sect1info>
+ <authorgroup>
+ <author>
+ <firstname>Tom</firstname>
+ <surname>Rhodes</surname>
+ <contrib>作者 </contrib>
+ </author>
+ </authorgroup>
+ </sect1info>
+ <title>发现系统硬件</title>
+
+ <para>在尝试配置内核以前,比较明智的做法是先获得一份机器硬件的清单。
+ 当 &os; 并不是主操作系统时,通过查看当前操作系统的配置可以很容易的
+ 创建一份机器硬件的配置清单。举例来说, &microsoft; 的
+ <application>设备管理器</application> 里通常含有关于已安装硬件的重要信息。
+ <application>设备管理器</application> 位于控制面板。</para>
+
+ <note>
+ <para>某些版本的 &microsoft.windows; 有一个 <application>系统</application>
+ 图标会指明 <application>设备管理器</application> 的位置。</para>
+ </note>
+
+ <para>如果机器上并不存在其他的操作系统,
+ 系统管理员只能手动寻找这些信息了。其中的一个方法是使用
+ &man.dmesg.8; 工具以及 &man.man.1; 命令。&os;
+ 上大多数的驱动程序都有一份手册页(manual page)列出了所支持的硬件,
+ 在系统启动的时候,被发现的硬件也会被列出。举例来说,
+ 下面的这几行表示 <devicename>psm</devicename> 驱动找到了一个鼠标:</para>
+
+ <programlisting>psm0: &lt;PS/2 Mouse&gt; irq 12 on atkbdc0
+psm0: [GIANT-LOCKED]
+psm0: [ITHREAD]
+psm0: model Generic PS/2 mouse, device ID 0</programlisting>
+
+ <para>这个驱动需要被包含在客户制定的内核配置文件里,
+ 或着使用 &man.loader.conf.5; 加载。</para>
+
+ <para>有时,<command>dmesg</command> 里只会显示来自系统消息的数据,
+ 而不是系统启动时的检测信息。在这样的情况下,你可以查看文件
+ <filename>/var/run/dmesg.boot</filename>。</para>
+
+ <para>另一个查找硬件信息的方法是使用 &man.pciconf.8; 工具,
+ 它能提供更详细的输出,比如:</para>
+
+ <programlisting>ath0@pci0:3:0:0: class=0x020000 card=0x058a1014 chip=0x1014168c rev=0x01 hdr=0x00
+ vendor = 'Atheros Communications Inc.'
+ device = 'AR5212 Atheros AR5212 802.11abg wireless'
+ class = network
+ subclass = ethernet</programlisting>
+
+ <para>这个片断取自于 <command>pciconf <option>-lv</option></command>
+ 命令的输出,显示 <devicename>ath</devicename>
+ 驱动找到了一个无线以太网设备。输入命令
+ <command>man <replaceable>ath</replaceable></command>
+ 就能查阅有关 &man.ath.4; 的手册页(manual page)了。</para>
+
+ <para>还可以传给 &man.man.1; 命令 <option>-k</option> 选项,
+ 同样能获得有用的信息。例如:</para>
+
+ <screen>&prompt.root; man -k <replaceable>Atheros</replaceable></screen>
+
+ <para>能得到一份包含特定词语的手册页(manual page):</para>
+
+ <programlisting>ath(4) - Atheros IEEE 802.11 wireless network driver
+ath_hal(4) - Atheros Hardware Access Layer (HAL)</programlisting>
+
+ <para>手头备有一份硬件的配置清单,
+ 那么编译制定内核的过程就显得不那么困难了。</para>
+ </sect1>
+
<sect1 id="kernelconfig-building">
<title>建立并安装一个定制的内核</title>
<indexterm>
@@ -579,8 +650,7 @@ options NFS_ROOT # NFS usable as /, requires NFSCLIENT</progra
<programlisting>options KBD_INSTALL_CDEV # install a CDEV entry in /dev</programlisting>
- <para>这个选项与键盘有关。 它在 <filename>/dev</filename>
- 中安装一个 CDEV 项。</para>
+ <para>这个选项是在 <filename>/dev</filename>下建立键盘设备节点必需的。</para>
<programlisting>options ADAPTIVE_GIANT # Giant mutex is adaptive.</programlisting>
@@ -593,6 +663,13 @@ options NFS_ROOT # NFS usable as /, requires NFSCLIENT</progra
一般情况下, 另一个线程将进入休眠状态并等待下一次调度。
如果您不确定是否应该这样做的话, 一般应该打开它。</para>
+ <note>
+ <para>请注意在 &os; 8.0-CURRENT 及以后的版本,所有的互斥体默认都是自适应的,
+ 除非在编译时使用 <literal>NO_ADAPTIVE_MUTEXES</literal> 选项,
+ 明确的指定为非自适应。因此,内核全局锁(Giant)目前默认也是自适应的,
+ 而且 <literal>ADAPTIVE_GIANT</literal> 选项已经从内核配置文件中移出。</para>
+ </note>
+
<indexterm>
<primary>内核选项</primary>
<secondary>SMP</secondary>