I'm trying to emulate a TP-Link WR740N in Qemu (MIPS). I have extracted the rootfs.img
from the firmware, and downloaded vmlinux-2.6.32-5-4kc-malta
from here: http://people.debian.org/~aurel32/qemu/mips/.
Then, I started Qemu with these parameters:
qemu-system-mips -M malta -kernel 'vmlinux-2.6.32-5-4kc-malta' -hda 'rootfs.img' -append "root=/dev/sda1 console=tty0" -nographic
And it got stuck on:
[0.000000] console [tty0] enabled, bootconsole disabled
I've also tried to run it like this:
sudo qemu-system-mips -M malta -initrd 'rootfs.img' -kernel 'vmlinux-2.6.32-5-4kc-malta' -nographic -append "console=ttyS0,115200 root=/dev/sda rootfstype=jffs2 init=/sbin/init" -hda 'hda.img'
and I get this error:
[ 0.796000] sda: unknown partition table
[ 0.808000] sd 0:0:0:0: [sda] Attached SCSI disk
[ 0.812000] RAMDISK: squashfs filesystem found at block 0
[ 0.812000] RAMDISK: Loading 2556KiB [1 disk] into ram disk... done.
[ 0.928000] VFS: Cannot open root device "sda" or unknown-block(8,0)
[ 0.928000] Please append a correct "root=" boot option; here are the available partitions:
[ 0.928000] 0800 65536 sda driver: sd
[ 0.932000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,0)
New try after answer from 6EQUJ5 [I still get the same error though (the second one)]:
This is what I'm trying:
sudo qemu-system-mips -M malta -kernel 'vmlinux-2.6.32-5-4kc-malta' -nographic -append "init=/bin/sh" -hda 'myFileSystem.img'
And this is a link to download the filesystem I've created:
http://speedy.sh/vBUEQ/myFileSystem.img
Running "file" on my filesystem:
Linux rev 1.0 ext2 filesystem data (mounted or unclean), UUID=dac7072e-2c8b-408f-a080-57ea60cfd9ea
Those are the commands I've used to create it and move the files into it:
dd if=/dev/zero of=~/myFileSystem.img bs=1024 count=65536
mke2fs myFileSystem.img
mkdir /mnt/virtual
mount -o loop ~/myFileSystem.img /mnt/virtual
hda.img
. How did you create that file? If you makehda.img
anext2
filesystem and copy an init into it and leave off the-initrd
argument you may get a little further booting, although you wont be emulating the WR740N at all by then...