Follow @devcrafter91

Running MIPS on Linux using qemu

Sun Mar 31 2019 linux mips hack


MIPS is an RISC architecture widely used by embedded devices such as routers. I had a Zyxel router and I was doing some nasty things to it but before everything else I thought learning about the environment of this piece of junk should be more classy than just hack & smash the shit out of it. Here's a quick and lazy brief about how I was running MIPS using QEMU on Linux Debian.

Install qemu

apt-get install qemu-system-mips

Grab Debian Mips & Vmlinux image


Install & link Vgabios

apt-get install vgabios
ln -s /usr/share/vgabios/vgabios* /usr/share/qemu/

Grab the efi-e1000.rom needed by qemu for network stuff

wget -O /usr/share/qemu/efi-e1000.rom 

Run (May be slow, around ~5mins till boot)

qemu-system-mips -M malta -kernel ./vmlinux-3.2.0-4-4kc-malta \
-hda ./debian_wheezy_mips_standard.qcow2 -append "root=/dev/sda1 \
console=ttyS0"  -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::5555-:22 \

Connect via SSH

ssh -p 5555

Copying files

scp -P 5555 ./myfile  root@

How to stop it

kill -15 `pidof qemu-system-mips`