diff --git a/en_US.ISO8859-1/books/handbook/kernelconfig/chapter.sgml b/en_US.ISO8859-1/books/handbook/kernelconfig/chapter.sgml index c3084a2f46..ccde917c30 100644 --- a/en_US.ISO8859-1/books/handbook/kernelconfig/chapter.sgml +++ b/en_US.ISO8859-1/books/handbook/kernelconfig/chapter.sgml @@ -70,6 +70,10 @@ How to troubleshoot if things go wrong. + + All of the commands listed within this chapter by way of example + should be executed as root in order to + succeed. @@ -88,17 +92,16 @@ becoming available (such as PCMCIA cards in a laptop), or for new functionality to be brought into the kernel that was not necessary when the kernel was originally compiled. This is - known as a modular kernel. Colloquially these are called - KLDs. + known as a modular kernel. Despite this, it is still necessary to carry out some static kernel configuration. In some cases this is because the functionality is so tied to the kernel that it can not be made dynamically loadable. In others it may simply be because no one has yet taken the time to write a - dynamic loadable kernel module for that functionality yet. + dynamic loadable kernel module for that functionality. Building a custom kernel is one of the most important rites of - passage nearly every &unix; user must endure. This process, while + passage nearly every BSD user must endure. This process, while time consuming, will provide many benefits to your &os; system. Unlike the GENERIC kernel, which must support a wide range of hardware, a custom kernel only contains support for @@ -109,11 +112,11 @@ Faster boot time. Since the kernel will only probe the hardware you have on your system, the time it takes your system to - boot will decrease dramatically. + boot can decrease dramatically. - Less memory usage. A custom kernel often uses less memory + Lower memory usage. A custom kernel often uses less memory than the GENERIC kernel, which is important because the kernel must always be present in real memory. For this reason, a custom kernel is especially useful @@ -122,8 +125,9 @@ Additional hardware support. A custom kernel allows you to - add in support for devices such as sound cards, which are not - present in the GENERIC kernel. + add in support for devices which are not + present in the GENERIC kernel, such as + sound cards. @@ -138,23 +142,30 @@ First, let us take a quick tour of the kernel build directory. All directories mentioned will be relative to the main /usr/src/sys directory, which is also - accessible through /sys. There are a number of + accessible through the path name /sys. There are a number of subdirectories here representing different parts of the kernel, but - the most important, for our purposes, are + the most important for our purposes are arch/conf, where you will edit your custom kernel configuration, and compile, which is the staging area where your kernel will be built. arch represents - either i386, alpha, or + one of i386, alpha, + amd64, ia64, + powerpc, sparc64, or pc98 (an alternative development branch of PC hardware, popular in Japan). Everything inside a particular architecture's directory deals with that architecture only; the rest - of the code is common to all platforms to which &os; could + of the code is machine independent code common to all platforms to which &os; could potentially be ported. Notice the logical organization of the directory structure, with each supported device, file system, and - option in its own subdirectory. &os; 5.X and up has support for - sparc64, and a few other architectures under - development. + option in its own subdirectory. Versions of &os; prior to 5.X + support only the i386, alpha + and pc98 architectures. + + This chapter assumes that you are using the i386 architecture + in the examples. If this is not the case for your situation, + make appropriate adjustments to the path names for your system's + architecture. If there is not a @@ -182,7 +193,7 @@ and copy the GENERIC configuration file to the name you want to give your kernel. For example: - &prompt.root; cd /usr/src/sys/i386/conf + &prompt.root; cd /usr/src/sys/i386/conf &prompt.root; cp GENERIC MYKERNEL Traditionally, this name is in all capital letters and, if you @@ -195,31 +206,26 @@ Storing your kernel config file directly under /usr/src can be a bad idea. If you are experiencing problems it can be tempting to just delete - /usr/src and start again. Five seconds after - you do that you realize that you have deleted your custom kernel - config file. Do not edit GENERIC + /usr/src and start again. After doing this, + it usually only takes a few seconds for + you to realize that you have deleted your custom kernel + config file. Also, do not edit GENERIC directly, as it may get overwritten the next time you update your source tree, and your kernel modifications will be lost. You might want to keep your kernel config file elsewhere, and then - create a symbolic link to the file in the i386 + create a symbolic link to the file in the i386 directory. For example: - &prompt.root; cd /usr/src/sys/i386/conf + &prompt.root; cd /usr/src/sys/i386/conf &prompt.root; mkdir /root/kernels &prompt.root; cp GENERIC /root/kernels/MYKERNEL &prompt.root; ln -s /root/kernels/MYKERNEL - - You must execute these and all of the following commands under - the root account or you will get - permission denied errors. - - Now, edit MYKERNEL with your favorite text editor. If you are just starting out, the only editor available will probably be vi, which is too complex to @@ -241,20 +247,21 @@ section slowly and carefully. - Be sure to always check the file - /usr/src/UPDATING, before you perform any update - steps, in the case you If you sync your source tree with the - latest sources of the &os; project. - In this file all important issues with updating &os; - are typed out. /usr/src/UPDATING always fits - your version of the &os; source, and is therefore more accurate - for new information than the handbook. + latest sources of the &os; project, + be sure to always check the file + /usr/src/UPDATING before you perform any update + steps. This file describes any important issues or areas + requiring special attention within the updated source code. + /usr/src/UPDATING always matches + your version of the &os; source, and is therefore more up to date + with new information than this handbook. You must now compile the source code for the kernel. There are two procedures you can use to do this, and the one you will use depends on - why you are rebuilding the kernel, and the version of &os; you are + why you are rebuilding the kernel and the version of &os; that you are running. @@ -283,6 +290,26 @@ + + cvsup + + anonymous CVS + CTM + + CVS + anonymous + + + If you have not upgraded your source + tree in any way since the last time you successfully completed + a buildworld-installworld cycle + (you have not run CVSup, + CTM, or used + anoncvs), then it is safe to use the + config, make depend, + make, make install sequence. + + Procedure 1. Building a Kernel the <quote>Traditional</quote> Way @@ -293,12 +320,12 @@ - Change into the build directory. This is printed out after running the aforementioned - command. + Change into the build directory. &man.config.8; will print + the name of this directory after being run as above. &prompt.root; cd ../compile/MYKERNEL - For &os; version prior to 5.0, use instead: + For &os; versions prior to 5.0, use the following form instead: &prompt.root; cd ../../compile/MYKERNEL @@ -348,46 +375,26 @@ - cvsup - - anonymous CVS - CTM - - CVS - anonymous - - - If you have not upgraded your source - tree in any way since the last time you successfully completed - a buildworld-installworld cycle - (you have not run CVSup, - CTM, or used - anoncvs), then it is safe to use the - config, make depend, - make, make install sequence. - - - - kernel.old + /boot/kernel.old - The new kernel will be copied to the root directory as - /kernel and the old kernel will be moved to - /kernel.old. Now, shutdown the system and - reboot to use your new kernel. In case something goes wrong, there are + The new kernel will be copied to the /boot/kernel directory as + /boot/kernel/kernel and the old kernel will be moved to + /boot/kernel.old/kernel. Now, shutdown the system and + reboot to use your new kernel. If something goes wrong, there are some troubleshooting - instructions at the end of this chapter. Be sure to read the + instructions at the end of this chapter that you may find useful. Be sure to read the section which explains how to recover in case your new kernel does not boot. - As of &os; 5.0, kernels are installed along with their - modules in /boot/kernel, and old kernels - will be backed up in /boot/kernel.old. + In &os; 4.X and earlier, kernels are installed + in /kernel, modules in /modules, and old kernels + are backed up in /kernel.old. Other files relating to the boot process, such as the boot - &man.loader.8; and configuration are also stored in + &man.loader.8; and configuration are stored in /boot. Third party or custom modules - may be placed in /boot/modules, although + can be placed in /modules, although users should be aware that keeping modules in sync with the compiled kernel is very important. Modules not intended to run with the compiled kernel may result in instability @@ -398,7 +405,7 @@ If you have added any new devices (such as sound cards) and you are running &os; 4.X or previous versions, you may have to add some device nodes to your - /dev directory before you can use + /dev directory before you can use them. For more information, take a look at Making Device Nodes section later on in this chapter. @@ -406,11 +413,27 @@ + + + + Joel + Dahl + Updated for &os; 5.X by + + + + + The Configuration File + + kernel + NOTES + kernel LINT + NOTES LINT kernel @@ -426,31 +449,49 @@ some related keywords have been grouped together in a single section (such as Networking) even though they are actually scattered throughout the GENERIC file. An exhaustive list of options and more - detailed explanations of the device lines is present in the - LINT configuration file, located in the same - directory as GENERIC. If you are in doubt as - to the purpose or necessity of a line, check first in - LINT. + id="kernelconfig-options"> For an exhaustive list of architecture + dependent options and devices, see the NOTES + file in the same directory as GENERIC. For + architecure independent options, see + /usr/src/sys/conf/NOTES. - In &os; 5.X and above the LINT is - non-existent. See the NOTES file for - architecture dependent options. Some options, mainly - architecture independent ones, are stored in the - /usr/src/sys/conf/NOTES file. It is - advisable to review the options in here also. + + NOTES does not exist in &os; 4.X. + Instead, see the LINT file for detailed + explanations of options and devices in GENERIC. + LINT served two purposes in 4.X: to provide a + reference for choosing kernel options when building a custom + kernel, and to provide a kernel configuration with as many + tweakable options tweaked to non-default values as possible. The + reason behind this was that such a configuration helped (and still + does) a lot when testing new code and changes to existing code that + may cause conflicts with other parts of the kernel. However, + the kernel configuration framework went through some heavy changes + in 5.X; one example of this is that the driver configuration options were moved + to a hints file so that they could be changed + and loaded dynamically at boot time, and LINT + could not contain those hints anymore. For this and other + reasons, the LINT file was renamed to + NOTES and retained mostly the first reason for + its existence: documenting the available options for user + convenience. + + In &os; 5.X and later versions you can still generate a buildable + LINT file by typing: + + &prompt.root; cd /usr/src/sys/i386/conf && make LINT + kernel example config file - The following is an example GENERIC kernel + The following is an example of the GENERIC kernel configuration file with various additional comments where needed for clarity. This example should match your copy in - /usr/src/sys/i386/conf/GENERIC fairly - closely. For details of all the possible kernel options, see - /usr/src/sys/i386/conf/LINT. + /usr/src/sys/i386/conf/GENERIC fairly + closely. # # GENERIC -- Generic kernel configuration file for &os;/i386 @@ -470,7 +511,7 @@ # If you are in doubt as to the purpose or necessity of a line, check first # in NOTES. # -# $FreeBSD: src/sys/i386/conf/GENERIC,v 1.380 2003/03/29 13:36:41 mdodd Exp $ +# $FreeBSD: /repoman/r/ncvs/src/sys/i386/conf/GENERIC,v 1.413 2004/08/11 01:34:18 rwatson Exp $ The following are the mandatory keywords required in every kernel you build: @@ -482,10 +523,10 @@ machine i386 This is the machine architecture. It must be either - i386, pc98, - sparc64, alpha, - ia64, amd64, or - powerpc. + alpha, amd64, + i386, ia64, + pc98, powerpc, or + sparc64. kernel options @@ -496,13 +537,13 @@ cpu I586_CPU cpu I686_CPU The above option specifies the type of CPU you have in your - system. You may have multiple instances of the CPU line (i.e., - you are not sure whether you should use + system. You may have multiple instances of the CPU line (if, for + example, you are not sure whether you should use I586_CPU or I686_CPU), - however, for a custom kernel, it is best to specify only the CPU + but for a custom kernel it is best to specify only the CPU you have. If you are unsure of your CPU type, you can check the /var/run/dmesg.boot file to view your boot - up messages. + messages. kernel options @@ -526,14 +567,14 @@ cpu I686_CPU - Roll your own release of FreeBSD which includes + Roll your own release of &os; which includes I386_CPU support in the kernels of the installation CD-ROM. The first of these options is probably the easiest of all, but you - will need a lot of disk space on a 386-class machine which may be + will need a lot of disk space which, on a 386-class machine, may be difficult to find. @@ -549,7 +590,7 @@ cpu I686_CPU instructions of the previous examples. The value you put in the ident string will print when you boot up the kernel, so it is useful to give the new kernel a different name if you - want to keep it separate from your usual kernel (i.e. you want to + want to keep it separate from your usual kernel (e.g., you want to build an experimental kernel). kernel options @@ -565,10 +606,10 @@ cpu I686_CPU Starting with &os; 4.5, the system will auto-tune this setting for you if you explicitly set it to 0 - The auto-tuning algorithm sets maxuser equal + The auto-tuning algorithm sets maxusers equal to the amount of memory in the system, with a minimum of 32, and a maximum of 384.. - In &os; 5.X, maxusers will default to + In &os; 5.X and above, maxusers will default to 0 if not specified. If you are using an version of &os; earlier than 4.5, or you want to manage it yourself you will want to set @@ -578,7 +619,7 @@ cpu I686_CPU maximum number of processes, which is set to 20 + 16 * maxusers, so if you set maxusers to 1, then you can only have 36 simultaneous processes, including the 18 - or so that the system starts up at boot time, and the 15 or so you + or so that the system starts up at boot time and the 15 or so you will probably create when you start the X Window System. Even a simple task like reading a manual page will start up nine processes to filter, decompress, and view it. Setting @@ -597,27 +638,27 @@ cpu I686_CPU the maximum number of users you will likely have on your system and how many processes each of them will be running. One keyword which does limit the number of simultaneous - remote logins and X terminal windows is pseudo-device pty 16. With &os; 5.X, you do not have to worry about this number since the &man.pty.4; driver is - auto-cloning, and you have to use the line + auto-cloning; you simply use the line device pty in your configuration file. # Floating point support - do not disable. -device npx0 at nexus? port IO_NPX irq 13 +device npx - npx0 is the interface to the floating point + npx is the interface to the floating point math unit in &os;, which is either the hardware co-processor or the software math emulator. This is not optional. - # Pseudo devices - the number indicates how many units to allocate. + # Pseudo devices device loop # Network loopback This is the generic loopback device for TCP/IP. If you telnet - or FTP to localhost (a.k.a., localhost (a.k.a. 127.0.0.1) it will come back at you through this device. This is mandatory. Under &os; 4.X you have to use the line pseudo-device @@ -651,29 +692,16 @@ device loop # Network loopback use of the option which enables debugging information when passed to &man.gcc.1;. The same can be accomplished by the &man.config.8; option, if - you are using the traditional way for building your kernels (See the - for more informations). + you are using the traditional way for building your kernels (see + for more information). - options MATH_EMULATE #Support for x87 emulation + options SCHED_4BSD # 4BSD scheduler - This line allows the kernel to simulate a math co-processor if - your computer does not have one (386 or 486SX). If you have a - 486DX, or a 386 or 486SX (with a separate 387 or 487 chip), or - higher (&pentium;, &pentium; II, etc.), you can comment this line - out. - - - The normal math co-processor emulation routines that come with - &os; are not very accurate. If you do not - have a math co-processor, and you need the best accuracy, it is - recommended that you change this option to - GPL_MATH_EMULATE to use the GNU math support, - which is not included by default for licensing reasons. - - In &os; 5.X, math emulation is disabled by default, - as older CPUs that do not have native floating point math support - are far less common, and in many cases not supported by the - GENERIC kernel without other additional options. + The traditional scheduler for &os;. Depending on your system's + workload, you may gain performance by using the new ULE scheduler for + &os; that has been designed specially for SMP, but works just fine on UP + systems too. If you wish to try it out, replace SCHED_4BSD + with SCHED_ULE in your configuration file. options INET #InterNETworking @@ -686,23 +714,19 @@ device loop # Network loopback This enables the IPv6 communication protocols. - options FFS #Berkeley Fast Filesystem -options FFS_ROOT #FFS usable as root device [keep this!] + options FFS # Berkeley Fast Filesystem - This is the basic hard drive Filesystem. Leave it in if you + This is the basic hard drive file system. Leave it in if you boot from the hard disk. - In &os; 5.X, FFS_ROOT is no longer - required. - options UFS_ACL #Support for access control lists This option, present only in &os; 5.X, 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 the . ACLs are enabled by default, and should not be + in . 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 + system, as this will remove the access control lists, changing the way files are protected in unpredictable ways. options UFS_DIRHASH #Improve performance on big directories @@ -714,7 +738,7 @@ options FFS_ROOT #FFS usable as root device [keep this!] - options SOFTUPDATES #Enable FFS Soft Updates support + options SOFTUPDATES # Enable FFS Soft Updates support This option enables Soft Updates in the kernel, this will help speed up write access on the disks. Even when this @@ -723,32 +747,13 @@ options FFS_ROOT #FFS usable as root device [keep this!]soft-updates option then you will need to activate it using the &man.tunefs.8; (for existing - filesystems) or &man.newfs.8; (for new filesystems) + file systems) or &man.newfs.8; (for new file systems) commands. - options MFS #Memory Filesystem -options MD_ROOT #MD is a potential root device + options MD_ROOT # MD is a potential root device - This is the memory-mapped Filesystem. This is basically a RAM - disk for fast storage of temporary files, useful if you have a lot - of swap space that you want to take advantage of. A perfect place - to mount an MFS partition is on the /tmp - directory, since many programs store temporary data here. To mount - an MFS RAM disk on /tmp, add the following line - to /etc/fstab: - - - /dev/ad1s2b /tmp mfs rw 0 0 - - - Now you simply need to either reboot, or run the command - mount /tmp. - - In &os; 5.X, &man.md.4;-backed UFS file systems are - used for memory file systems rather than MFS. Information on - configuring memory-backed file systems may be found in the manual pages - for &man.mdconfig.8; and &man.mdmfs.8;, and in . As a result, the - MFS option is no longer supported. + This option enables support for a memory backed virtual disk + used as a root device. kernel options @@ -758,10 +763,11 @@ options MD_ROOT #MD is a potential root device kernel options NFS_ROOT - options NFS #Network Filesystem -options NFS_ROOT #NFS usable as root device, NFS required + options NFSCLIENT # Network Filesystem Client +options NFSSERVER # Network Filesystem Server +options NFS_ROOT # NFS usable as /, requires NFSCLIENT - The network Filesystem. Unless you plan to mount partitions + The network file system. Unless you plan to mount partitions from a &unix; file server over TCP/IP, you can comment these out. @@ -771,40 +777,43 @@ options NFS_ROOT #NFS usable as root device, NFS required options MSDOSFS #MSDOS Filesystem - The &ms-dos; Filesystem. Unless you plan to mount a DOS formatted + 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 - mtools software (in the ports collection) + emulators/mtools software allows you to access DOS floppies without having to mount and unmount them (and does not require MSDOSFS at all). - options CD9660 #ISO 9660 Filesystem -options CD9660_ROOT #CD-ROM usable as root, CD9660 required + options CD9660 # ISO 9660 Filesystem - The ISO 9660 Filesystem for CDROMs. Comment it out if you do + 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 Filesystem. + Audio CDs do not need this file system. options PROCFS #Process filesystem - The process filesystem. This is a pretend - filesystem mounted on /proc which allows + The process file system. This is a pretend + file system mounted on /proc which allows programs like &man.ps.1; to give you more information on what - processes are running. In &os; 5.X, use of PROCFS + processes are running. In &os; 5.X and above, use of PROCFS is not required under most circumstances, as most debugging and monitoring tools have been adapted to run without - PROCFS. In addition, 5.X-CURRENT kernels + PROCFS: unlike in &os; 4.X, new installations of + &os; 5.X will not mount the process file system by default. In addition, 6.X-CURRENT kernels making use of PROCFS must now also include support for PSEUDOFS: options PSEUDOFS #Pseudo-filesystem framework - PSEUDOFS is not available in &os; 4.X. - Unlike in &os; 4.X, new installations of &os; 5.X will not mount - the process file system by default. + PSEUDOFS is not available in &os; 4.X. + + options GEOM_GPT # GUID Partition Tables. + + This option brings the ability to have a large number of + partitions on a single disk. options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!] @@ -826,35 +835,8 @@ options CD9660_ROOT #CD-ROM usable as root, CD9660 required - - options UCONSOLE #Allow users to grab the console - - Allow users to grab the console, which is useful for X users. - For example, you can create a console xterm - by typing xterm - -C, which will display any &man.write.1;, - &man.talk.1;, and any other messages you receive, as well - as any console messages sent by the kernel. - - In &os; 5.X, UCONSOLE is no - longer required. - - options USERCONFIG #boot -c editor - - This option allows you to boot the configuration editor from the - boot menu. - - options VISUAL_USERCONFIG #visual boot -c editor - - This option allows you to boot the visual configuration editor - from the boot menu. - - From &os; versions 5.0 and later, the USERCONFIG options has - been deprecated in favor of the new &man.device.hints.5; - method. For more information on &man.device.hints.5; please - visit . + you do this and &os; has trouble recognizing your SCSI devices, + you will have to raise it again. options KTRACE #ktrace(1) support @@ -876,61 +858,66 @@ options CD9660_ROOT #CD-ROM usable as root, CD9660 requiredoptions SYSVMSG #SYSV-style message queues - Support for System V messages. Again, only adds a few hundred + Support for System V messages. Again, this option only adds a few hundred bytes to the kernel. - The &man.ipcs.1; command will list any processes using each of + The option of the &man.ipcs.1; command will list any processes using each of these System V facilities. - options P1003_1B #Posix P1003_1B real-time extensions -options _KPOSIX_PRIORITY_SCHEDULING + options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions Real-time extensions added in the 1993 &posix;. Certain applications in the ports collection use these (such as &staroffice;). - In &os; 5.X, all of this functionality is now - provided by the _KPOSIX_PRIORITY_SCHEDULING - option, and P1003_1B is no longer - required. + options KBD_INSTALL_CDEV # install a CDEV entry in /dev - - kernel options - ICMP_BANDLIM - - - Denial of Service (DoS) - - options ICMP_BANDLIM #Rate limit bad replies + This option is related to the keyboard. It installs a CDEV entry + in /dev. - This option enables ICMP error response bandwidth limiting. You - typically want this option as it will help protect the machine from - denial of service packet attacks. + options AHC_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~128k to driver. +options AHD_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~215k to driver. - In &os; 5.X, this feature is enabled by default and - the ICMP_BANDLIM option is not required. - + This helps debugging by printing easier register definitions for + reading. + + options PFIL_HOOKS # pfil(9) framework + + The &man.pfil.9 framework is required by the IPFILTER and IPFIREWALL + options. Keep this if you plan to build a firewall. + + In &os; 6.X-CURRENT, the &man.pfil.9; framework is always + enabled and the PFIL_HOOKS option no longer + exists. + + options ADAPTIVE_GIANT # Giant mutex is adaptive. + + This option causes Giant to be included in the set of mutexes + adaptively spun on. kernel options SMP # To make an SMP kernel, the next two are needed -#options SMP # Symmetric MultiProcessor Kernel -#options APIC_IO # Symmetric (APIC) I/O +options SMP # Symmetric MultiProcessor Kernel +device apic # I/O APIC - The above are both required for SMP support. + The above are both required for SMP support, and can also be + safely enabled on uniprocessor systems. device isa - All PCs supported by &os; have one of these. Do not remove, + All PCs supported by &os; have one of these. Do not remove this, even if you have no ISA slots. If you have an - IBM PS/2 (Micro Channel Architecture), &os; provides some + IBM PS/2 (Micro Channel Architecture) system, &os; provides only limited support at this time. For more information about the MCA support, see - /usr/src/sys/i386/conf/LINT. + /usr/src/sys/i386/conf/NOTES. device eisa @@ -951,16 +938,12 @@ options _KPOSIX_PRIORITY_SCHEDULING have these features. # Floppy drives -device fdc0 at isa? port IO_FD1 irq 6 drq 2 -device fd0 at fdc0 drive 0 -device fd1 at fdc0 drive 1 +device fdc - This is the floppy drive controller. fd0 is - the A: floppy drive, and - fd1 is the B: - drive. + This is the floppy drive controller. - device ata + # ATA and ATAPI devices +device ata This driver supports all ATA and ATAPI devices. You only need one device ata line for the kernel to detect all @@ -971,6 +954,11 @@ device fd1 at fdc0 drive 1 This is needed along with device ata for ATA disk drives. + device ataraid # ATA RAID drives + + This is needed along with device ata for ATA + RAID drives. + device atapicd # ATAPI CDROM drives @@ -989,41 +977,42 @@ device atapicd # ATAPI CDROM drives options ATA_STATIC_ID #Static device numbering - This makes the controller number static (like the old driver) or - else the device numbers are dynamically allocated. - - # ATA and ATAPI devices -device ata0 at isa? port IO_WD1 irq 14 -device ata1 at isa? port IO_WD2 irq 15 - - Use the above for older, non-PCI systems. + This makes the controller number static; without this, + the device numbers are dynamically allocated. # SCSI Controllers device ahb # EISA AHA1742 family device ahc # AHA2940 and onboard AIC7xxx devices +device ahd # AHA39320/29320 and onboard AIC79xx devices device amd # AMD 53C974 (Teckram DC-390(T)) -device dpt # DPT Smartcache - See LINT for options! device isp # Qlogic family -device ncr # NCR/Symbios Logic +device mpt # LSI-Logic MPT-Fusion +#device ncr # NCR/Symbios Logic device sym # NCR/Symbios Logic (newer chipsets) +device trm # Tekram DC395U/UW/F DC315U adapters -device adv0 at isa? -device adw -device bt0 at isa? -device aha0 at isa? -device aic0 at isa? +device adv # Advansys SCSI adapters +device adw # Advansys wide SCSI adapters +device aha # Adaptec 154x SCSI adapters +device aic # Adaptec 15[012]x SCSI adapters, AIC-6[23]60. +device bt # Buslogic/Mylex MultiMaster SCSI adapters + +device ncv # NCR 53C500 +device nsp # Workbit Ninja SCSI-3 +device stg # TMC 18C30/18C50 SCSI controllers. Comment out any you do not have in your system. If you have an IDE only system, you can remove these altogether. # SCSI peripherals -device scbus # SCSI bus (required) +device scbus # SCSI bus (required for SCSI) +device ch # SCSI media changers device da # Direct Access (disks) device sa # Sequential Access (tape etc) device cd # CD -device pass # Passthrough device (direct SCSI -access) +device pass # Passthrough device (direct SCSI access) +device ses # SCSI Environmental Services (and SAF-TE) SCSI peripherals. Again, comment out any you do not have, or if you have only IDE hardware, you can remove them completely. @@ -1035,16 +1024,29 @@ access) drivers are included in the kernel configuration. - # RAID controllers -device ida # Compaq Smart RAID + # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID -device mlx # Mylex DAC960 family +device asr # DPT SmartRAID V, VI and Adaptec SCSI RAID +device ciss # Compaq Smart RAID 5* +device dpt # DPT Smartcache III, IV - See NOTES for options +device iir # Intel Integrated RAID +device ips # IBM (Adaptec) ServeRAID +device mly # Mylex AcceleRAID/eXtremeRAID +device twa # 3ware 9000 series PATA/SATA RAID + +# RAID controllers +device aac # Adaptec FSA RAID +device aacp # SCSI passthrough for aac (requires CAM) +device ida # Compaq Smart RAID +device mlx # Mylex DAC960 family +device pst # Promise Supertrak SX6000 +device twe # 3ware ATA RAID Supported RAID controllers. If you do not have any of these, you can comment them out or remove them. # atkbdc0 controls both the keyboard and the PS/2 mouse -device atkbdc0 at isa? port IO_KBD +device atkbdc # AT keyboard controller The keyboard controller (atkbdc) provides I/O services for the AT keyboard and PS/2 style pointing devices. This @@ -1052,79 +1054,83 @@ device atkbdc0 at isa? port IO_KBD (atkbd) and the PS/2 pointing device driver (psm). - device atkbd0 at atkbdc? irq 1 + device atkbd # AT keyboard 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. - device psm0 at atkbdc? irq 12 + device psm # PS/2 mouse Use this device if your mouse plugs into the PS/2 mouse port. - device vga0 at isa? + device vga # VGA video card driver The video card driver. # splash screen/screen saver -device splash +device splash # Splash screen and screen saver support Splash screen at start up! Screen savers require this too. Use the line pseudo-device splash with &os; 4.X. # syscons is the default console driver, resembling an SCO console -device sc0 at isa? +device sc - sc0 is the default console driver, which + 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 vt0, the VT220 + 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. - # Enable this and PCVT_FREEBSD for pcvt vt220 compatible console driver -#device vt0 at isa? + # Enable this for the pcvt (VT220 compatible) console driver +#device vt #options XSERVER # support for X server on a vt console -#options FAT_CURSOR # start with block cursor -# If you have a ThinkPAD, uncomment this along with the rest of the PCVT lines -#options PCVT_SCANSET=2 # IBM keyboards are non-std +#options FAT_CURSOR # start with block cursor This is a VT220-compatible console driver, backward compatible to VT100/102. It works well on some laptops which have hardware - incompatibilities with sc0. Also set your + 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 sc0 + terminfo entries for the sc device are often not available — vt100 should be available on virtually any platform. - # Power management support (see LINT for more options) -device apm0 at nexus? disable flags 0x20 # Advanced Power Management + # Power management support (see NOTES for more options) +#device apm - Advanced Power Management support. Useful for laptops. + Advanced Power Management support. Useful for laptops, + although in &os; 5.X and above this is disabled in + GENERIC by default. + + # Add suspend/resume support for the i8254. +device pmtimer + + Timer device driver for power management events, such as APM and + ACPI. # PCCARD (PCMCIA) support -device card -device pcic0 at isa? irq 10 port 0x3e0 iomem 0xd0000 -device pcic1 at isa? irq 11 port 0x3e2 iomem 0xd4000 disable +# PCMCIA and cardbus bridge support +device cbb # cardbus (yenta) bridge +device pccard # PC Card (16-bit) bus +device cardbus # CardBus (32-bit) bus PCMCIA support. You want this if you are using a laptop. # Serial (COM) ports -device sio0 at isa? port IO_COM1 flags 0x10 irq 4 -device sio1 at isa? port IO_COM2 irq 3 -device sio2 at isa? disable port IO_COM3 irq 5 -device sio3 at isa? disable port IO_COM4 irq 9 +device sio # 8250, 16[45]50 based serial ports - These are the four serial ports referred to as COM1 through COM4 + These are the serial ports referred to as COM ports in the &ms-dos;/&windows; world. @@ -1133,7 +1139,7 @@ device sio3 at isa? disable port IO_COM4 irq 9 obscure technical reasons, IRQ2 = IRQ 9) in order to access it from &os;. If you have a multiport serial card, check the manual page for &man.sio.4; for more information on the proper - values for these lines. Some video cards (notably those based on + 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 @@ -1146,7 +1152,7 @@ device sio3 at isa? disable port IO_COM4 irq 9 # Parallel port -device ppc0 at isa? irq 7 +device ppc This is the ISA-bus parallel port interface. @@ -1179,17 +1185,24 @@ device ppc0 at isa? irq 7 scbus and da support. Best performance is achieved with ports in EPP 1.9 mode. + #device puc + + Uncomment this device if you have a dumb serial or + parallel PCI card that is supported by the &man.puc.4 glue driver. + + # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (Tulip) -device fxp # Intel EtherExpress PRO/100B (82557, 82558) -device tx # SMC 9432TX (83c170 EPIC) -device vx # 3Com 3c590, 3c595 (Vortex) -device wx # Intel Gigabit Ethernet Card (Wiseman) +device em # Intel PRO/1000 adapter Gigabit Ethernet Card +device ixgb # Intel PRO/10GbE Ethernet Card +device txp # 3Com 3cR990 (Typhoon) +device vx # 3Com 3c590, 3c595 (Vortex) Various PCI network card drivers. Comment out or remove any of these not present in your system. # PCI Ethernet NICs that use the common MII bus controller code. +# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! device miibus # MII bus support MII bus support is required for some PCI 10/100 Ethernet NICs, @@ -1201,45 +1214,70 @@ device miibus # MII bus support by an individual driver. device dc # DEC/Intel 21143 and various workalikes +device miibus # MII bus support +device bfe # Broadcom BCM440x 10/100 Ethernet +device bge # Broadcom BCM570xx Gigabit Ethernet +device dc # DEC/Intel 21143 and various workalikes +device fxp # Intel EtherExpress PRO/100B (82557, 82558) +device pcn # AMD Am79C97x PCI 10/100 (precedence over 'lnc') +device re # RealTek 8139C+/8169/8169S/8110S device rl # RealTek 8129/8139 device sf # Adaptec AIC-6915 (Starfire) device sis # Silicon Integrated Systems SiS 900/SiS 7016 +device sk # SysKonnect SK-984x & SK-982x gigabit Ethernet device ste # Sundance ST201 (D-Link DFE-550TX) +device ti # Alteon Networks Tigon I/II gigabit Ethernet device tl # Texas Instruments ThunderLAN +device tx # SMC EtherPower II (83c170 EPIC) device vr # VIA Rhine, Rhine II device wb # Winbond W89C840F device xl # 3Com 3c90x (Boomerang, Cyclone) Drivers that use the MII bus controller code. - # ISA Ethernet NICs. -device ed0 at isa? port 0x280 irq 10 iomem 0xd8000 -device ex -device ep -# WaveLAN/IEEE 802.11 wireless NICs. Note: the WaveLAN/IEEE really -# exists only as a PCMCIA device, so there is no ISA attachment needed -# and resources will always be dynamically assigned by the pccard code. -device wi -# Aironet 4500/4800 802.11 wireless NICs. Note: the declaration below will -# work for PCMCIA and PCI cards, as well as ISA cards set to ISA PnP -# mode (the factory default). If you set the switches on your ISA -# card for a manually chosen I/O address and IRQ, you must specify -# those parameters here. -device an -# The probe order of these is presently determined by i386/isa/isa_compat.c. -device ie0 at isa? port 0x300 irq 10 iomem 0xd0000 -device fe0 at isa? port 0x300 -device le0 at isa? port 0x300 irq 5 iomem 0xd0000 -device lnc0 at isa? port 0x280 irq 10 drq 0 -device cs0 at isa? port 0x300 -device sn0 at isa? port 0x300 irq 10 -# requires PCCARD (PCMCIA) support to be activated -#device xe0 at isa? + # ISA Ethernet NICs. pccard NICs included. +device cs # Crystal Semiconductor CS89x0 NIC +# 'device ed' requires 'device miibus' +device ed # NE[12]000, SMC Ultra, 3c503, DS8390 cards +device ex # Intel EtherExpress Pro/10 and Pro/10+ +device ep # Etherlink III based cards +device fe # Fujitsu MB8696x based cards +device ie # EtherExpress 8/16, 3C507, StarLAN 10 etc. +device lnc # NE2100, NE32-VL Lance Ethernet cards +device sn # SMC's 9000 series of Ethernet chips +device xe # Xircom pccard Ethernet + +# ISA devices that use the old ISA shims +#device le ISA Ethernet drivers. See - /usr/src/sys/i386/conf/LINT for which cards are + /usr/src/sys/i386/conf/NOTES for details +of which cards are supported by which driver. + # Wireless NIC cards +device wlan # 802.11 support +device an # Aironet 4500/4800 802.11 wireless NICs. +device awi # BayStack 660 and others +device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. +#device wl # Older non 802.11 Wavelan wireless NIC. + + Support for various wireless cards. + + device mem # Memory and kernel memory devices + + The system memory devices. + + device io # I/O device + + This option allows a process to gain I/O privileges. This is + useful in order to write userland programs that can handle hardware + directly. This is required to run the X Window system. + + device random # Entropy device + + Cryptographically secure random number generator. + device ether # Ethernet support ether is only needed if you have an Ethernet @@ -1247,31 +1285,27 @@ device sn0 at isa? port 0x300 irq 10 &os; 4.X use the line pseudo-device ether. - device sl 1 # Kernel SLIP + device sl # Kernel SLIP 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. The - number after sl - specifies how many simultaneous SLIP sessions to support. + for modem-to-modem connection, and more powerful. With &os; 4.X use the line pseudo-device sl. - device ppp 1 # Kernel PPP + device ppp # Kernel PPP 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. The number after - ppp specifies how many simultaneous PPP - connections to support. With &os; 4.X use the line + such as demand dialing. + With &os; 4.X use the line pseudo-device ppp. device tun # Packet tunnel. - This is used by the userland PPP software. A - number after tun - specifies the number of simultaneous PPP sessions to support. See + This is used by the userland PPP software. + See the PPP section of this book for more information. With &os; 4.X use the line pseudo-device tun. @@ -1283,14 +1317,16 @@ device pty # Pseudo-ttys (telnet etc) It is used by incoming telnet and rlogin sessions, xterm, and some other applications such - as Emacs. Under &os; 4.X, you + as Emacs. + + Under &os; 4.X, you have to use the line pseudo-device pty number. The number after pty indicates the number of ptys to create. If you need more than the default of 16 simultaneous xterm windows and/or remote logins, be sure to increase this number accordingly, - up to a maximum of 256. + up to a maximum of 256. device md # Memory disks @@ -1336,23 +1372,35 @@ device bpf # Berkeley packet filter # USB support #device uhci # UHCI PCI->USB interface #device ohci # OHCI PCI->USB interface -#device usb # USB Bus (required) -#device ugen # Generic -#device uhid # Human Interface Devices -#device ukbd # Keyboard -#device ulpt # Printer -#device umass # Disks/Mass storage - Requires scbus and da -#device ums # Mouse +device usb # USB Bus (required) +#device udbp # USB Double Bulk Pipe devices +device ugen # Generic +device uhid # Human Interface Devices +device ukbd # Keyboard +device ulpt # Printer +device umass # Disks/Mass storage - Requires scbus and da +device ums # Mouse +device urio # Diamond Rio 500 MP3 player +device uscanner # Scanners # USB Ethernet, requires mii -#device aue # ADMtek USB ethernet -#device cue # CATC USB ethernet -#device kue # Kawasaki LSI USB ethernet +device aue # ADMtek USB Ethernet +device axe # ASIX Electronics USB Ethernet +device cue # CATC USB Ethernet +device kue # Kawasaki LSI USB Ethernet +device rue # RealTek RTL8150 USB Ethernet Support for various USB devices. + # FireWire support +device firewire # FireWire bus code +device sbp # SCSI over FireWire (Requires scbus and da) +device fwe # Ethernet over FireWire (non-standard!) + + Support for various Firewire devices. + For more information and additional devices supported by &os;, see - /usr/src/sys/i386/conf/LINT. + /usr/src/sys/i386/conf/NOTES. Large Memory Configurations (<acronym>PAE</acronym>) @@ -1460,9 +1508,9 @@ device bpf # Berkeley packet filter MAKEDEV - If you are running &os; 5.0 or later + If you are running &os; 5.0 or later you can safely skip this section. These versions use - &man.devfs.5; to allocate device nodes transparently for the user. + &man.devfs.5; to allocate device nodes transparently for the user. Almost every device in the kernel has a corresponding node entry in the /dev directory. @@ -1539,14 +1587,13 @@ device bpf # Berkeley packet filter give it your kernel description, you have probably made a simple error somewhere. Fortunately, &man.config.8; will print the line number that it - had trouble with, so you can quickly skip to it with - vi. For example, if you see: + had trouble with, so that you can quickly locate the line + containing the error. For example, if you see: config: line 17: syntax error - You can skip to the problem in vi by - typing 17G in command mode. Make sure the - keyword is typed correctly, by comparing it to the + Make sure the + keyword is typed correctly by comparing it to the GENERIC kernel or another reference. @@ -1557,11 +1604,11 @@ device bpf # Berkeley packet filter If the make command fails, it usually - signals an error in your kernel description, but not severe - enough for &man.config.8; to catch it. Again, look + signals an error in your kernel description which is not severe + enough for &man.config.8; to catch. Again, look over your configuration, and if you still cannot resolve the problem, send mail to the &a.questions; with your kernel - configuration, and it should be diagnosed very quickly. + configuration, and it should be diagnosed quickly. @@ -1579,6 +1626,11 @@ device bpf # Berkeley packet filter Since securelevel 1 or higher prevents unsetting the immutable flag for any files on the system, the kernel installation needs to be performed at securelevel 0 or lower. + + The above only applies to &os; 4.X and earlier versions. + &os; 5.X, along with later versions, does not set the + immutable flag on the kernel and a failure to install a + kernel probably indicates a more fundamental problem. @@ -1592,10 +1644,10 @@ device bpf # Berkeley packet filter an excellent mechanism for recovering from incompatible kernels. Simply choose the kernel you want to boot from at the &os; boot loader. You can access this when the system - counts down from 10. Hit any key except for the + counts down from 10 at the boot menu. Hit any key except for the Enter key, type unload and then type - boot kernel.old, + boot /boot/kernel.old/kernel, or the filename of any other kernel that will boot properly. When reconfiguring a kernel, it is always a good idea to keep a kernel that is known to work on hand. @@ -1616,8 +1668,14 @@ device bpf # Berkeley packet filter new kernel, kernel.old is overwritten with the last installed kernel which may be non-functional. Also, as soon as possible, move the working kernel to the - proper kernel location or commands such - as &man.ps.1; will not work properly. The proper command to + proper /boot/kernel location or commands such + as &man.ps.1; may not work properly. To do this, simply + rename the directory containing the good kernel: + + &prompt.root; mv /boot/kernel /boot/kernel.bad +mv /boot/kernel.good /boot/kernel + + For versions of &os; prior to 5.X, the proper command to unlock the kernel file that make installs (in order to move another kernel back permanently) is: @@ -1637,10 +1695,7 @@ device bpf # Berkeley packet filter be moved or tampered with: &prompt.root; chflags schg /kernel - - In &os; 5.X, kernels are not installed with the - system immutable flag, so this is unlikely to be the source - of the problem you are experiencing. + @@ -1651,10 +1706,12 @@ device bpf # Berkeley packet filter If you have installed a different version of the kernel from the one that the system utilities have been built with, - for example, a 4.X kernel on a 3.X system, many system-status + for example, a 5.X kernel on a 4.X system, many system-status commands like &man.ps.1; and &man.vmstat.8; will not work any - more. You must recompile the libkvm - library as well as these utilities. This is one reason it is + more. You should recompile and install + a world built with the same version of the source tree as + your kernel. + This is one reason it is not normally a good idea to use a different version of the kernel from the rest of the operating system.