制作RAMDISK in KERNEL的NetBSD
来源:cnfug
作者:Mathrew
时间:2007-04-22
点击:
[
收藏] [
投稿]
# Console Devices
# ISA console
#pc0 at isa? port 0x60 irq 1 # pccons generic PC console driver
# wscons
pckbc0 at isa? # pc keyboard controller
pckbd* at pckbc? # PC keyboard
#pms* at pckbc? # PS/2 mouse for wsmouse
vga0 at isa?
vga* at pci? dev ? function ?
pcdisplay0 at isa? # CGA, MDA, EGA, HGA
wsdisplay* at vga? console ?
wsdisplay* at pcdisplay? console ?
wskbd* at pckbd? console ?
#wsmouse* at pms? mux 0
pcppi0 at isa?
sysbeep0 at pcppi?
# Serial Devices
# PCI serial interfaces
com* at puc? port ? # 16x50s on "universal" comm boards
#cy* at pci? dev ? function ? # Cyclades Cyclom-Y serial boards
# ISA Plug-and-Play serial interfaces
com* at isapnp? # Modems and serial boards
# ISA serial interfaces
#options COM_HAYESP # adds Hayes ESP serial board support
com0 at isa? port 0x3f8 irq 4 # Standard PC serial ports
com1 at isa? port 0x2f8 irq 3
com2 at isa? port 0x3e8 irq 5
#com3 at isa? port 0x2e8 irq 9
#ast0 at isa? port 0x1a0 irq 5 # AST 4-port serial cards
#com* at ast? slave ?
#boca0 at isa? port 0x100 irq 5 # BOCA 8-port serial cards
#com* at boca? slave ?
#tcom0 at isa? port 0x100 irq 7 # TC-800 8-port serial cards
#com* at tcom? slave ?
#rtfps0 at isa? port 0x1230 irq 10 # RT 4-port serial cards
#com* at rtfps? slave ?
#cy0 at isa? iomem 0xd4000 irq 12 # Cyclades serial cards
# Miscellaneous mass storage devices
# Network Interfaces
# PCI network interfaces
fxp* at pci? dev ? function ? # Intel EtherExpress PRO 10+/100B
le* at pci? dev ? function ? # PCnet-PCI Ethernet
pcn* at pci? dev ? function ? # AMD PCnet-PCI Ethernet
rtk* at pci? dev ? function ? # Realtek 8129/8139
amhphy* at mii? phy ? # AMD 79c901 Ethernet PHYs
urlphy* at mii? phy ? # Realtek RTL8150L internal PHYs
ukphy* at mii? phy ? # generic unknown PHYs
# Pseudo-Devices
# disk/mass storage pseudo-devices
pseudo-device md 1 # memory disk device (ramdisk)
#pseudo-device vnd 4 # disk-like interface to files
# network pseudo-devices
pseudo-device bpfilter 8 # Berkeley packet filter
pseudo-device ipfilter # IP filter (firewall) and NAT
pseudo-device loop # network loopback
pseudo-device ppp 2 # Point-to-Point Protocol
pseudo-device pppoe 3
# miscellaneous pseudo-devices
pseudo-device pty 2 # pseudo-terminals (Sysinst needs two)
# wscons pseudo-devices
pseudo-device wsmux # mouse & keyboard multiplexor
#pseudo-device wsfont
2、制作ramdisk镜像
# dd if=/dev/zero of=/ramdisk bs=512 count=9000
# vnconfig -c /dev/vnd0d /ramdisk
# disklabel -r -w /dev/vnd0d rdroot
# newfs -m 0 -S 512 -i 4096 /dev/vnd0a
# mount /dev/vnd0a /mnt
# mkdir /mnt/{dev,bin,sbin,etc}
# cp /dev/MAKEDEV /mnt/dev
# cp /bin/{sh,ls} /mnt/bin
# cp /sbin/init /mnt/sbin
# cd /mnt/dev/ && ./MAKEDEV ramdisk
# echo 'echo "This is my minibsd all in kernel" && /bin/sh' > /mnt/etc/rc
# sync && umount /mnt
# sync && vnconfig -u vnd0d && sync
3、将ramdisk写入kernel
# mdsetroot /minibsd ramdisk
4、压缩kernel大小
# gzip -9 -c /minibsd > /minibsd.gz
5、制作目标软盘
因为系统需要使用/boot(/usr/mdec/boot)来加载kernel,所以我们需要在软盘上放置boot文件。
# disklabel -B -w -r /dev/fd0a fd1440
# newfs -m 0 -S 512 /dev/fd0a
# mount /dev/fd0a /mnt
# cp /usr/mdec/boot /mnt
# cp /minibsd.gz /mnt/netbsd
现在你的ramdisk in kernel的mininetbsd系统就已经做好了。
原文链接:http://cnfug.org/journal/systems/2004/000070.html
如果您对本文有任何疑问或者建议,请到讨论区发表您的意见:
>>
论坛入口 <<
上一篇:
制作RAMDISK in KERNEL的OpenBSD 下一篇:
FreeBSD光盘运行版的制作过程
【文章评论】
【收藏本文】
【推荐好友】
【打印本文】
【我要投稿】 【论坛讨论】