把jslinux的硬盘下载下来
得到近1000个.bin文件
生成rootfs
编译内核
下载
按照linuxstart-20120111修改部分代码,打patch等,
参考
[url]http://haoningabc.iteye.com/blog/2148555[/url]
make ARCH=i386 -j16
生成
linux-2.6.20/arch/i386/boot/bzImage
后
host=http://bellard.org/jslinux/
wget $host/cpux86-ta.js
wget $host/cpux86.js
wget $host/jslinux.js
wget $host/term.js
wget $host/utils.js
wget $host/linuxstart.bin
wget $host/vmlinux-2.6.20.bin
i=0
while [ $i -le 999 ]; do
hda=$(printf 'hda%09d.bin' $i)
if [ ! -f $hda ]; then
wget $host/$hda &
fi
i=$(( $i + 1 ))
done
得到近1000个.bin文件
cat hda000000*.bin > hda.bin
mount -t ext2 -o loop hda.bin /mnt/jshda
cp -r /mnt/jshda jslinux
生成rootfs
#!/bin/sh
KERNEL=$(pwd)
cd jslinux
find . | cpio -o --format=newc > $KERNEL/rootfs.img
cd $KERNEL
gzip -c rootfs.img > rootfs.img.gz
编译内核
下载
linux-2.6.20.tar.bz2
tar jxvf linux-2.6.20.tar.bz2
cd linux-2.6.20
cp ../linuxstart-20120111/config_linux-2.6.20 .config
按照linuxstart-20120111修改部分代码,打patch等,
patch -p1 <../linuxstart-20120111/patch_linux-2.6.20
参考
[url]http://haoningabc.iteye.com/blog/2148555[/url]
make ARCH=i386 -j16
生成
linux-2.6.20/arch/i386/boot/bzImage
后
qemu-system-i386 -kernel linux-2.6.20/arch/i386/boot/bzImage -m 128M -initrd rootfs.img.gz -append "root=/dev/ram rdinit=bin/sh init=linuxrc console=ttyS0" -serial stdio -vnc 0.0.0.0:4