极湖

无不用其“极”

Subscribe to RSS feed

Posts tagged with "FreeBSD"

前途无量的PC-BSD

, , ,

没事下了个PC-BSD 1.3.01的VMWare磁盘镜像,在VMware上试用后,一下子喜欢上了。于是忍不住下载了其安装光盘,刻录,并在家里的电脑上安装。

PC-BSD的默认桌面是KDE,窗口样式是Vista风格,从视觉效果来说,给人的第一印象不错。实际上,PC-BSD的的桌面和很多Linux发行版相比,可以说并无过人之处,如果你肯花时间,完全可以用熟悉的Linux系统做出比这个更漂亮的桌面。只不过,这个系统的内核是BSD,而不是Linux。

PC-BSD提供了一个图形化的安装系统,让没有安装过BSD的人,也能轻松安装PC-BSD。我用下来的感觉,这个安装系统还不是很完善,比如,有一步选错了,居然回不到上一步,需要从头来,还有就是响应速度比较慢,比如从一个列表中选择内容,半天才有结果。PC-BSD的安装系统,目前看来还赶不上很多Linux发行版,只不过,比起其他的BSD系统,这已经是个不小的进步。

PC-BSD的过人之处在于,它提供了一个叫做PBI的软件包管理系统,PBI的安装方式很像Windows下的Setup,鼠标双击文件就自动开始安装,两三步即完成安装,软件包装好之后也能够用图形方式从系统中卸载。这样傻瓜化的软件安装卸载方式,很靠近用户,虽然有点步Windows的后尘,也可以说是一大进步,因为各种Linux/BSD发行版,都还没有做到这一点,包括Redhat的RPM。在易用性这一点上,PBI让PC-BSD有了一个很好的起点,随着PBI软件包的增加,我想以后会有更多的人使用这套系统。

PC-BSD的硬件查找能力也还过得去,在自己的机器上装好之后,显卡声卡都正常工作,以前用FreeBSD,做到这一步需要花费不少功夫。我认为,这也是PC-BSD的一个亮点。

PC-BSD基于FreeBSD,并有所改进,尤其在桌面环境,下了很多功夫,它也没有抛弃FreeBSD的那一套管理方式,你照样可以用FreeBSD的ports方式或是pkg方式安装卸载软件,所以说,这套系统既适合于菜鸟,也适合于老鸟,可谓“老少咸宜”。

现在,如果要在自己的机器上安装Linux,我的首选是Ubuntu,如果要安装BSD,则非PC-BSD莫属了。

三个免费BSD系统的比较

, ,

在网上看到这样的评论:

FreeBSD = Popular all-rounder.
NetBSD = Portable (runs on a lot of platforms, including a toaster)
OpenBSD = Security above anything else.


翻译过来就是:

FreeBSD = 流行的多面手
NetBSD = 可移植 (可在很多平台上运行, 包括一个烤面包机)
OpenBSD = 比其他任何东西都安全


应该说,这样的评价,非常精到。用过这三个系统的人我想都会点头同意。

Vista及OpenBSD安装后记

, , , ...

周末无事,在家摆弄电脑。还没有安装过正式版的Vista,家里的台式机闲置了很长时间,因此决定在上面安装Vista。

Vista的DVD镜像上周已经下载,机器上原来装有XP。

安装步骤:

1. 启动原先的XP系统。
2. 用Daemon Tools把Vista的DVD镜像虚拟成光盘。
3. 拷贝整个光盘的文件到硬盘。我拷贝到D:\VistaDVD。
4. 执行安装程序。选择全新安装(非升级),安装到C盘。安装过程很顺利,几乎不用人工干预。
5. 安装完成后,进行系统清理,删除原先的Windows文件。
6. 安装常用的软件,如Office、Acrobat Reader等。当然一定要安装杀毒软件,这次我装的是免费的AVG

Vista的安装就结束了。

因为磁盘上还有空闲的分区(原先装过Linux),和一个FreeBSD,因此决定再安装一个系统。

Linux工作中天天用,不想再装了。决定在空闲分区安装OpenBSD,因为OpenBSD的安装很节省资源,机器连网的情况下,只需要一张软盘。OpenBSD的安装遵循官方指南,比较顺利,需要注意的只是磁盘的分区,细节不再赘述。

安装完成之后,机器上就有了三个系统:Vista, FreeBSD,OpenBSD。接下来进行多重启动的设置。

Vista的启动菜单,用一个叫bcdedit的工具管理,这是个新东西,以前的Windows中没有。看了一下bcdedit的命令格式,感觉很复杂。

网上找到一个叫 EasyBCD 的软件,可以很方便地修改Vista的启动菜单。先添加了FreeBSD的启动选项,通过菜单启动成功。问题是,OpenBSD的启动选项,无法添加,通过EasyBCD自带的Neogrub也没有成功。因为Neogrub只认识FAT、ext2、 ext3、 NTFS这几种分区格式。

找来找去,最后找到了一个叫GAG的东东,才把问题解决。

GAG很小,只有一张软盘,不过很管用。首先需要一种格式化好的空软盘,然后执行install,把软盘镜像写入软盘。之后用软盘启动,然后根据提示设置启动选项,设置好各项菜单后可以保存到软盘,也可以保存到硬盘,最好两边都保存。设置好后,拿掉软盘,重新启动,OK了,菜单很漂亮,几个系统都能顺利启动。

Vista以及OpenBSD的安装就这样结束,又积累了一点点经验,写出来与大家分享。

FreeBSD上安装MySQL Server

, ,

抄来的:

cd /usr/ports/databases/mysql41-server/
make install clean
/usr/local/bin/mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &
/usr/local/bin/mysqladmin -u root password newpassword

vi /etc/rc.conf

mysql_enable="YES" (在rc.conf文件里加入这行代码)

Linux 命令速查

, ,

一. 启动,关机,登入,登出相关命令
<login> 登录
<logout> 登出
<exit> 登出
<shutdown> 停止系统
<halt> 停止系统
<reboot> 重启动
<poweroff> 切断电源
<sync> 把内存里的内容写入磁盘
<lilo> 安装lilo启动管理程序
<grub> 安装grub启动管理程序

二. Shell相关命令
<chsh> 切换Shell
<history> 显示命令履历
<alias> 设置命令别名
<unalias> 取消命令别名
<which> 显示命令所在位置
<type> 查询命令种类
<echo> 显示字符串或者变量内容
<set> 设置/显示Shell变量
<printenv> 显示环境变量
<export> 设置环境变量
<env> 设置临时环境变量
<unset> 释放环境变量
<setenv> 设置环境变量
<unsetenv> 释放环境变量
<source> 执行文件当中的命令
<man> 查询命令手册
<info> 查询超文本命令手册
<whatis> 显示命令简介
<apropos> 通过关键字查询手册

三. 用户管理相关命令
<su> 切换到其他用户
<useradd> 追加用户
<adduser> 追加用户
<userdel> 删除用户
<usermod> 修改用户设置
<chfn> 修改用户私人信息
<groupadd> 追加组
<groupdel> 删除组
<groupmod> 修改组设置
<passwd> 更改密码
<whoami> 显示用户名
<logname> 显示登录用户帐号
<users> 显示所有登录用户信息
<who> 查询登录用户信息
<w> 查询登录用户信息
<id> 显示指定用户的ID信息
<groups> 显示指定用户的所属组
<finger> 显示指定用户的个人信息
<mesg> 开关与他人收发消息
<write> 给其他用户发消息
<wall> 给所有用户发消息
<talk> 和其他用户聊天

四. 系统消息相关命令
<date> 显示/设置当前时间
<uptime> 显示系统运行时间
<arch> 显示机器的核心构架(如i386)
<uname> 显示操作系统信息
<tty> 显示终端名
<last> 显示登录/登出在履历
<lastb> 显示非法登录信息
<dumpkeys> 显示当前键盘配置
<loadkeys> 变更键盘配置
<df> 查询磁盘使用信息
<du> 查询磁盘使用信息
<dmesg> 显示系统启动消息
<script> 保存输入输出到文件

五. 文件操作相关命令
<ls> 显示文件列表
<tree> 显示目录树
<pwd> 显示当前路径
<cd> 更改当前路径
<pushd> 追加路径到目录堆栈
<popd> 从目录堆栈删除路径
<dirs> 显示目录堆栈的内容
<mkdir> 创建路径
<rmdir> 删除路径
<cp> 复制文件/目录
<rm> 删除文件/目录
<mv> 移动文件/目录,修改文件名
<chown> 更改文件/目录的所有者
<chgrp> 修改文件/目录的所有组
<chmod> 修改文件/目录的权限
<touch> 更改文件时间
<ln> 建立文件/目录链接
<find> 查找文件
<whereis> 显示文件存在的路径名
<file> 查询文件种类
<size> 查询文件大小

六. 文件编辑相关命令
<cat> 显示文件内容
<tee> 输出到文件和屏幕
<more> 分屏显示文件内容
<less> 分屏显示文件内容
<head> 显示文件头部内容
<tail> 显示文件尾部内容
<fold> 折叠显示长行
<sort> 排列文件的行
<cmp> 比较文件内容
<diff> 显示文件差异
<nkf> 更改日语文件编码
<dd> 变更文件之后复制
<wc> 统计文本单词数,文件大小等
<split> 分割文件
<paste> 以行连接文件
<join> 以字段连接文件
<grep> 查询文字
<uniq> 过滤重复部分显示文件内容
<tr> 替换文字
<sed> 替换文字

七. 压缩/解压缩相关命令
<ar> 压缩/解压缩文件
<tar> 压缩/解压缩文件
<compress> 压缩/解压缩文件
<uncompress> 解压缩
<gzip> 压缩/解压缩文件
<gunzip> 解压缩
<zcat> 显示压缩文件的内容
<lha> 压缩/解压缩文件
<uuencode> 把二进制文件编码为文本文件
<uudecode> 把经过编码的文本文件还原为二进制文件

八. MS-DOS工具集[mtools]命令
<mdir> 显示文件列表
<mcd> 改变当前目录
<mmd> 新建目录
<mrd> 删除目录
<mdeltree> 删除目录树
<mcopy> 复制文件
<mdel> 删除文件
<mmove> 移动文件
<mren> 更改文件或目录名
<mattrib> 修改文件属性
<mtype> 显示文件内容
<mdu> 查询文件或目录大小
<minfo> 显示磁盘信息
<mformat> 以MS-DOS方式格式化磁盘
<mlabel> 设置磁盘标签

九. 控制外部设备相关命令
<mount> mount上设备
<umount> 解除已经mount上的设备
<eject> 弹出(CD/DVD等)
<fdformat> 格式化软盘
<fdisk> 配置/显示硬盘分区
<mkfs> 格式化磁盘分区
<fsck> 检查/修复磁盘错误
<lpr> 打印到打印机
<lprm> 中断打印任务
<lpq> 显示打印任务的状态
<lpc> 管理/控制打印任务
<ifconfig> 显示/设定NIC配置

十. 进程及任务管理相关命令
<ps> 显示正在运行的进程
<jobs> 显示后台运行任务
<fg> 把任务切换到前台
<bg> 把任务切换到后台
<kill> 中止进程或任务
<killall> 中止进程或任务
<wait> 等待进程或任务的结束
<at> 设置定时执行任务
<atq> 显示尚未执行的任务
<atrm> 删除定时执行任务
<batch> 在系统负荷减轻的时候执行任务
<nice> 改变优先度并执行任务
<nohup> 在后台执行任务,Logout之后也不退出
<sleep> 休眠一定的时间

十一. 网络管理相关命令
<netstat> 显示当前网络连接状况
<route> 显示/设置路由
<host> 显示网络主机情况
<hostname> 显示/设置当前主机的名字
<ping> 确认和远程机器的连接情况
<traceroute> 显示路由信息
<rwho> 查询网上机器的登陆用户
<ruptime> 查询网上机器的系统运行时间
<rlogin> 登陆到远程机器
<telnet> 用telnet登陆到远程机器
<rsh> 给远程机器发送命令
<rcp> 在远程机器之间复制文件
<mail> 收取邮件
<sendmail> 发送邮件
<mailq> 确认邮件队列
<ftp> 用ftp传输文件

十一. 其他命令
<cal> 显示日历
<clear> 清屏
<gcc> 编译C语言代码
<as> 汇编
<bc> 计算
<rpm> Redhat的包管理
<dpkg> Debian的包管理
<installpkg> Slackware的包安装(删除命令则是removepkg)
<XF86Setup,turboxfg,Xconfigurator> 配置 X 服务器
<startx> 启动 X-Window 系统

附:组合命令
重定向,如
$ ls -l /bin > ls-output
$ more ls-output


管道命令,如
$ cat file1 file2 | sort | uniq

经常被用于管道的命令
awk, fold, grep, head, nnkf, pr, sed, sort, tail, tee, tr, uniq, wc

注:
以上资料来自 《Linux コマンド早引き事典》(作者:多比羅 悟,2000年出版)。
只是翻译了目录部分。

wget 命令用法示例

,

FreeBSD 6.0 安装备忘

, ,

(只是随手笔记,没有仔细整理)

1.生成几个配置文件

cp /usr/share/examples/etc/make.conf /etc/
cp /usr/share/examples/cvsup/standard-supfile.conf /usr/
cp /usr/share/examples/etc/ports-supfile.conf /usr/
cp /usr/share/examples/etc/doc-supfile.conf /usr/

chmod u+w /etc/make.conf /usr/standard-supfile.conf /usr/ports-supfile.conf /usr/doc-supfile.conf

修改 /usr/standard-supfile.conf 和 /usr/ports-supfile.conf 中的
*default host=cvsup.jp.FreeBSD.org

2. 中文X-Windows的配置

安装X.org,Gnome2,fcitx
编辑~/.xinitrc, 内容如下:
export XMODIFIERS=@im=fcitx
fcitx&
/usr/X11R6/bin/gnome-session

编辑 /etc/profile,加入
setenv LANG zh_CN.eucCN
setenv LC_ALL zh_CN.eucCN

如果用bash:
export LANG=zh_CN.eucCN
export LC_ALL=zh_CN.eucCN

NVIDIA显卡的安装
cd /usr/ports/x11/nvidia-driver
make install
cd work
make setup

如果想用windows的中文字体:
mount_ntfs /dev/ad0s1 /mnt/win
cd /mnt/win/WINDOWS/Fonts
mkdir /usr/X11R6/lib/fonts/msfonts
cp simsun.ttc /usr/X11R6/lib/fonts/msfonts/simsun.ttf
cp mingliu.ttc /usr/X11R6/lib/fonts/msfonts/mingliu.ttf
cp tahoma.ttf /usr/X11R6/lib/fonts/msfonts/
cp tahomabd.ttf /usr/X11R6/lib/fonts/msfonts/

同时下载把两个字体描述文件放在同一目录:
1. fonts.conf
2. fonts.dir

生成和编辑xorg.conf,内容如下:
Section "Module"
    Load        "dbe"   # Double buffer extension
    Load  "extmod"
    SubSection  "extmod"
      Option    "omit xfree86-dga"   # don't initialise the DGA extension
    EndSubSection
    Load        "type1"
    Load        "speedo"
    Load  "bitmap"
    Load  "glx"
    Load  "freetype"
    Load  "dri"
    Load  "dbe"
    Load  "xtt"
EndSection
Section "Files"
    RgbPath     "/usr/X11R6/lib/X11/rgb"
    ModulePath  "/usr/X11R6/lib/modules"
    FontPath   "/usr/X11R6/lib/X11/fonts/msfonts/"
    FontPath   "/usr/X11R6/lib/X11/fonts/local/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/Speedo/"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/TrueType/"
EndSection
Section "ServerFlags"
Option "NvAGP" "1"
EndSection
Section "InputDevice"
    Identifier  "Keyboard1"
    Driver      "kbd"
    Option "AutoRepeat" "500 30"
    Option "XkbRules"   "xfree86"
    Option "XkbModel"   "pc106"
    Option "XkbLayout"  "jp"
EndSection
Section "InputDevice"
    Identifier  "Mouse1"
    Driver      "mouse"
    Option "Protocol"    "Auto"
    Option "Device"      "/dev/sysmouse"
    Option "Emulate3Buttons"
    Option "ZAxisMapping" "4 5"
    Option "Buttons" "5"
EndSection
Section "Monitor"
    Identifier "HP P910"
    VendorName "Hewlett Packard" 
    ModelName "HP D8910" 
    HorizSync 29-107 
    VertRefresh 50-150 
    # 1024x768 @ 130 Hz, 106.8 kHz hsync 
    Modeline "1024x768" 150.6 1024 1056 1216 1408 768 782 788 822 -HSync -VSync
    # 1280x1024 @ 100 Hz, 106.8 kHz hsync 
    Modeline "1280x1024" 181 1280 1312 1440 1696 1024 1031 1046 1072 -HSync -VSync 
    # 1600x1200 @ 85 Hz, 105.77 kHz hsync 
    Modeline "1600x1200" 220 1600 1616 1808 2080 1200 1204 1207 1244 +HSync +VSync 
EndSection
Section "Monitor"
    Identifier  "IO-DATA LCD"
    Option "DPMS"
    HorizSync   31.5-110
    VertRefresh 28-90
    Modeline "1024x768" 162 1920 1984 2176 2480 1200 1201 1204 1250 +hsync +vsync
EndSection
Section "Device"
    Identifier  "Standard VGA"
    VendorName  "Unknown"
    BoardName   "Unknown"
    Driver     "vesa"
EndSection
    #VideoRam    65536
    # Insert Clocks lines here if appropriate
    #VideoRam    65536
    # Insert Clocks lines here if appropriate
Section "Device"
     Identifier  "nVidia geForce 4"
     Driver      "nvidia"
     VendorName  "NVIDIA"
     BoardName   "GeForce4 MX"
EndSection
Section "Screen"
    Identifier  "Screen 1"
    Device      "nVidia geForce 4"
    Monitor     "IO-DATA LCD"
    DefaultDepth 24
    Subsection "Display"
        Depth       8
        Modes      "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       16
        Modes       "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
    Subsection "Display"
        Depth       24
        Modes       "1024x768" "800x600" "640x480"
        ViewPort    0 0
    EndSubsection
EndSection
Section "ServerLayout"
    Identifier  "Simple Layout"
    Screen "Screen 1"
    InputDevice "Mouse1" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection

以上的X配置文件,可从此处 下载。该配置文件仅供参考,机器不同,内容也应该有差异。

在这儿找到一个相当不错的 FreeBSD 6.0 的安装配置指南:
http://notes.twinwork.net/freebsd/

我的FreeBSD6.0内核配置文件

,

只是在 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.429.2.3.2.1 2005/10/28 19:22:41 jhb Exp $

machinei386
#cpuI486_CPU
#cpuI586_CPU
cpuI686_CPU
identMY_BSD_KERNEL

# To statically compile in device wiring instead of /boot/device.hints
#hints"GENERIC.hints"    # Default places to look for devices.

makeoptionsDEBUG=-g    # Build kernel with gdb(1) debug symbols

#options SCHED_ULE    # ULE scheduler
options SCHED_4BSD    # 4BSD scheduler
options PREEMPTION    # Enable kernel thread preemption
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
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 COMPAT_FREEBSD5    # Compatible with FreeBSD5
options SCSI_DELAY=5000    # 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

# Bus support.
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    atapicd    # ATAPI CDROM drives
device    atapifd    # ATAPI floppy drives
device    atapist    # ATAPI tape drives
options ATA_STATIC_ID# Static device numbering

# 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 (Tekram 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 + 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
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)

# 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    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

device    vga    # VGA video card driver

device    splash    # Splash screen and screen saver support

# 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

# Power management support (see NOTES for more options)
#device    apm
# Add suspend/resume support for the i8254.
device    pmtimer

# 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.
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    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    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    ral    # Ralink Technology RT2500 wireless NICs.
device    wi    # WaveLAN/Intersil/Symbol 802.11 wireless NICs.
#device    wl    # Older non 802.11 Wavelan wireless NIC.

# Pseudo devices.
device    loop    # Network loopback
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

# use PF for packet filtering -- add by Ou
devicepf# PF OpenBSD packet-filter firewall 
devicepflog# logging support interface for PF 
devicepfsync# synchronization interface for PF

# use ALTQ for packet prioritization (QoS)
optionsALTQ 
optionsALTQ_CBQ# Class Bases Queueing 
optionsALTQ_RED# Random Early Drop 
optionsALTQ_RIO# RED In/Out 
optionsALTQ_HFSC# Hierarchical Packet Scheduler 
optionsALTQ_CDNR# Traffic conditioner 
optionsALTQ_PRIQ# Priority Queueing

# USB support
device    uhci    # UHCI PCI->USB interface
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    ural    # Ralink Technology RT2500USB wireless NICs
device    urio    # Diamond Rio 500 MP3 player
device    uscanner# Scanners
# USB Ethernet, requires miibus
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
device    firewire# FireWire bus code
device    sbp    # SCSI over FireWire (Requires scbus and da)
device    fwe    # Ethernet over FireWire (non-standard!)

# Sound 
device    sound    # Enable sound


该文件放在 /root/kernels,需要作个链接
# ln -s /root/kernels/MY_BSD_KERNEL /usr/src/sys/i386/conf/MY_BSD_KERNEL

编译和安装内核:
# cd /usr/src
# make buildkernel KERNCONF=MY_BSD_KERNEL
# make installkernel KERNCONF=MY_BSD_KERNEL
# reboot

给源代码打补钉/去补钉的方法

,

打补钉:
patch -p0 -d /usr/src < yada.diff

去补钉:
patch -p0 -R -d /usr/src < yada.diff

为了给刚刚装好的FreeBSD增加声卡支持,需要以下补钉:
http://people.freebsd.org/~ariff/
February 2012
S M T W T F S
January 2012March 2012
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29