最近刚开始学习FreeBSD,在这里潜水一个多星期,受益非浅.
今天准备为配置服务器编译一下内核,便花了1个多小时修改KERNEL文件,东抄西拼,搞了这么一个东东,并加了一点注释,希望能为想编译5.4内核的朋友节省点时间.
另外里面如果有错误,或缺点什么,还请前辈们指点:)
参考的文章:
http://www.freebsd.org.cn/snap/doc/zh_CN.GB2312/books/handbook/kernelconfig-config.html
http://www.freebsdchina.org/forum/viewtopic.php?t=1770&sid=2ec228e0654abacd108efe56bb3e230e
http://chinaunix.net/jh/13/567145.html
以及5.4里面的 /usr/src/sys/i386/conf/NOTES
代码: |
[color=green] # #本文件是在/usr/src/sys/i386/conf/KERNEL的基础上修改而来的. # # GENERIC -- Generic kernel configuration file for FreeBSD/i386 # # For more information on this file, please read the handbook section on # Kernel Configuration Files: # # http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html # # The handbook is also available locally in /usr/share/doc/handbook # if you've installed the doc distribution, otherwise always see the # FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the # latest information. # # An exhaustive list of options and more detailed explanations of the # device lines is also present in the ../../conf/NOTES and NOTES files. # 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.413.2.13 2005/04/02 16:37:58 scottl Exp $ machine i386 #cpu I486_CPU #cpu I586_CPU cpu I686_CPU ident KERNEL1 # To statically compile in device wiring instead of /boot/device.hints #hints "GENERIC.hints" # Default places to look for devices. options SCHED_4BSD # 4BSD scheduler options INET # InterNETworking #options INET6 # IPv6 communications protocols options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories #options MD_ROOT # MD is a potential root device 这个选项将打开以基于内存的虚拟磁盘作为根设备的支持。 #options NFSCLIENT # Network Filesystem Client #options NFSSERVER # Network Filesystem Server #options NFS_ROOT # NFS usable as /, requires NFSCLIENT #options MSDOSFS # MSDOS Filesystem #options CD9660 # ISO 9660 Filesystem 用于 CDROM 的 ISO 9660 文件系统。******************************* #options PROCFS # Process filesystem (requires PSEUDOFS)进程文件系统。 一个挂接在 /proc的“伪装的” 文件系统 #options PSEUDOFS # Pseudo-filesystem framework 这个能删吗??????######### #options GEOM_GPT # GUID Partition Tables.这个选项提供了在一个磁盘上使用大量的分区的能力 options COMPAT_43 # Compatible with BSD 4.3 [KEEP THIS!] options COMPAT_FREEBSD4 # Compatible with FreeBSD4 options SCSI_DELAY=15000 # Delay (in ms) before probing SCSI 内核在探测每个 SCSI 设备之前等待 15 秒 #options KTRACE # ktrace(1) support 打开内核进程跟踪 options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores #options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions 在 1993 年 POSIX添加的实时扩展 ???######### #options KBD_INSTALL_CDEV # install a CDEV entry in /dev 这个选项与键盘有关。 它在 /dev 中安装一个 CDEV 项 #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. options ADAPTIVE_GIANT # Giant mutex is adaptive. 内核全局锁 (Giant) #device apic # I/O APIC 使用超线程CPU且BIOS开启HTT则打开,否则关闭该选项 . FreeBSD5.4打开Bios的HTT选项好吗?######### # Bus support. Do not remove isa, even if you have no isa slots device isa device eisa device pci # Floppy drives #device fdc #这是软驱控制器。 # ATA and ATAPI devices device ata device atadisk # ATA disk drives #device ataraid # ATA RAID drives 这个选项需要 device ata, 它用于 ATA RAID 驱动。 #device atapicd # ATAPI CDROM drives 这个是ATAPI CDROM驱动器所必须的 ********************************** #device atapifd # ATAPI floppy drivesATAPI 软驱 #device atapist # ATAPI tape drivesATAPI 磁带机 #options ATA_STATIC_ID # Static device numbering 指定对控制器使用其静态的编号; 如果没有这个选项, 则会动态地分配设备的编号 # SCSI Controllers SCSI 控制器 偶机器没有SCSI设备:( #device ahb # EISA AHA1742 family #device ahc # AHA2940 and onboard AIC7xxx devices #device ahd # AHA39320/29320 and onboard AIC79xx devices #device amd # AMD 53C974 (Tekram DC-390(T)) #device isp # Qlogic family #device mpt # LSI-Logic MPT-Fusion #device ncr # NCR/Symbios Logic #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 peripherals SCSI外围设备 device scbus # SCSI bus (required for SCSI) ##############SATA的硬盘需要它吗????????###### #device ch # SCSI media changers device da # Direct Access (disks) ############SATA的硬盘需要它吗????????###### #device sa # Sequential Access (tape etc) #device cd # CD #device pass # Passthrough device (direct SCSI access) #device ses # SCSI Environmental Services (and SAF-TE) # RAID controllers interfaced to the SCSI subsystem RAID偶也没用:( #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 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 # atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc # AT keyboard controller device atkbd # AT keyboard #device psm # PS/2 mouse PS/2鼠标 *****************************小心你的鼠标,偶是usb的*************** device vga # VGA video card driver #device splash # Splash screen and screen saver support启动时出现了 splash 画面!屏幕保护程序也需要它。 # syscons is the default console driver, resembling an SCO console device sc # 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 device agp # support several AGP chipsets 主板集成的显卡是不是就跟AGP没关系啦?????############################# # Floating point support - do not disable. device npx # Power management support (see NOTES for more options) #device apm # Add suspend/resume support for the i8254. device pmtimer # Adjust system timer at wakeup time # 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 # Serial (COM) ports #device sio # 8250, 16[45]50 based serial ports 串口 # Parallel port 并口相关设备 #device ppc #device ppbus # Parallel port bus (required) #device lpt # Printer #device plip # TCP/IP over parallel #device ppi # Parallel port interface device #device vpo # Requires scbus and da # If you've got a "dumb" serial or parallel PCI card that is # supported by the puc(4) glue driver, uncomment the following # line to enable it (connects to the sio and/or ppc drivers): #device puc # PCI Ethernet NICs. pci相关网卡驱动 偶的网卡比较烂realtek 根据个人需要的改过来***************************** #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'') # 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 这个不要删啊! 这里能删好多东西,光高兴了,刚才我从头删到尾,后来发现又补回来的,好险哦,嘿嘿########### #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 nge # NatSemi DP83820 gigabit ethernet #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 vge # VIA VT612x gigabit ethernet #device vr # VIA Rhine, Rhine II #device wb # Winbond W89C840F #device xl # 3Com 3c90x (``Boomerang'', ``Cyclone'') # 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 # 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. # Pseudo devices. 这里有点蒙,不敢乱来了,只删了下面6项 device loop # Network loopback device mem # Memory and kernel memory devices device io # I/O device device random # Entropy device device ether # Ethernet support #device sl # Kernel SLIP #device ppp # Kernel PPP #device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) #device md # Memory "disks" #device gif # IPv6 and IPv4 tunneling #device faith # IPv6-to-IPv4 relaying (translation) # 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 # USB support 这里也删了不少 device uhci # UHCI PCI->USB interface ****有USB鼠标这行和下面两行也留着吧***** device ohci # OHCI PCI->USB interface 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 urio # Diamond Rio 500 MP3 player #device uscanner # Scanners # USB Ethernet, requires mii 偶没有USB网卡,你的机器有吗???????? #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 # FireWire support ###############SATA的硬盘需要这些吗??????############### device firewire # FireWire bus code device sbp # SCSI over FireWire (Requires scbus and da) device fwe # Ethernet over FireWire (non-standard!) #ipfw防火墙: 还看到很多配置,这里先放几条. options对应的配置如果这里没设置,不知道能不能在外面的配置文件再设定? options IPFIREWALL options IPFIREWALL_VERBOSE options IPFIREWALL_VERBOSE_LIMIT=10 options IPFIREWALL_DEFAULT_TO_ACCEPT options IPSTEALTH |
------------------------------------------------------------------------------------------------------------------------------------------------
很有值得商榷的地方。
另外,我没试过,不过
#device uhci # UHCI PCI->USB interface
#device ohci # OHCI PCI->USB interface
这两个都删掉可以吗?
------------------------------------------------------------------------------------------------------------------------------------------------
如果你想用USB鼠标,那两个是不能删除的
我之前只留USB Bus和USB Mouse,没有那两个
结果不能使用USB鼠标
后来加入了第一个USB Interface,就可以正常使用了
不过我还是不清楚6个USB接口在内核里有什么区别?
------------------------------------------------------------------------------------------------------------------------------------------------
不行啊,果真鼠标死掉了 :(
我还是把下面三行加上把,再试一试
device uhci # UHCI PCI->USB interface
device ohci # OHCI PCI->USB interface
device ehci # EHCI PCI->USB interface (USB 2.0)
------------------------------------------------------------------------------------------------------------------------------------------------
device firewire # FireWire bus code
device sbp # SCSI over FireWire (Requires scbus and da)
device fwe # Ethernet over FireWire (non-standard!)[/quote]
火线 FireWire 总线带码
SCSI基本于火线
以太网基于火线
不用这个连的都去掉。
------------------------------------------------------------------------------------------------------------------------------------------------
我们使用的磁盘阵列上面SATA硬盘的坏损率要比SCSI高的多(若干倍),而且出现问题的时候,SATA同时坏两块的概率要高的多。早期的SATA盘阵缺少S.M.A.R.T.功能,事实上也是出现严重问题的原因之一。
当然,评估的时候也需要考虑每块SATA硬盘的容量要比SCSI大的影响(单位容量发生问题的概率),但总体说来,目前SCSI和SATA第一代产品的可靠性相比前者是有优势的,其原因包括:
* SCSI硬盘的Tagged Queue能力(SATA II中引入的NCQ实现类似功能),使得写入操作能够被重新排序,而不影响向操作系统/磁盘阵列如实汇报写入的进度情况。(多数PATA硬盘没有这种能力,因此对于追求稳定性的场合,建议关闭IDE硬盘上的写入缓存)。
* SCSI磁盘的原料和做工。市面上买到的SCSI硬盘通常是为服务器的365*7*24小时开机准备的,而SATA硬盘多数是为桌面的5*8*包含若干假期的一年的天数准备的,两者的选料等等都有差距。当然,Maxtor等公司也推出了针对服务器的高品质SATA硬盘,但这很大程度上取决于供应商是否给你正品。
* SCSI硬盘的SMART支持相对更为成熟。多数应用在从停机和损失大量数据之间必须作选择时,往往更倾向于前者。对于磁盘阵列,这一功能更是能够大大减少磁盘损坏所带来的潜在损失。
_________________