刚接触kernel,为了学习源码,自己在虚拟机上用qemu来run image:
“qemu -kernel linux-stable-3.8.3/bzImage -hda ramdisk/linux-0.2.img -append root=/dev/sda -s”
但在build fs时卡住了,从qemu官网下载的linux-0.2.img可以用;自己fs的总是挂,以下是我的脚本:
#!/bin/bash
#------------- make file systemdd if=/dev/zero of=rootfs bs=1M count=16 &>/dev/null ##--16M disk
mkfs.ext2 -m 0 -N 2000 rootfs &> /dev/null ##--format to ext2, max node 2k
#------------- mount to ramdisk
mkdir ramdisk_1
mount -t ext3 -o loop rootfs ramdisk_