教你制作可以随身携带的FreeBSD系统

豆豆网   技术应用频道   2007年03月08日  【字号: 收藏本文

本文详细介绍教你制作可以随身携带的FreeBSD系统

  bsd# mkdir /fd

  bsd# mount /dev/fd0a /fd
  bsd# mkdir /fd/boot
  bsd# cp /boot/loader /fd/boot/loader

  根据FreeBSD的启动过程,现在我们已经准备好了引导程序和loader,接下来就要准备内核了。

  3、定制内核

  软盘的空间有限,所以我们需要定制一个小内核,而不能直接使用系统原来的内核。由于我们只使用软盘,所以内核中的关于scsi、ata、atapi和raid等这些东西都应该删除,因为我们不需要IPv6所以INET6也应该删除,具体留下些什么要看自己的用途了,这没有什么标准。不过有几样是必须的:

  options MFS # 内存文件系统支持。

  options MD_ROOT # 使用MD(内存磁盘)设备做root。

  options UFS # UFS文件系统支持。

  options UFS_ROOT # UFS ROOT。

  pseudo-device md # MD设备支持。

  下面是我使用的一个内核配制文件:   

# GENERIC -- Generic kernel configuration file for FreeBSD/i386
 
  # $FreeBSD: src/sys/i386/conf/GENERIC,
  v 1.246.2.38 2002/01/25 17:41:40 murray Exp $
  machine i386
  cpu I386_CPU
  cpu I486_CPU
  cpu I586_CPU
  cpu I686_CPU
  ident "MINI-KERNEL"
  maxusers 0
  #maxusers最好让系统自动分配,如果设得过大,会占用过多的内存。
  options INET #InterNETworking
  options FFS #Berkeley Fast Filesystem
  options FFS_ROOT #FFS usable as root device [keep this!]
  options MFS #Memory Filesystem
  options MD_ROOT #MD is a potential root device
  options COMPAT_43 #Compatible with BSD 4.3 [KEEP THIS!]
  options NO_SWAPPING #Disable swap   
  device isa
  device pci   
  # Floppy drives
  device fdc0 at isa? port IO_FD1 irq 6 drq 2
  device fd0 at fdc0 drive 0   
  # atkbdc0 controls both the keyboard and the PS/2 mouse
  device atkbdc0 at isa? port IO_KBD
  device atkbd0 at atkbdc? irq 1 flags 0x1
  device vga0 at isa?   
  # syscons is the default console driver, resembling an SCO console
  device sc0 at isa? flags 0x100   
  # Floating point support - do not disable.
  device npx0 at nexus? port IO_NPX irq 13   
  # 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 fxp # Intel EtherExpress PRO/100B (82557, 82558)
  device rl # RealTek 8129/8139
  device xl # 3Com 3c90x
  device lnc0
   at isa? port 0x280 irq 10 drq 0 # VMware Nic   
  # Pseudo devices - the number indicates how many units to allocate.
  pseudo-device loop # Network loopback
  pseudo-device ether # Ethernet support
  pseudo-device md # Memory "disks"

  上面的内核基本上是一个系统要运行的最小配制了,当然如果你的机器不同具体也不同,大家按自己的情况来定,我的机器配制是:  

作者:shnyuan    责编:豆豆技术应用

正在加载评论...