选择显示字体大小

freebsd kernel 编译大法(二)kernel内容编译

说明

第一部份: 开始到options设定之前

第二部份: 大部分的options 设定(除了smp之外)

第三部份: smp、软碟、主机板及ide介面 设定

第四部份: scsi装置 设定

第五部份: raid、滑鼠、键盘、显示卡、电源管理、浮点运算、console 设定

第六部份: pcmica、com port、平行埠 设定

第七部份: pci 及isa 网卡 设定

第八部份: 虚拟装置、封包过滤器、usb的装置 设定


----------------------------------------------------------------------------
[第一部份] 开始到options设定之前
----------------------------------------------------------------------------

machine i386
// 机器的内部结构,除了i386 还有 alpha 及pc98我们现今看到的多是i386

#cpu i386_cpu
#cpu i486_cpu
#cpu i586_cpu
cpu i686_cpu
// cpu的型态...若您不知道您的cpu型态为何.. >_<
it's ok ...freebsd will help you ...^^
用 dmesg more 指令(此指令显示开机资讯),可以看到您的cpu型态
这是我从dmesg中看到的讯息....
cpu:pentium ii / pentium ii xeon / celeron (350.80-mhz 686-class cpu)
所以我将其他的3个型态#掉,只留下i686_cpu

ident ohaha
// kernel的识别,通常我们用host name的大写..所以我的是ohaha

maxusers 64
// 这个数值大约等於你希望同时能够登入机器的人数
在正常的情况下,如果您要跑x-window的话,最小值是4
正确的说,此代表process的最大值有关maximum=20+16*maxusers
正常来说,用64已经足够
// 注意:maxusers不是能够login的限制。
----------------------------------------------------------------------------
[第二部份]大部分的options 设定(除了smp之外)
----------------------------------------------------------------------------
#makeoptions debug=-g #build kernel with gdb(1) debug symbols

#options math_emulate #support for x87 emulation
// 模拟数学浮点运算器 除非您的机器是386或486sx之前的型号,不然您可以将此行 # 掉
因为freebsd在这方面的模拟并不很精确,若您要求精确度的话..
将 math_emulate 改成 gpl_math_emulation 改用gnu 的模拟数学浮点运算器

options .net #inte.networking-
//.networking support ,即使您没有打算要连上网路也请保留,因为有些程式会用到loop

#options .net6 #ipv6 communications protocols
// ipv6 的通讯协定 (因为尚未启用所以disable)

options ffs #berkeley fast filesystem
options ffs_root #ffs usable as root device [keep this!]
// 以上两项,是基本的硬碟档案系统。若您要用硬碟开机...keep this !!

options mfs #memory filesystem
options md_root #md is a potential root device
// memory-mapped档案系统,如果您有很大的swap空间,您想要好好的利用的话...keep this
如果要使用的话,通常我们会将他挂在(mount)在/tmp 这个地方,
因为这里有许多程式将暂存资料存放在此。
要如此的话...请在/etc/fstab中的swap部分加入(或者说更新):
# device mountpoint fstype options dump pass#
/dev/ad0s1b /tmp mfs rw 0 0

options nfs .network filesystem
options nfs_root #nfs usable as root device, nfs required
// 网路档案系统,除非您想经由tcp/ip的方式,将unix的系统分割区挂上,否则 # 掉
因为本网站之後有讲到nfs方面...所以留着...^^

options msdosfs #msdos filesystem
// msdos档案系统,除非您要在开机时就挂上此分割区,否则您可以 # 掉

options cd9660 #iso 9660 filesystem
options cd9660_root #cd-rom usable as root, cd9660 required
// iso9660档案系统,若您没有光碟机,或者不常mount光碟机,则可以 # 掉

options procfs #process filesystem
// the process 档案系统,为假想的档案系统,挂(mount)在/proc,
此允许 ps 指令显示process的资讯

options compat_43 #compatible with bsd 4.3 [keep this!]
// 与4.3bsd的相容性[keep this!]

options scsi_delay=15000 #delay (in ms) before probing scsi
// 使kernel暂停15秒,去搜寻您机器上的scsi装置。
这个您应该看过吧...就是开机时令你觉得很烦很慢的那个...
您可以将此数值减少..以加快开机速度。

options uconsole #allow users to grab the console
// 让您能够抓取console的画面...这个对 x 的使用者比较有用...

options userconfig #boot -c editor
// 允许您从开机选单中启动组态编辑器(configuration editor) 几乎用不到

options visual_userconfig #visual boot -c editor
// 同上...只不过是视觉化的...几乎用不到

options ktrace #ktrace(1) support
// 启动kernel process tracing(追踪系统程序),在debug时很有用...一般人还是用不到...@@"

options sysvshm #sysv-style shared memory
// 此选项提供给system v 型态的shared memory ...,最常用此选项功能的是 x 中的xshm
若您要使用 x 请务必加上,此外许多有关图形的程式也会因此选项功能而加速。
又者...big5con(中文console)也需要此选项。

options sysvsem #sysv-style semaphores
// 支援system v 的信号(semsphores),只占用少量的kernel大小

options sysvmsg #sysv-style message queues
// 支援system v 的讯息(messages),只占用少量的kernel大小,bbs会用到此选项功能。

// 通常我们会将以上三种全部加上.....-__-

options p1003_1b #posix p1003_1b real-time extensions
options _kposix_priority_scheduling
// real-time extensions added in the posix,某些应用程式会用到(star office)。

options icmp_bandlim #rate limit bad replies
// 启动反应频宽限制的icmp error,对於帮助拒绝packet攻击有所助益。
----------------------------------------------------------------------------
[第三部份] smp、软碟、主机板及ide介面 设定
----------------------------------------------------------------------------
# to make an smp kernel, the next two are needed
// 多cpu的支援 ....
#options smp# symmetric multiprocessor kernel
#options apic_io # symmetric (apic) i/o
// 新版本的只要将此两项打开,系统会自动抓到...^^

device isa
// 每个被freebsd支援的pc都有这一个....

device eisa
// 若您有eisa的主机板..加上它,会自动侦测及设定所有eisa装置

device pci
// 若您有pci的主机板..加上它,会自动侦测pci的卡,及在pci及isa介面做一区隔

# 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
// 软碟的控制卡,fd0是a:,fd1是b:(因为我没有第二个软碟机,所以 # 掉fd1)

# ata and atapi devices
device ata0 at isa? port io_wd1 irq 14
device ata1 at isa? port io_wd2 irq 15
// 以上这两个,是给那些没有pci的系统使用

device ata
// kernel侦测pci/ata/atapi的选项

device atadisk # ata disk drives
// ide介面的硬碟机

device atapicd # atapi cdrom drives
// ide介面的光碟机

#device atapifd # atapi floppy drives
// ide介面的软碟机 (我没有..所以 # 掉)

#device atapist # atapi tape drives
// ide介面的磁带机 (这....我更没有...所以 # 掉)

options ata_static_id #static device numbering
// 让控制卡的数值固定,否则,则使用动态产生

options ata_enable_atapi_dma #enable dma on atapi devices
// 启动dma(动态记忆体存取),预设是#掉..因大多数硬碟都支援,所以我将#拿掉
----------------------------------------------------------------------------
[第四部份] scsi装置 设定
----------------------------------------------------------------------------
# scsi controllers
#device ahb # eisa aha1742 family
#device ahc # aha2940 and onboard aic7xxx devices
#device amd # amd 53c974 (teckram dc-390(t))
#device isp # qlogic family
#device ncr # ncr/symbios logic
#device sym # ncr/symbios logic (newer chipsets)
#options sym_setup_lp_probe_map=0x40
# allow ncr to attach legacy ncr devices when
# both sym and ncr are configured
#device adv0 at isa?
#device adw
#device bt0 at isa?
#device aha0 at isa?
#device aic0 at isa?
// scsi控制卡...#掉你没有的装置,若您像我只有ide介面,您可以#掉以上。
请参照 lint 说明...找找您的卡是属於哪一种...

# scsi peripherals
#device scbus # scsi bus (required)
// 若您有scsi介面...please keep this ...
#device da # direct access (disks)
// scsi硬碟机
#device sa # sequential access (tape etc)
// scsi磁带机
#device cd # cd
// scsi光碟机
#device pass # passthrough device (direct scsi access)
// scsi周边装置...#掉你没有的装置,若您像我只有ide介面,您可以#掉以上。
同样若您有疑问,请参照 lint 说明
----------------------------------------------------------------------------
[第五部份] raid、滑鼠、键盘、显示卡、电源管理、浮点运算、console 设定
----------------------------------------------------------------------------
# raid controllers interfaced to the scsi subsystem
#device asr # dpt smartraid v, vi and adaptec scsi raid
#device dpt # dpt smartcache - see lint for options!
// 多磁碟阵列接scsi控制卡
请参照 lint 说明...找找您的卡是属於哪一种...(我很穷..所以这..更不用说了..# 掉吧)

# raid controllers
#device ida # compaq smart raid
#device amr # ami megaraid
#device mlx # mylex dac960 family
#device twe # 3ware escalade
// 多磁碟阵列卡
请参照 lint 说明...找找您的卡是属於哪一种...(我很穷..所以这..更不用说了..# 掉吧)

# atkbdc0 controls both the keyboard and the ps/2 mouse
device atkbdc0 at isa? port io_kbd
// at及ps/2的装置
这个被atkbd及psm所需要...也就是有atkbd就要有atkbdc0,psm亦然

device atkbd0 at atkbdc? irq 1 flags 0x1
// at 84 键盘

device psm0 at atkbdc? irq 12
// ps/2的滑鼠

device vga0 at isa?
// 显示卡驱动程式

# splash screen/screen saver
pseudo-device splash
// 引人注目的启动萤幕(like microsoft windows),以及萤幕保护程式。

# syscons is the default console driver, resembling an sco console
device sc0 at isa? flags 0x100
// freebsd预设的console驱动程式,类似sco console ...

# enable this and pcvt_freebsd for pcvt vt220 compatible console driver
#device vt0 at isa?
#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
// vt220相容的console驱动程式,与vt100/102相容。
当您无法使用sc0时使用之(某些笔记型电脑),
在任何平台上vt100都可以执行。不过较少人使用... export term=vt100

# floating point support - do not disable.
device npx0 at nexus? port io_npx irq 13
// npx0是freebsd上的数学浮点运算单位,包括实体的或是软体模拟的

# power management support (see lint for more options)
#device apm0 at nexus? disable flags 0x20 # advanced power management
// 支援进阶的电源管理,对笔记型电脑很有助益。
----------------------------------------------------------------------------
[第六部份]pcmica、com port、平行埠 设定
----------------------------------------------------------------------------
# pccard (pcmcia) support
#device card
#device pcic0 at isa? irq 0 port 0x3e0 iomem 0xd0000
#device pcic1 at isa? irq 0 port 0x3e2 iomem 0xd4000 disable
// pcmcia支援...针对於笔记型电脑

# 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
// com1~com4,预设com3、com4不会用到所以#掉

# parallel port
// 平行埠
device ppc0 at isa? irq 7
// isa-bus的平行埠介面
device ppbus # parallel port bus (required)
// 平行埠bus支援
#device lpt # printer
// 平行埠的印表机支援 (我没有印表机..so # 掉)
device plip # tcp/ip over parallel
// 平行埠的网路介面
#device ppi # parallel port interface device
// 平行埠的介面装置 (我也没有任何有关的介面..so # 掉)
#device vpo # requires scbus and da
// 这是专门给iomega zip的支援 (我更没有zip)
----------------------------------------------------------------------------
[第七部份]pci 及isa 网卡 设定
----------------------------------------------------------------------------
# pci ethe.net 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 ethe.net card (``wiseman'')
// pci的网路卡..选择您的网卡...其馀的# 掉

# pci ethe.net nics that use the common mii bus controller code.
device miibus # mii bus support
#device dc # dec/intel 21143 and various workalikes
#device pcn # amd am79c79x pci 10/100 nics
#device rl # realtek 8129/8139
#device sf # adaptec aic-6915 (``starfire'')
#device sis # silicon integrated systems sis 900/sis 7016
#device ste # sundance st201 (d-link dfe-550tx)
#device tl # texas instruments thunderlan
device vr # via rhine, rhine ii
#device wb # winbond w89c840f
#device xl # 3com 3c90x (``boomerang'', ``cyclone'')
// pci的网路卡..选择您的网卡...其馀的# 掉
若您的网卡是这第二部份的..别忘了要将第一个miibus支援加上,像我一样。

// 网卡的型号可以从dmesg中看出...否则您也可以从 lint 中参考

# isa ethe.net nics.
#device ed0 at isa? port 0x280 irq 10 iomem 0xd8000
#device ex
#device ep
#device fe0 at isa? port 0x300
# wavelan/ieee 802.11 wireless nics. note: the wavelan/ieee really
# exists only as a pcmcia device, so there is no isa attatement needed
# and resources will always be dynamically assigned by the pccard code.
#device wi
# air.net 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 paremeters here.
#device an
# xircom ethe.net
#device xe

# 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 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
// isa的网卡...同样的选择您有的...没有的#掉 ...
同样的..您也可以参考/sur/src/sys/i386/conf/lint 有详细的说明
----------------------------------------------------------------------------
[第八部份]虚拟装置、封包过滤器、usb的装置 设定
----------------------------------------------------------------------------
# pseudo devices - the number indicates how many units to allocated.
pseudo-device loop #.network loopback
// 通常的loop装置,当您用te.net或ftp localhost它就是经由此装置
此为必需的。
pseudo-device ether # ethe.net support
// 当您有网路卡时才需要,它也包含基本的网路协定码

#pseudo-device sl 1 # kernel slip
// 支援slip,不过他以快要被ppp取代,s1後的数字表示,同时有多少slip session被支援

#pseudo-device ppp 1 # kernel ppp
// 对拨接的ppp支援,ppp後的数字表示,同时有多少ppp连结被支援

#pseudo-device tun # packet tunnel.
// 被ppp所使用,tun後的数字表示,同时有多少ppp session被支援

pseudo-device pty # pseudo-ttys (te.net etc)
// 虚拟终端机装置,预设是16,最高可以达到256 (login port)

pseudo-device md # memory "disks"
// memory disk 虚拟装置 与之前的(第二部份)mfs相呼应,不可单独存在

#pseudo-device gif 4 # ipv6 and ipv4 tunneling
// ipv4及ipv6间的工具

#pseudo-device faith 1 # ipv6-to-ipv4 relaying (translation)
// 抓取封包并使之转向到ipv4/ipv6间的转化daemon

# the `bpf' pseudo-device enables the berkeley packet filter.
# be aware of the administrative consequences of enabling this!
pseudo-device bpf #berkeley packet filter
// berkeley的封包过滤器。(这是必要的)
他允许网路介面即使被放置在一个杂乱的模式,它也能在broadcast上抓取每一封包。
这些封包能被抓取到磁碟或经由tcpdump程式解释。

# 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
# usb ethe.net, requires mii
#device aue # admtek usb ethe.net
#device cue # catc usb ethe.net
#device kue # kawasaki lsi usb ethe.net
// usb装置的支援

终於...把文字叙述档给修正完成了....现在已经完成编译的一大步了...
让我们一鼓作气完成他...继续编译   


 


关键字 本文所属关键字

相关 与本文相关文章

分类 所有文章关键字导航

源码编程相关

Java   Asp   PHP   .Net   XML   C/C++   CGI   VB   Jsp   J2ee   J2se   J2me   EJB   Servlet   Tomcat   Resin   Struts   Weblogic   Eclipse   ANT   GUI   JMS   Web servise   IDEA   Webphere   Hibernate   Spring   Jboss   Applet   Swing   Socket   Javamail   Perl   Ajax   P2P   安全   模式   框架   测试   开源   游戏

SQL数据库相关

My-SQL   Ms-SQL   Access   DB2   Oracle   Sybase   SQLserver   索引   存储过程   加密   数据库   分页   视图  

手机无线相关

3G   Wap   CDMA   GRPS   GSM   IVR   彩信   短信   无线   增值业务

网页设计制作相关

HTML   CSS   网页配色   网页特效   Javascript   VBscript   Dreamweaver   Frontpage   JS   Web   网站设计

网站建设推广相关

建站经验   网站优化   网站排名   推广   Alexa

操作系统/服务器相关

Windows XP   Windows 2000   Windows 2003   Windows Me   Windows 9.x   Linux   UNIX   注册表   操作系统   服务器   应用服务器

图形图像多媒体相关

Photoshop   Fireworks   Flash   Coreldraw   Illustrator   Freehand   Photoimpact   多媒体   图形图像

标准 网站致力的规范

Valid CSS!

无不良内容,无不良广告,无恶意代码

Valid XHTML 1.0 Transitional

creativecommons