Stefan Weil released QEMU sources with AR7 emulation. It's not perfect ( no network, flash emulation incompatible with WAG200G, painfully slow ), but it's handy to test some startup scripts, and check if your freshly built system images are bootable at all ;)

Here's how to boot my rebuilded images under QEMU patched by Stefan. It's a full boot with ADAM2 loader execution in the first stage of startup.

  • Get, compile and install QEMU with AR7 emulation from Stefan Weil : http://developer.berlios.de/project/showfiles.php?group_id=3721
  • Get code/bootloader/loader.bin from the Linksys image. Rename it to mips_bios.bin
  • Prepare flashimage.bin. To do this, you'll need WAG200G running rebuilded system image.
    • Open the session on the WAG200G
    • cd to /tmp
    • make flashimage.bin:

wag200:#cat /dev/mtdblock/2 > flashimage.bin

wag200:#cat /dev/mtdblock/1 >> flashimage.bin

wag200:#cat /dev/mtdblock/0 >> flashimage.bin

wag200:#cat /dev/mtdblock/5 >> flashimage.bin

wag200:#cat /dev/mtdblock/3 >> flashimage.bin

wag200:#cat /dev/mtdblock/4 >> flashimage.bin

    • ftpput your new flashimage.bin to the host where you'll be running an emulation
    • close session.
  • Change directory to the location of mips_bios.bin, and flashimage.bin, and run QEMU:

user@host:#qemu-system-mipsel -L . -nographic

  • This is how my bootlog looks like.
  • You can boot freshly rebuilt images in qemu by saving /dev/mtdblock/5, /dev/mtdblock/3 and /dev/mtdblock/4 from the WAG200G, to your hard disk, and issuing the following:
    host#cat WAG200G_V1.00.07.img > flashimage.bin
    host#cat mtdblock5 >> flashimage.bin
    host#cat mtdblock3 >> flashimage.bin
    host#cat mtdblock4 >> flashimage.bin
    Now you have a proper flashimage.bin file for qemu.