kernel 設定檔的內容格式相當簡單。
每一行都包括一個關鍵字,以及一個或多個參數。事實上,
很多行大多只有一個參數。任何以 #
開頭的敘述都將被視為註解而被忽略。
接下來將以在 GENERIC
所出現的順序一一介紹之。
若要看與該平台架構有關的各選項、設備列表,
請參閱與 GENERIC
檔同目錄的 NOTES
檔。 而與平台架構差異較無關的通用部份,則可參閱
/usr/src/sys/conf/NOTES
。
若為了測試,而需要一份含有所有可用設定的設定檔,那麼請以
root
身份下:
#
cd /usr/src/sys/i386
/conf && make LINT
下面為 GENERIC
設定檔的範例,
其中包括說明用的註釋。 這例子應該與您機器上的
/usr/src/sys/
相當接近。i386
/conf/GENERIC
此處是指機器架構,必須為
alpha
、amd64
、
i386
、ia64
、
pc98
、powerpc
、
sparc64
其中之一。
上面設定是指定要用哪一種 CPU 型號。 也可以同時加上多組 CPU 型號
(比如說萬一不確定是否要用 I586_CPU
或
I686_CPU
)。 然而自訂 kernel 的話,建議先確認自己的
CPU 型號,然後只用最適合的那組就好了。 若不確定 CPU 到底是用哪一種,
可以查閱 /var/run/dmesg.boot
的開機訊息以確定。
這是設定該 kernel 名稱為何,可以隨意命名之,像是取名為
MYKERNEL
,若是有照先前說明來作大概會取這樣名字。
ident
後面的字串會在開機時顯示,因此若要辨認新 kernel
與常用 kernel 的話,就設定不同組名稱即可(比如在自訂實驗用的
kernel)。
device.hints(5) 可用來設定各項驅動程式的選項。
開機時 loader(8) 會檢查預設的 /boot/device.hints
設定檔。 使用 hints
選項,就可以把這些 hints
靜態編入 kernel 內。 如此一來就不必在 /boot
內建立 device.hints
檔。
加上 -g
選項的話,FreeBSD 會在編譯過程加上 debug
用的資訊,透過這選項會讓 gcc(1) 啟用 debug
所會用到的相關資訊。
FreeBSD. 傳統所用(並且是預設)的系統 CPU scheduler。 若您不清楚要如何設定 ,請保留這設定。
Allows threads that are in the kernel to be preempted by higher priority threads. It helps with interactivity and allows interrupt threads to run sooner rather than waiting.
Networking support. Leave this in, even if you do not plan to be connected to a network. Most programs require at least loopback networking (i.e., making network connections within your PC), so this is essentially mandatory.
This enables the IPv6 communication protocols.
This is the basic hard drive file system. Leave it in if you boot from the hard disk.
This option enables Soft Updates in the kernel, this will
help speed up write access on the disks. Even when this
functionality is provided by the kernel, it must be turned on
for specific disks. Review the output from mount(8) to see
if Soft Updates is enabled for your system disks. If you do not
see the soft-updates
option then you will
need to activate it using the tunefs(8) (for existing
file systems) or newfs(8) (for new file systems)
commands.
This option enables kernel support for access control lists. This relies on the use of extended attributes and UFS2, and the feature is described in detail in 節 14.12, “File System Access Control Lists”. ACLs are enabled by default and should not be disabled in the kernel if they have been used previously on a file system, as this will remove the access control lists, changing the way files are protected in unpredictable ways.
This option includes functionality to speed up disk operations on large directories, at the expense of using additional memory. You would normally keep this for a large server, or interactive workstation, and remove it if you are using FreeBSD on a smaller system where memory is at a premium and disk access speed is less important, such as a firewall.
This option enables support for a memory backed virtual disk used as a root device.
The network file system. Unless you plan to mount partitions from a UNIX® file server over TCP/IP, you can comment these out.
The MS-DOS® file system. Unless you plan to mount a DOS formatted
hard drive partition at boot time, you can safely comment this out.
It will be automatically loaded the first time you mount a DOS
partition, as described above. Also, the excellent
emulators/mtools
software
allows you to access DOS floppies without having to mount and
unmount them (and does not require MSDOSFS
at
all).
The ISO 9660 file system for CDROMs. Comment it out if you do not have a CDROM drive or only mount data CDs occasionally (since it will be dynamically loaded the first time you mount a data CD). Audio CDs do not need this file system.
The process file system. This is a “pretend”
file system mounted on /proc
which allows
programs like ps(1) to give you more information on what
processes are running. Use of PROCFS
is not required under most circumstances, as most
debugging and monitoring tools have been adapted to run without
PROCFS
: installs will not mount this file
system by default.
6.X kernels making use of PROCFS
must also
include support for PSEUDOFS
.
This option brings the ability to have a large number of partitions on a single disk.
Compatibility with 4.3BSD. Leave this in; some programs will act strangely if you comment this out.
This option is required on FreeBSD 5.X i386™ and Alpha systems to support applications compiled on older versions of FreeBSD that use older system call interfaces. It is recommended that this option be used on all i386™ and Alpha systems that may run older applications; platforms that gained support only in 5.X, such as ia64 and Sparc64®, do not require this option.
此行是 FreeBSD 6.X 及更新的版本若需支援 FreeBSD 5.X 系統呼叫才需要設定。
This causes the kernel to pause for 5 seconds before probing each SCSI device in your system. If you only have IDE hard drives, you can ignore this, otherwise you can try to lower this number, to speed up booting. Of course, if you do this and FreeBSD has trouble recognizing your SCSI devices, you will have to raise it again.
This enables kernel process tracing, which is useful in debugging.
This option provides for System V shared memory. The most common use of this is the XSHM extension in X, which many graphics-intensive programs will automatically take advantage of for extra speed. If you use X, you will definitely want to include this.
Support for System V messages. This option only adds a few hundred bytes to the kernel.
Support for System V semaphores. Less commonly used but only adds a few hundred bytes to the kernel.
The -p
option of the ipcs(1) command will
list any processes using each of these System V facilities.
Real-time extensions added in the 1993 POSIX®. Certain applications in the Ports Collection use these (such as StarOffice™).
This option is required to allow the creation of keyboard device
nodes in /dev
.
Giant is the name of a mutual exclusion mechanism (a sleep mutex)
that protects a large set of kernel resources. Today, this is an
unacceptable performance bottleneck which is actively being replaced
with locks that protect individual resources. The
ADAPTIVE_GIANT
option causes Giant to be included
in the set of mutexes adaptively spun on. That is, when a thread
wants to lock the Giant mutex, but it is already locked by a thread
on another CPU, the first thread will keep running and wait for the
lock to be released. Normally, the thread would instead go back to
sleep and wait for its next chance to run. If you are not sure,
leave this in.
Note that on FreeBSD 8.0-CURRENT and later versions, all mutexes are
adaptive by default, unless explicitly set to non-adaptive by
compiling with the NO_ADAPTIVE_MUTEXES
option. As
a result, Giant is adaptive by default now, and the
ADAPTIVE_GIANT
option has been removed from the
kernel configuration.
The apic device enables the use of the I/O APIC for interrupt
delivery. The apic device can be used in both UP and SMP kernels, but
is required for SMP kernels. Add options SMP
to
include support for multiple processors.
apic 只限 i386 架構才有,其他架構則不必加上這行。
Include this if you have an EISA motherboard. This enables auto-detection and configuration support for all devices on the EISA bus.
Include this if you have a PCI motherboard. This enables auto-detection of PCI cards and gatewaying from the PCI to ISA bus.
This is the floppy drive controller.
This driver supports all ATA and ATAPI devices. You only need
one device ata
line for the kernel to detect all
PCI ATA/ATAPI devices on modern machines.
This is needed along with device ata
for
ATA disk drives.
This is needed along with device ata
for ATA
RAID drives.
This is needed along with device ata
for
ATAPI CDROM drives.
This is needed along with device ata
for
ATAPI floppy drives.
This is needed along with device ata
for
ATAPI tape drives.
This makes the controller number static; without this, the device numbers are dynamically allocated.
SCSI controllers. Comment out any you do not have in your
system. If you have an IDE only system, you can remove these
altogether. The *_REG_PRETTY_PRINT
lines are
debugging options for their respective drivers.
SCSI peripherals. Again, comment out any you do not have, or if you have only IDE hardware, you can remove them completely.
The USB umass(4) driver and a few other drivers use the SCSI subsystem even though they are not real SCSI devices. Therefore make sure not to remove SCSI support, if any such drivers are included in the kernel configuration.
Supported RAID controllers. If you do not have any of these, you can comment them out or remove them.
The keyboard controller (atkbdc
) provides I/O
services for the AT keyboard and PS/2 style pointing devices. This
controller is required by the keyboard driver
(atkbd
) and the PS/2 pointing device driver
(psm
).
The atkbd
driver, together with
atkbdc
controller, provides access to the AT 84
keyboard or the AT enhanced keyboard which is connected to the AT
keyboard controller.
Use this device if your mouse plugs into the PS/2 mouse port.
多重鍵盤的支援。 若不打算同時接多組鍵盤的話, 那麼若要移除該行也沒關係。
The video card driver.
Splash screen at start up! Screen savers require this too.
sc
is the default console driver and
resembles a SCO console. Since most full-screen programs access the
console through a terminal database library like
termcap
, it should not matter whether you use
this or vt
, the VT220
compatible console driver. When you log in, set your
TERM
variable to scoansi
if
full-screen programs have trouble running under this console.
This is a VT220-compatible console driver, backward compatible to
VT100/102. It works well on some laptops which have hardware
incompatibilities with sc
. Also set your
TERM
variable to vt100
or
vt220
when you log in. This driver might also
prove useful when connecting to a large number of different machines
over the network, where termcap
or
terminfo
entries for the sc
device are often not available — vt100
should be available on virtually any platform.
Include this if you have an AGP card in the system. This will enable support for AGP, and AGP GART for boards which have these features.
Advanced Power Management support. Useful for laptops,
although in FreeBSD 5.X and above this is disabled in
GENERIC
by default.
Timer device driver for power management events, such as APM and ACPI.
PCMCIA support. You want this if you are using a laptop.
These are the serial ports referred to as
COM
ports in the MS-DOS®/Windows®
world.
If you have an internal modem on COM4
and a serial port at COM2
, you will have
to change the IRQ of the modem to 2 (for obscure technical reasons,
IRQ2 = IRQ 9) in order to access it
from FreeBSD. If you have a multiport serial card, check the
manual page for sio(4) for more information on the proper
values to add to your /boot/device.hints
.
Some video cards (notably those based on
S3 chips) use IO addresses in the form of
0x*2e8
, and since many cheap serial cards do
not fully decode the 16-bit IO address space, they clash with
these cards making the COM4
port
practically unavailable.
Each serial port is required to have a unique IRQ (unless you
are using one of the multiport cards where shared interrupts are
supported), so the default IRQs for COM3
and COM4
cannot be used.
This is the ISA-bus parallel port interface.
Provides support for the parallel port bus.
Support for parallel port printers.
All three of the above are required to enable parallel printer support.
This is the driver for the parallel network interface.
The general-purpose I/O (“geek port”) + IEEE1284 I/O.
This is for an Iomega Zip drive. It requires
scbus
and da
support. Best
performance is achieved with ports in EPP 1.9 mode.
Uncomment this device if you have a “dumb” serial or parallel PCI card that is supported by the puc(4) glue driver.
Various PCI network card drivers. Comment out or remove any of these not present in your system.
MII bus support is required for some PCI 10/100 Ethernet NICs,
namely those which use MII-compliant transceivers or implement
transceiver control interfaces that operate like an MII. Adding
device miibus
to the kernel config pulls in
support for the generic miibus API and all of the PHY drivers,
including a generic one for PHYs that are not specifically handled
by an individual driver.
Drivers that use the MII bus controller code.
ISA Ethernet drivers. See
/usr/src/sys/
for details
of which cards are
supported by which driver.i386
/conf/NOTES
對 802.11 標準的支援。 若要無線上網,則需加上這行。
對 802.11 加密設備的支援。 若要安全加密以及 802.11i 安全協定, 則需加上這行。
Support for various wireless cards.
This is the generic loopback device for TCP/IP. If you telnet
or FTP to localhost
(a.k.a. 127.0.0.1
) it will come back at you through
this device. This is mandatory.
Cryptographically secure random number generator.
ether
is only needed if you have an Ethernet
card. It includes generic Ethernet protocol code.
sl
is for SLIP support. This has been almost
entirely supplanted by PPP, which is easier to set up, better suited
for modem-to-modem connection, and more powerful.
This is for kernel PPP support for dial-up connections. There
is also a version of PPP implemented as a userland application that
uses tun
and offers more flexibility and features
such as demand dialing.
This is used by the userland PPP software. See the PPP section of this book for more information.
This is a “pseudo-terminal” or simulated login port.
It is used by incoming telnet
and
rlogin
sessions,
xterm, and some other applications such
as Emacs.
Memory disk pseudo-devices.
This implements IPv6 over IPv4 tunneling, IPv4 over IPv6 tunneling,
IPv4 over IPv4 tunneling, and IPv6 over IPv6 tunneling. The
gif
device is
“auto-cloning”, and will create device nodes as
needed.
This pseudo-device captures packets that are sent to it and diverts them to the IPv4/IPv6 translation daemon.
This is the Berkeley Packet Filter. This pseudo-device allows network interfaces to be placed in promiscuous mode, capturing every packet on a broadcast network (e.g., an Ethernet). These packets can be captured to disk and or examined with the tcpdump(1) program.
The bpf(4) device is also used by dhclient(8) to obtain the IP address of the default router (gateway) and so on. If you use DHCP, leave this uncommented.
Support for various USB devices.
Support for various Firewire devices.
For more information and additional devices supported by
FreeBSD, see
/usr/src/sys/
.i386
/conf/NOTES
Large memory configuration machines require access to more than the 4 gigabyte limit on User+Kernel Virtual Address (KVA) space. Due to this limitation, Intel added support for 36-bit physical address space access in the Pentium® Pro and later line of CPUs.
The Physical Address Extension (PAE)
capability of the Intel® Pentium® Pro and later CPUs
allows memory configurations of up to 64 gigabytes.
FreeBSD provides support for this capability via the
PAE
kernel configuration option, available
in all current release versions of FreeBSD. Due to
the limitations of the Intel memory architecture, no distinction
is made for memory above or below 4 gigabytes. Memory allocated
above 4 gigabytes is simply added to the pool of available
memory.
To enable PAE support in the kernel, simply add the following line to your kernel configuration file:
The PAE support in FreeBSD is only available for Intel® IA-32 processors. It should also be noted, that the PAE support in FreeBSD has not received wide testing, and should be considered beta quality compared to other stable features of FreeBSD.
PAE support in FreeBSD has a few limitations:
A process is not able to access more than 4 gigabytes of VM space.
KLD modules cannot be loaded into a PAE enabled kernel, due to the differences in the build framework of a module and the kernel.
Device drivers that do not use the bus_dma(9)
interface will cause data corruption in a
PAE enabled kernel and are not
recommended for use. For this reason, a
PAE
kernel
configuration file is provided in FreeBSD which
excludes all drivers not known to work in a PAE enabled
kernel.
Some system tunables determine memory resource usage
by the amount of available physical memory. Such
tunables can unnecessarily over-allocate due to the
large memory nature of a PAE system.
One such example is the kern.maxvnodes
sysctl, which controls the maximum number of vnodes allowed
in the kernel. It is advised to adjust this and other
such tunables to a reasonable value.
It might be necessary to increase the kernel virtual
address (KVA) space or to reduce the
amount of specific kernel resource that is heavily used
(see above) in order to avoid KVA
exhaustion. The KVA_PAGES
kernel option
can be used for increasing the
KVA space.
For performance and stability concerns, it is advised to consult the tuning(7) manual page. The pae(4) manual page contains up-to-date information on FreeBSD's PAE support.
本文及其他文件,可由此下載: ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/。
若有 FreeBSD 方面疑問,請先閱讀
FreeBSD 相關文件,如不能解決的話,再洽詢
<questions@FreeBSD.org>。
關於本文件的問題,請洽詢
<doc@FreeBSD.org>。