编译优化自己的FreeBSD

使用版本为FreeBSD5.3,运行 sysinstall 命令,然后选择configure -> Distrbutions -> src ->

sys 然后安装就可以把内核代码安装到硬盘里面.

   然后进入/usr/src/sys/i386/conf里面把 GENERIC 文件保存到/root目录下面,然后回到/root目

录,开始编辑内核。以下是我的GENERIC文件内容

 

#
# 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.6.2.2 2004/10/24 18:02:52 scottl Exp $

machine  i386
#cpu  I486_CPU  因为我的处理器版本比较高,所以这两句没什么用去掉
#cpu  I586_CPU
cpu  I686_CPU
ident  GENERIC   这是重新编译后的内核文件名,应该改为你自己的内核名字 我的内核名叫Free

 

# 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不要
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  # 这几句都不要分别是nfs客户端与服务端

options  NFSSERVER  # 还有与DOS系统互访
options  NFS_ROOT  #
options  MSDOSFS   #

options  CD9660   # ISO 9660 Filesystem
options  PROCFS   # Process filesystem (requires PSEUDOFS)
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
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
options  KBD_INSTALL_CDEV # install 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.
options  ADAPTIVE_GIANT  # Giant mutex is adaptive.

 

device  apic  # I/O APIC可要可不要,我的不要了

# 系统总线一般不作修改
device  isa
device  eisa
device  pci

# 软盘我把它删掉
device  fdc

# ATA and ATAPI devices
device  ata
device  atadisk  # ATA disk drives
device  ataraid  # ATA 阵列驱动我没有阵列所以也删掉了
device  atapicd  # ATAPI CDROM drives
device  atapifd  # ATAPI 软盘驱动删除
device  atapist  # 磁带机,删除
options  ATA_STATIC_ID # 静态设备标号,删除

#以是SCSI系统与阵列,串口COM所以全部删除

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值