# 10.3.浏览系统硬件

在编辑内核配置文件之前，建议对机器的硬件进行清单盘点。在双重启动系统中，可以从其他操作系统创建硬件清单。例如，Microsoft® 的设备管理器包含有关已安装设备的信息。

> **注意**
>
> 某些版本的 Microsoft® Windows® 有个系统图标，可以用来访问设备管理器。

如果 FreeBSD 是唯一安装的操作系统，可以使用 [dmesg(8)](https://man.freebsd.org/cgi/man.cgi?query=dmesg\&sektion=8\&format=html) 来确定在启动探测过程中找到并列出的硬件。FreeBSD 上的大多数设备驱动程序都有手册页，其中列出了该驱动程序支持的硬件。例如，以下几行表明 [psm(4)](https://man.freebsd.org/cgi/man.cgi?query=psm\&sektion=4\&format=html) 驱动程序找到了一个鼠标：

```sh
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model Generic PS/2 mouse, device ID 0
```

由于此硬件存在，因此不应将该驱动程序从自定义内核配置文件中删除。

如果 `dmesg` 的输出未显示启动探测的结果，可以改为读取 `/var/run/dmesg.boot` 的内容。

另一个用于查找硬件的工具是 [pciconf(8)](https://man.freebsd.org/cgi/man.cgi?query=pciconf\&sektion=8\&format=html)，它提供了更详细的输出。例如：

```sh
% pciconf -lv
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
```

此输出表明 ath 驱动程序找到了一款无线以太网设备。

[man(1)](https://man.freebsd.org/cgi/man.cgi?query=man\&sektion=1\&format=html) 的 `-k` 标志可以用于提供有用的信息。例如，它可以用来显示包含特定设备品牌或名称的手册页列表：

```sh
# man -k Atheros
ath(4)                   - Atheros IEEE 802.11 wireless network driver
ath_hal(4)               - Atheros Hardware Access Layer (HAL)
```

创建硬件清单后，请参考它以确保在编辑自定义内核配置时不会删除已安装硬件的驱动程序。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://handbook.bsdcn.org/di-10-zhang-pei-zhi-freebsd-nei-he/10.3.-liu-lan-xi-tong-ying-jian.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
