diff --git a/zh_TW.Big5/books/handbook/kernelconfig/chapter.sgml b/zh_TW.Big5/books/handbook/kernelconfig/chapter.sgml index 5615d71d15..5cbb5c8508 100644 --- a/zh_TW.Big5/books/handbook/kernelconfig/chapter.sgml +++ b/zh_TW.Big5/books/handbook/kernelconfig/chapter.sgml @@ -1,1669 +1,1424 @@ Jim Mock 更新、重排: Jake Hamby 原作為: 設定 FreeBSD Kernel 概述 kernel building a custom kernel kernel 是整個 &os; 作業系統的核心。 它控制了系統的整體運作,包含和記憶體管理、安全控管、網路、硬碟存取等等。 - 儘管目前 &os; 大多可以用動態 module 來載入、卸載所需功能,但有時候仍有必要學會重新調配 kernel。 + 儘管目前 &os; 大多可以用動態 module 來載入、卸載所需功能, + 但有時候仍有必要學會重新調配 kernel。 讀完這章,您將了解︰ 為何需要重新調配、編譯 kernel? 要怎麼修改 kernel 設定檔? 如何以 kernel 設定檔來建立、編譯新的 kernel 呢? 如何安裝新的 kernel。 - - 如何在 /dev 下來安裝新的硬體。 - - 如何處理 kernel 錯誤無法開機的情形。 本章所舉例的相關指令都是以 root 權限來進行。 為何需要重新調配、編譯 kernel? 早期的 &os; 的 kernel 被戲稱為 monolithic kernel。 這意思是說當時的 kernel 是個大塊頭程式,且只支援固定的硬體而已。 如果您想改變 kernel 的設定,那麼必須編譯一個新的並重新開機,才能啟用。 現在的 &os; 已快速成長到新型態的管理模式,其重要特色是: - kernel 功能可以隨時依據需求,而以動態載入或卸載相關的 kernel module。 - 這使得 kernel 能夠快速因應新的環境而作調整(有點像是:筆記型電腦上的 PCMCIA 卡一樣即插即用) - ,或是增加其他原本的預設 kernel(GENERIC) 所沒有的功能。 + kernel 功能可以隨時依據需求, + 而以動態載入或卸載相關的 kernel module。 + 這使得 kernel 能夠快速因應新的環境而作調整 + (有點像是:筆記型電腦上的 PCMCIA 卡一樣即插即用) + ,或是增加其他原本的預設 kernel(GENERIC)所沒有的功能。 這種模式,就叫做 modular kernel(核心模組)。 儘管如此,還是有一些功能仍須編譯在 kernel 內才行。因為有時候是因為這些功能與 kernel 結合的相當複雜緊密,而無法將它們弄成可動態載入的 module ;而有時候,則是因為沒有人有空來弄那些 kernel module 的實作。 重新調配、編譯 kernel 幾乎是每位 BSD 使用者所必須經歷的過程。 儘管這項工作可能比較耗時,但在 &os; 的使用上會有許多好處。 - 跟必須支援大多數各式硬體的 GENERIC kernel 相比的話,自行調配 kernel 不同處在於:可以更『體貼』,只支援『自己硬體』的部分就好。 + 跟必須支援大多數各式硬體的 GENERIC kernel 相比的話, + 自行調配 kernel 不同處在於:可以更『體貼』,只支援『自己硬體』的部分就好。 好處在於,譬如︰ - 開機速度更快:因為自行調配的 kernel 只需要偵測您系統上的硬體,所以讓啟動所花的過程更流暢快速。 + 開機速度更快:因為自行調配的 kernel 只需要偵測您系統上的硬體, + 所以讓啟動所花的過程更流暢快速。 - 佔用的記憶體更少:自行調配的 kernel 通常會比 GENERIC 核心使用更少的記憶體, - 由於 kernel 必須一直存放在記憶體內,因此這就顯得更加重要。因此,對於記憶體較小的系統來說,自行調配的 kernel 就可發揮更多的作用、揮灑空間。 + 佔用的記憶體更少:自行調配的 kernel 通常會比 + GENERIC 核心使用更少的記憶體,由於 kernel + 必須一直存放在記憶體內,因此這就顯得更加重要。因此, + 對於記憶體較小的系統來說, + 自行調配的 kernel 就可發揮更多的作用、揮灑空間。 - 可支援更多硬體:您可在自行調配的 kernel 增加一些原本 GENERIC 核心沒有提供的硬體支援,像是音效卡之類的。 + 可支援更多硬體:您可在自行調配的 kernel 增加一些原本 + GENERIC 核心沒有提供的硬體支援,像是音效卡之類的。 + + + + + Tom + Rhodes + Written by + + + + 探測系統硬體 + + 在進行 kernel 設定的探索之旅前, + 先把該機器各項硬體資訊作點調查會是明智之舉。 + 若 &os; 並非主要的作業系統,那麼也可以輕鬆透過目前所使用的作業系統, + 來查看相關硬體資訊表。 舉例來說,µsoft; 的 + 裝置管理員(Device Manager) + 內通常會有目前有裝的硬體資訊。 而 裝置管理員 + 是在控制台。 + + + µsoft.windows; 某些版本則是先透過 + 系統(System) 再進入 + 裝置管理員 + + + 若該機器尚未安裝任何作業系統,那麼就要親自找出相關硬體資訊。 + 其中一種方式是透過 &man.dmesg.8; 以及 &man.man.1;。 &os; + 上大多硬體都會有相關的 man 說明有支援的規格型號, + 並且開機的偵測過程中,也會列出有找到的硬體。 舉個例子, + 下面這幾行是說有偵測到滑鼠,並且是以 psm + 驅動程式: + + psm0: <PS/2 Mouse> irq 12 on atkbdc0 +psm0: [GIANT-LOCKED] +psm0: [ITHREAD] +psm0: model Generic PS/2 mouse, device ID 0 + + 驅動程式必須要在自訂的 kernel 設定檔內加入,或者是用 + &man.loader.conf.5;。 + + dmesg 有時只顯示系統訊息而沒有開機偵測的部份, + 遇到這種情況請查閱 /var/run/dmesg.boot 檔。 + + 另外也可以透過 &man.pciconf.8; 來列出更詳細的相關資訊。 + 舉例說明: + + 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 + + 上面顯示是透過 pciconf + 所看到的 ath 無線網卡驅動程式。 可以用 + man ath 來查看 + &man.ath.4; 的相關說明。 + + 在使用 &man.man.1; 時,加上 + 參數也可以提供比較精準的資訊。 以上述例子而言,可以改為打: + + &prompt.root; man -k Atheros + + 就會列出有含上述關鍵字的相關 man 說明: + + ath(4) - Atheros IEEE 802.11 wireless network driver +ath_hal(4) - Atheros Hardware Access Layer (HAL) + + 知己知彼,先瞭解相關硬體環境,才能讓接下來的自訂 kernel + 打造過程更為順利。 + + 重新調配、編譯 kernel kernel building / installing - 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 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 - 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 - 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 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. 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. + 首先對 kernel 相關目錄作快速介紹。 + 這裡所提到的所有目錄都在 /usr/src/sys 內, + 也可以用 /sys 這個 symbolic link 來連到這。 + 這裡的許多子目錄分別擺放 kernel 的各組成部分,但對打造 kernel + 影響最重要的目錄是 + arch/conf, + 這裡是可以針對需求來修改自訂 kernel 相關設定。 + 此外,還有在編譯 kernel 過程中會暫時擺放的 compile + 目錄。 + 剛講到的 arch 可以是右列架構之一: + i386alpha、 + amd64ia64、 + powerpcsparc64、 + pc98(在日本較流行的另一種 PC 硬體架構)。 + 在各特定硬體架構目錄的東西,只搭配相對應的硬體架構而已。 + 而其餘的原始碼則是與硬體架構無關,可以在所有 &os; 可裝的平台上共用。 + 整體目錄架構都是有邏輯可循,像是各項有支援的硬體設備、檔案系統, + 以及相關選項通常都會擺在它們自己的子目錄內。 + + 本章所用到的例子,都是你使用 i386 架構的機器。 + 請依實際情況,對相關目錄作調整即可。 - If there is not a - /usr/src/sys directory on your system, - then the kernel source has not been installed. The easiest - way to do this is by running - sysinstall (/stand/sysinstall - in &os; versions older than 5.2) as - root, choosing - Configure, then - Distributions, then - src, then - sys. If you have an aversion to - sysinstall and you have access to - an official &os; CDROM, then you can also - install the source from the command line: + 若您系統上 沒裝 + /usr/src/sys 目錄, + 也就是說沒裝 kernel source code 的話,那麼最簡單安裝方式就是以 + root 權限來執行 sysinstall, + 接著請選 Configure,然後選 + Distributions 接著為 + src 再選 + base 最後選 + sys。 若不喜歡用 + sysinstall 而且手邊有 + 正式的 &os; 光碟可以用的話, + 那麼也可以用以下指令來安裝: &prompt.root; mount /cdrom &prompt.root; mkdir -p /usr/src/sys &prompt.root; ln -s /usr/src/sys /sys -&prompt.root; cat /cdrom/src/ssys.[a-d]* | tar -xzvf - +&prompt.root; cat /cdrom/src/ssys.[a-d]* | tar -xzvf - +&prompt.root; cat /cdrom/src/sbase.[a-d]* | tar -xzvf - - Next, move to the - arch/conf directory - and copy the GENERIC configuration file to the - name you want to give your kernel. For example: + 接下來,切換到 + arch/conf 目錄, + 複製 GENERIC 設定檔為你想稱呼的新 kernel 名稱。 + 例如: &prompt.root; cd /usr/src/sys/i386/conf &prompt.root; cp GENERIC MYKERNEL - Traditionally, this name is in all capital letters and, if you - are maintaining multiple &os; machines with different hardware, - it is a good idea to name it after your machine's hostname. We will - call it MYKERNEL for the purpose of this - example. + 通常,命名方式都是大寫。如果你負責維護許多不同硬體架構的 &os; + 機器的話,那麼照該機器名稱(hostname)來命名會是比較明智。 + 上面例子中之所以命名為 MYKERNEL + 就是因為這緣故。 - Storing your kernel configuration 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. After doing this, - it usually only takes a few seconds for - you to realize that you have deleted your custom kernel - configuration 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 configuration file - elsewhere, and then create a symbolic link to the file in - the i386 - directory. - - For example: + 建議不要把改過的 kernel 設定檔直接放在 + /usr/src。 因為若編譯遇到其他問題時, + 直接砍掉 /usr/src 再重練, + 可能會是比較乾脆的選擇之一。 + 一旦真的砍了之後,你可能幾秒之後才會醒悟到: + 你同時也砍掉自己改的 kernel 設定檔。 + 此外,也不要直接修改 GENERIC,因為下次你 + 更新 source tree時, + 它會被新版覆蓋,而相關修改也將隨之而逝。 + + 你也可考慮把 kernel 設定檔改放到其他地方,然後再到 + i386 + 目錄內建個指向它的 symbolic link。 + + 舉例: &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 - 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 - explain here, but is covered well in many books in the bibliography. However, &os; does - offer an easier editor called ee which, if - you are a beginner, should be your editor of choice. Feel free to - change the comment lines at the top to reflect your configuration or - the changes you have made to differentiate it from - GENERIC. + 現在,就開始用自己喜歡的編輯器來修改 MYKERNEL。 + 若才剛裝好 FreeBSD 而已,唯一可用的編輯器很可能是 + vi 了,由於它的用法很多種,礙於篇幅將不詳細介紹, + 你可在 參考書目 內找到相關書籍。 + 不過,&os; 也提供另一個更好用的編輯器,它叫做 + ee,對新手而言,這可能是蠻好的選擇。 + 你可以任意修改檔案內的相關註解以說明相關設定為何, + 或者其他想改的 GENERIC 設定內容。 SunOS - If you have built a kernel under &sunos; or some other BSD - operating system, much of this file will be very familiar to you. - If you are coming from some other operating system such as DOS, on - the other hand, the GENERIC configuration file - might seem overwhelming to you, so follow the descriptions in the - Configuration File - section slowly and carefully. + 若你有在 &sunos; 或者其他種 BSD 作業系統下進行編譯 kernel 的經驗, + 那麼應該已經很熟悉本篇所介紹的大部分步驟。 + 換句話說,若您之前用的是 DOS 這類作業系統,那麼 + GENERIC 設定檔的內容就可能比較難懂些,沒關係, + 我們將在下面的 kernel 設定 + 會循序漸進地介紹。 - If you sync your source tree with the - 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. + 若有從 &os; 計劃去 更新你的 source tree 的話, + 則切記在進行任何升級之前,務必要察看 + /usr/src/UPDATING。 + 這檔會介紹在更新過程中的重大議題或要注意的事項。 + 由於 /usr/src/UPDATING 是對應於你機器上目前的 + &os; source code 版本,因此會提供比本手冊更新的內容。 - 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; that you are - running. - - - - If you have installed only the kernel - source code, use procedure 1. - - - - If you are running a &os; version prior to 4.0, and you are - not upgrading to &os; 4.0 or higher using - the make buildworld procedure, use procedure 1. - - - - - If you are building a new kernel without updating the source - code (perhaps just to add a new option, such as - IPFIREWALL) you can use either procedure. - - - - If you are rebuilding the kernel as part of a - make buildworld process, use procedure 2. - - - - - - cvsup - - 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 吧。 - Procedure 1. Building a Kernel the <quote>Traditional</quote> Way - - - Run &man.config.8; to generate the kernel source code. - - &prompt.root; /usr/sbin/config MYKERNEL - - - - 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; versions prior to 5.0, use the following form instead: - - &prompt.root; cd ../../compile/MYKERNEL - - - - Compile the kernel. - - &prompt.root; make depend -&prompt.root; make - + 編譯 Kernel - Install the new kernel. - - &prompt.root; make install - - + 請切換至 /usr/src 目錄: - - Procedure 2. Building a Kernel the <quote>New</quote> - Way - - - Change to the /usr/src directory. - &prompt.root; cd /usr/src - Compile the kernel. - + 編譯 kernel: + &prompt.root; make buildkernel KERNCONF=MYKERNEL - Install the new kernel. + 安裝新 kernel: &prompt.root; make installkernel KERNCONF=MYKERNEL - + - This method of kernel building requires full source files. If you - only installed the kernel source, use the traditional method, as - described above. + 要有完整的 &os; source tree 才能編譯 kernel。 - By default, when you build a custom kernel, - all kernel modules will be rebuilt as well. - If you want to update a kernel faster or to build only custom - modules, you should edit /etc/make.conf - before starting to build the kernel: + 預設情況下,在編譯自訂 kernel 時,全部的 + kernel modules 也會一起重編。 若要快速升級 kernel, + 或是只想重編所需的 kernel module,那麼在編譯 kernel 前要先改一下 + /etc/make.conf,比如: MODULES_OVERRIDE = linux acpi sound/sound sound/driver/ds1 ntfs - This variable sets up a list of modules to build instead - of all of them. For other variables which you may find useful - in the process of building kernel, refer to &man.make.conf.5; - manual page. - + 上面該設定值為所希望重編的 kernel module 列表。 - - In &os; 4.2 and older you must replace - KERNCONF= with KERNEL=. - 4.2-STABLE that was fetched before Feb 2nd, 2001 does not - recognize KERNCONF=. - + WITHOUT_MODULES = linux acpi sound/sound sound/driver/ds1 ntfs + + 而上面這設定值則為不要編入的 kernel module 列表。 若想更瞭解其他 + kernel 編譯的相關變數,請參閱 &man.make.conf.5; 說明。 + /boot/kernel.old - 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 that you may find useful. Be sure to read the - section which explains how to recover in case your new kernel does not boot. + 新的 kernel 會複製到 /boot/kernel 目錄內的 + /boot/kernel/kernel,而舊的則移至 + /boot/kernel.old/kernel。 + 現在呢,先關機,然後就會以新 kernel 重開機 + 若有問題的話,本章後面會介紹一些疑難雜症來協助你。 + 若新 kernel 無法開機的話,請參閱 這裡 以恢復系統運作。 - 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 stored in - /boot. Third party or custom modules - 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 - or incorrectness. - - - - 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 them. For more information, take a look at Making Device Nodes - section later on in this chapter. + 至於開機過程的其他相關檔案、設定,比如 &man.loader.8; + 及其設定,則放在 /boot。 + Third party 或自訂的 kernel modules 則會放在 + /boot/kernel,不過, + 應注意要保持 kernel module 與 kernel 是否有同步, + 這點很重要,否則會導致不穩或出問題。 Joel Dahl - Updated for &os; 5.X by - + Updated for &os; 6.X by - - The Configuration File + kernel 設定檔解說 kernel NOTES - - kernel - LINT - NOTES - LINT kernel configuration file - The general format of a configuration file is quite simple. - Each line contains a keyword and one or more arguments. For - simplicity, most lines only contain one argument. Anything - following a # is considered a comment and - ignored. The following sections describe each keyword, in - the order they are listed in GENERIC. + kernel 設定檔的內容格式相當簡單。 + 每一行都包括一個關鍵字,以及一個或多個參數。事實上, + 很多行大多只有一個參數。任何以 # + 開頭的敘述都將被視為註解而被忽略。 + 接下來將以在 GENERIC 所出現的順序一一介紹之。 For an exhaustive list of architecture - dependent options and devices, see the NOTES - file in the same directory as GENERIC. For - architecture independent options, see - /usr/src/sys/conf/NOTES. + id="kernelconfig-options">若要看與該平台架構有關的各選項、設備列表, + 請參閱與 GENERIC 檔同目錄的 NOTES + 檔。 而與平台架構差異較無關的通用部份,則可參閱 + /usr/src/sys/conf/NOTES - 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: + 若為了測試,而需要一份含有所有可用設定的設定檔,那麼請以 + root 身份下: &prompt.root; cd /usr/src/sys/i386/conf && make LINT kernel configuration file - 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 + 下面為 GENERIC 設定檔的範例, + 其中包括說明用的註釋。 這例子應該與您機器上的 /usr/src/sys/i386/conf/GENERIC - fairly closely. + 相當接近。 kernel options machine machine i386 - This is the machine architecture. It must be either - alpha, amd64, - i386, ia64, - pc98, powerpc, or - sparc64. + 此處是指機器架構,必須為 + alphaamd64、 + i386ia64、 + pc98powerpc、 + sparc64 其中之一。 kernel options cpu cpu I486_CPU 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 (if, for - example, you are not sure whether you should use - I586_CPU or I686_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 - messages. + 上面設定是指定要用哪一種 CPU 型號。 也可以同時加上多組 CPU 型號 + (比如說萬一不確定是否要用 I586_CPU 或 + I686_CPU)。 然而自訂 kernel 的話,建議先確認自己的 + CPU 型號,然後只用最適合的那組就好了。 若不確定 CPU 到底是用哪一種, + 可以查閱 /var/run/dmesg.boot + 的開機訊息以確定。 kernel options - cpu type - - Support for I386_CPU is still provided in the - source of &os;, but it is disabled by default in both -STABLE and - -CURRENT. This means that to install &os; with a 386-class cpu, you now - have the following options: - - - - Install an older &os; release and rebuild from source as - described in . - - - Build the userland and kernel on a newer machine and install on - the 386 using the precompiled /usr/obj - files (see for details). - - - - 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 which, on a 386-class machine, may be - difficult to find. - - - kernel options ident ident GENERIC - This is the identification of the kernel. You should change - this to whatever you named your kernel, - i.e. MYKERNEL if you have followed the - 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 (e.g., you want to - build an experimental kernel). + 這是設定該 kernel 名稱為何,可以隨意命名之,像是取名為 + MYKERNEL,若是有照先前說明來作大概會取這樣名字。 + ident 後面的字串會在開機時顯示,因此若要辨認新 kernel + 與常用 kernel 的話,就設定不同組名稱即可(比如在自訂實驗用的 + kernel)。 #To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. - In &os; 5.X and newer versions the &man.device.hints.5; is - used to configure options of the device drivers. The default - location that &man.loader.8; will check at boot time is - /boot/device.hints. Using the - hints option you can compile these hints - statically into your kernel. Then there is no need to create a - device.hints file in - /boot. + &man.device.hints.5; 可用來設定各項驅動程式的選項。 + 開機時 &man.loader.8; 會檢查預設的 /boot/device.hints + 設定檔。 使用 hints 選項,就可以把這些 hints + 靜態編入 kernel 內。 如此一來就不必在 /boot + 內建立 device.hints 檔。 - #makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols - - The normal build process of &os; does not include - debugging information when building the kernel and strips most - symbols after the resulting kernel is linked, to save some space - at the install location. If you are going to do tests of kernels - in the -CURRENT branch or develop changes of your own for the &os; - kernel, you might want to uncomment this line. It will enable the - 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 - for more information). + makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols + + 加上 選項的話,&os; 會在編譯過程加上 debug + 用的資訊,透過這選項會讓 &man.gcc.1; 啟用 debug + 所會用到的相關資訊。 options SCHED_4BSD # 4BSD scheduler - 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. + &os;. 傳統所用(並且是預設)的系統 CPU scheduler。 若您不清楚要如何設定 + ,請保留這設定。 + + options PREEMPTION # Enable kernel thread preemption + + 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. options INET # InterNETworking 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. options INET6 # IPv6 communications protocols This enables the IPv6 communication protocols. options FFS # Berkeley Fast Filesystem This is the basic hard drive file system. Leave it in if you boot from the hard disk. 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 functionality is provided by the kernel, it must be turned on for specific disks. Review the output from &man.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 &man.tunefs.8; (for existing file systems) or &man.newfs.8; (for new file systems) commands. options UFS_ACL # Support for access control lists - This option, present only in &os; 5.X, enables kernel support + 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 . 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. options UFS_DIRHASH # Improve performance on big directories 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 &os; on a smaller system where memory is at a premium and disk access speed is less important, such as a firewall. options MD_ROOT # MD is a potential root device This option enables support for a memory backed virtual disk used as a root device. kernel options NFS kernel options NFS_ROOT options NFSCLIENT # Network Filesystem Client options NFSSERVER # Network Filesystem Server options NFS_ROOT # NFS usable as /, requires NFSCLIENT The network file system. Unless you plan to mount partitions from a &unix; file server over TCP/IP, you can comment these out. kernel options MSDOSFS options MSDOSFS # MSDOS Filesystem 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). options CD9660 # ISO 9660 Filesystem 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. - options PROCFS # Process filesystem + options PROCFS # Process filesystem(requires PSEUDOFS) 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 and above, use of PROCFS + 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: 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: + PROCFS: installs will not mount this file + system by default. options PSEUDOFS # Pseudo-filesystem framework - PSEUDOFS is not available in &os; 4.X. + 6.X kernels making use of PROCFS must also + include support for PSEUDOFS. 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!] Compatibility with 4.3BSD. Leave this in; some programs will act strangely if you comment this out. options COMPAT_FREEBSD4 # Compatible with &os;4 This option is required on &os; 5.X &i386; and Alpha systems to support applications compiled on older versions of &os; 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. - options SCSI_DELAY=15000 # Delay (in ms) before probing SCSI + options COMPAT_FREEBSD5 # 與 &os;5 相容 + + 此行是 &os; 6.X 及更新的版本若需支援 &os; 5.X + 系統呼叫才需要設定。 + + options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI - This causes the kernel to pause for 15 seconds before probing + 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 will probably want to lower this - number, perhaps to 5 seconds, to speed up booting. Of course, if + you can ignore this, otherwise you can try to lower this + number, to speed up booting. Of course, if you do this and &os; has trouble recognizing your SCSI devices, you will have to raise it again. options KTRACE # ktrace(1) support This enables kernel process tracing, which is useful in debugging. options SYSVSHM # SYSV-style shared memory 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. options SYSVMSG # SYSV-style message queues Support for System V messages. This option only adds a few hundred bytes to the kernel. options SYSVSEM # SYSV-style semaphores Support for System V semaphores. Less commonly used but only adds a few hundred bytes to the kernel. The option of the &man.ipcs.1; command will list any processes using each of these System V facilities. 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;). options KBD_INSTALL_CDEV # install a CDEV entry in /dev - This option is related to the keyboard. It installs a CDEV entry - in /dev. - - 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. - - This helps debugging by printing easier register definitions for - reading. + This option is required to allow the creation of keyboard device + nodes in /dev. options ADAPTIVE_GIANT # Giant mutex is adaptive. 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 &os; 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. + + + kernel options SMP device apic # I/O APIC 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. - device isa - - 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) system, &os; provides only - limited support at this time. For more information about the - MCA support, see - /usr/src/sys/i386/conf/NOTES. + + apic 只限 i386 架構才有,其他架構則不必加上這行。 + device eisa Include this if you have an EISA motherboard. This enables auto-detection and configuration support for all devices on the EISA bus. device pci Include this if you have a PCI motherboard. This enables auto-detection of PCI cards and gatewaying from the PCI to ISA bus. # Floppy drives device fdc This is the floppy drive controller. # 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 PCI ATA/ATAPI devices on modern machines. device atadisk # ATA disk drives 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 This is needed along with device ata for ATAPI CDROM drives. device atapifd # ATAPI floppy drives This is needed along with device ata for ATAPI floppy drives. device atapist # ATAPI tape drives This is needed along with device ata for ATAPI tape drives. options ATA_STATIC_ID # Static device numbering 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 +options AHC_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~128k to driver. device ahd # AHA39320/29320 and onboard AIC79xx devices +options AHD_REG_PRETTY_PRINT # Print register bitfields in debug + # output. Adds ~215k to driver. device amd # AMD 53C974 (Teckram DC-390(T)) device isp # Qlogic family +device ispfw # Firmware for QLogic HBAs- normally a module device mpt # LSI-Logic MPT-Fusion #device ncr # NCR/Symbios Logic -device sym # NCR/Symbios Logic (newer chipsets) +device sym # NCR/Symbios Logic (newer chipsets + those of `ncr') device trm # Tekram DC395U/UW/F DC315U adapters 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. + altogether. The *_REG_PRETTY_PRINT lines are + debugging options for their respective drivers. # SCSI peripherals 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 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. The USB &man.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. # RAID controllers interfaced to the SCSI subsystem device amr # AMI MegaRAID device arcmsr # Areca SATA II RAID 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 hptmv # Highpoint RocketRAID 182x +device rr232x # Highpoint RocketRAID 232x 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 mfi # LSI MegaRAID SAS 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 atkbdc # AT keyboard controller 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). 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 psm # PS/2 mouse Use this device if your mouse plugs into the PS/2 mouse port. + device kbdmux # keyboard multiplexer + + 多重鍵盤的支援。 若不打算同時接多組鍵盤的話, + 那麼若要移除該行也沒關係。 + device vga # VGA video card driver The video card driver. - # splash screen/screen saver + 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. + too. # syscons is the default console driver, resembling an SCO console device sc 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. # 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 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. device agp 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. - # Floating point support - do not disable. -device npx - - 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. - APM # Power management support (see NOTES for more options) #device apm 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 # 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 sio # 8250, 16[45]50 based serial ports 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 &os;. If you have a multiport serial card, check the manual page for &man.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. # Parallel port device ppc This is the ISA-bus parallel port interface. device ppbus # Parallel port bus (required) Provides support for the parallel port bus. device lpt # Printer Support for parallel port printers. All three of the above are required to enable parallel printer support. device plip # TCP/IP over parallel This is the driver for the parallel network interface. device ppi # Parallel port interface device The general-purpose I/O (geek port) + IEEE1284 I/O. #device vpo # Requires scbus and da zip drive This is for an Iomega Zip drive. It requires 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 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, 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. - device bfe # Broadcom BCM440x 10/100 Ethernet + device bce # Broadcom BCM5706/BCM5708 Gigabit Ethernet +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 lge # Level 1 LXT1001 gigabit ethernet +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet device nge # NatSemi DP83820 gigabit ethernet +device nve # nVidia nForce MCP on-board Ethernet Networking 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 stge # Sundance/Tamarack TC9021 gigabit Ethernet device ti # Alteon Networks Tigon I/II gigabit Ethernet device tl # Texas Instruments ThunderLAN device tx # SMC EtherPower II (83c170 EPIC) device vge # VIA VT612x gigabit ethernet 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. 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/NOTES for details of which cards are supported by which driver. # Wireless NIC cards -device wlan # 802.11 support +device wlan # 802.11 support + + 對 802.11 標準的支援。 若要無線上網,則需加上這行。 + + device wlan_wep # 802.11 WEP support +device wlan_ccmp # 802.11 CCMP support +device wlan_tkip # 802.11 TKIP support + + 對 802.11 加密設備的支援。 若要安全加密以及 802.11i 安全協定, + 則需加上這行。 + + device an # Aironet 4500/4800 802.11 wireless NICs. +device ath # Atheros pci/cardbus NIC's +device ath_hal # Atheros HAL (Hardware Access Layer) +device ath_rate_sample # SampleRate tx rate control for ath device an # Aironet 4500/4800 802.11 wireless NICs. device awi # BayStack 660 and others +device ral # Ralink Technology RT2500 wireless NICs. device wi # WaveLAN/Intersil/Symbol 802.11 wireless NICs. #device wl # Older non 802.11 Wavelan wireless NIC. Support for various wireless cards. # 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. 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 - loop. - - 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. + this device. This is mandatory. device random # Entropy device Cryptographically secure random number generator. device ether # Ethernet support ether is only needed if you have an Ethernet - card. It includes generic Ethernet protocol code. Under - &os; 4.X use the line pseudo-device - ether. + card. It includes generic Ethernet protocol code. 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. - With &os; 4.X use the line pseudo-device - sl. + for modem-to-modem connection, and more powerful. 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. - With &os; 4.X use the line - pseudo-device ppp. + such as demand dialing. device tun # Packet tunnel. 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. + information. device pty # Pseudo-ttys (telnet etc) 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. - 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. - device md # Memory disks - Memory disk pseudo-devices. With &os; 4.X use the - line pseudo-device md. + Memory disk pseudo-devices. device gif # IPv6 and IPv4 tunneling This implements IPv6 over IPv4 tunneling, IPv4 over IPv6 tunneling, - IPv4 over IPv4 tunneling, and IPv6 over IPv6 tunneling. Beginning with - &os; 4.4 the gif device is - auto-cloning, and you should use the line - pseudo-device gif. - Earlier versions of &os; 4.X require a number, for example - pseudo-device gif 4. + IPv4 over IPv4 tunneling, and IPv6 over IPv6 tunneling. The + gif device is + auto-cloning, and will create device nodes as + needed. device faith # IPv6-to-IPv4 relaying (translation) This pseudo-device captures packets that are sent to it and - diverts them to the IPv4/IPv6 translation daemon. With - &os; 4.X use the line - pseudo-device faith 1. + diverts them to the IPv4/IPv6 translation daemon. # The `bpf' device enables the Berkeley Packet Filter. # Be aware of the administrative consequences of enabling this! # Note that 'bpf' is required for DHCP. device bpf # Berkeley packet filter 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 &man.tcpdump.1; - program. With &os; 4.X use the line - pseudo-device bpf. + program. The &man.bpf.4; device is also used by &man.dhclient.8; to obtain the IP address of the default router (gateway) and so on. If you use DHCP, leave this uncommented. # USB support device uhci # UHCI PCI->USB interface device ohci # OHCI PCI->USB interface -#device ehci # EHCI PCI->USB interface (USB 2.0) +device ehci # EHCI PCI->USB interface (USB 2.0) 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 ural # Ralink Technology RT2500USB wireless NICs device urio # Diamond Rio 500 MP3 player device uscanner # Scanners # USB Ethernet, requires mii device aue # ADMtek USB Ethernet device axe # ASIX Electronics USB Ethernet device cdce # Generic USB over 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/NOTES. Large Memory Configurations (<acronym>PAE</acronym>) Physical Address Extensions (PAE) large memory 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. &os; provides support for this capability via the kernel configuration option, available - in the 4.X series of &os; beginning with 4.9-RELEASE and - in the 5.X series of &os; beginning with 5.1-RELEASE. Due to + in all current release versions of &os;. 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: options PAE The PAE support in &os; is only available for &intel; IA-32 processors. It should also be noted, that the PAE support in &os; has not received wide testing, and should be considered beta quality compared to other stable features of &os;. PAE support in &os; 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 &man.bus.dma.9; interface will cause data corruption in a PAE enabled kernel and are not - recommended for use. For this reason, the + recommended for use. For this reason, a PAE kernel - configuration file is provided in &os; 5.X, which + configuration file is provided in &os; 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 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 kernel option can be used for increasing the KVA space. For performance and stability concerns, it is advised to consult the &man.tuning.7; manual page. The &man.pae.4; manual page contains up-to-date information on &os;'s PAE support. - - Making Device Nodes - - device nodes - - MAKEDEV - - - 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. - - Almost every device in the kernel has a corresponding - node entry in the /dev directory. - These nodes look like regular files, but are actually special - entries into the kernel which programs use to access the device. - The shell script /dev/MAKEDEV, which is - executed when you first install the operating system, creates - nearly all of the device nodes supported. However, it does not - create all of them, so when you add support for - a new device, it pays to make sure that the appropriate entries are - in this directory, and if not, add them. Here is a simple - example: - - Suppose you add the IDE CD-ROM support to the kernel. The line - to add is: - - device acd0 - - This means that you should look for some entries that start with - acd0 in the /dev - directory, possibly followed by a letter, such as - c, or preceded by the letter - r, which means a raw device. It - turns out that those files are not there, so you must change to the - /dev directory and type: - - - MAKEDEV - &prompt.root; sh MAKEDEV acd0 - - When this script finishes, you will find that there are now - acd0c and racd0c entries - in /dev so you know that it executed - correctly. - - For sound cards, the following command creates the appropriate - entries: - - &prompt.root; sh MAKEDEV snd0 - - - When creating device nodes for devices such as sound cards, if - other people have access to your machine, it may be desirable to - protect the devices from outside access by adding them to the - /etc/fbtab file. See &man.fbtab.5; for more - information. - - - Follow this simple procedure for any other - non-GENERIC devices which do not have - entries. - - - All SCSI controllers use the same set of - /dev entries, so you do not need to create - these. Also, network cards and SLIP/PPP pseudo-devices do not - have entries in /dev at all, so you do not - have to worry about these either. - - If Something Goes Wrong There are five categories of trouble that can occur when building a custom kernel. They are: config fails: If the &man.config.8; command fails when you 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 that you can quickly locate the line containing the error. For example, if you see: config: line 17: syntax error Make sure the keyword is typed correctly by comparing it to the GENERIC kernel or another reference. make fails: If the make command fails, it usually 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 quickly. - - Installing the new kernel fails: - - - If the kernel compiled fine, but failed to install - (the make install or - make installkernel command failed), - the first thing to check is if your system is running at - securelevel 1 or higher (see &man.init.8;). The kernel - installation tries to remove the immutable flag from - your kernel and set the immutable flag on the new one. - 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. - - - The kernel does not boot: If your new kernel does not boot, or fails to recognize your devices, do not panic! Fortunately, &os; has 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 at the boot menu. Hit any key except for the - Enter key, type unload + boot menu appears. Select the Escape to a loader + prompt option, number six. At the prompt, type + unload kernel and then type 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. After booting with a good kernel you can check over your configuration file and try to build it again. One helpful resource is the /var/log/messages file which records, among other things, all of the kernel messages from every successful boot. Also, the &man.dmesg.8; command will print the kernel messages from the current boot. If you are having trouble building a kernel, make sure to keep a GENERIC, or some other kernel that is known to work on hand as a different name that will not get erased on the next build. You cannot rely on kernel.old because when installing a 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 /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 &prompt.root; 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: - - &prompt.root; chflags noschg /kernel - If you find you cannot do this, you are probably running - at a &man.securelevel.8; greater than zero. Edit - kern_securelevel in - /etc/rc.conf and set it to - -1, then reboot. You can change it back - to its previous setting when you are happy with your new - kernel. - - And, if you want to lock your new kernel - into place, or any file for that matter, so that it cannot - be moved or tampered with: - - &prompt.root; chflags schg /kernel The kernel works, but &man.ps.1; does not work any more: If you have installed a different version of the kernel from the one that the system utilities have been built with, - for example, a 5.X kernel on a 4.X system, many system-status + for example, a -CURRENT kernel on a -RELEASE, many system-status commands like &man.ps.1; and &man.vmstat.8; will not work any 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. -