LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 742|回复: 2

FreeBSD 5.1 release的内核配置选项问题

[复制链接]
发表于 2003-9-30 10:02:31 | 显示全部楼层 |阅读模式
一般书上介绍的内核配置选项大多是基于4.x的
我发现5.1的内核选项的表达方式与前面版本的都不一样
哪位有了解得比较清楚的,在这里给大家讲一下

配置文件我感觉有两个,以GENERIC为例,另外还有一个对应的GENERIC.hint文件,比如有如下的内容:
  1. # $FreeBSD: src/sys/i386/conf/GENERIC.hints,v 1.11 2002/12/05 22:49:47 jhb Exp $
  2. hint.fdc.0.at="isa"
  3. hint.fdc.0.port="0x3F0"
  4. hint.fdc.0.irq="6"
  5. hint.fdc.0.drq="2"
  6. hint.fd.0.at="fdc0"
  7. 。。。
复制代码

而GENERIC中有一句这样的语句来调用这个文件的:(这儿是注释掉了的)
  1. #To statically compile in device wiring instead of /boot/device.hints
  2. #hints                "GENERIC.hints"                #Default places to look for devices.
复制代码

如果自己来配置内核时,是否要用这种文件,如果要用的话,如何修改?

这些hint.*.*.*的每个字段各代表什么意思呢?
发表于 2003-9-30 10:43:51 | 显示全部楼层
1.关于内核配置的选项,我想在5.x最好的还是看看/usr/src/sys/i386/conf/NOTES文件(4.x为LINTS),当然王波先生的《FreeBSD使用大全II》也有比较详细的阐述,建议看看。

2.hint.*.*.*的语法为:
hint.driver.unit.keyword="value"
driver:设备名
unit:unit号
keyword:hint的关键字,有如下这些:

at        specifies a bus to which the device is attached.
port      specifies the start address of I/O ports to be used by
                     the device.
portsize  specifies the number of ports used by the device.
irq       is the interrupt line number to be used.
drq       is the DMA channel number.
maddr     specifies the physical memory address used by the device.
msize     specifies the physical memory size used by the device.
flags     sets various flag bits for the device.
disabled can be set to "1" to disable the device.


3./usr/src/sys/i386/conf/GENERIC.hints是GENERIC ker-                                  nel.的hints的一个样板,配置内核时教少用到
 楼主| 发表于 2003-9-30 11:47:26 | 显示全部楼层
比如我配置apm时:
# Power management support (see NOTES for more options)
device                apm

在GENERIC.hints中有这么几句:
hint.apm.0.disabled="1"
hint.apm.0.flags="0x20"

在NOTES中有这么几句:
# Notes on APM
#  The flags takes the following meaning for apm0:
#    0x0020  Statclock is broken.
#  If apm is omitted, some systems require sysctl kern.timecounter.method=1
#  for correct timekeeping.

而我将这句
hint.apm.0.flags="0x20" 加到内核配置文件中时,编译时就报这行语法错误,为何?

另外使用命令
#sysctl kern.timecounter.method=1
时也报错,说根本就没有这个内核变量
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表