Friday, December 2, 2016

QEMU : Installing Debian on Qemu emulated MIPS - Linux(x86) host

Hello People,

So, Here I needed to test some drivers functionality with 16K page size specifically. After walking through my options I settled with Linux on Qemu emulated MIPS. QEMU is a generic and open source machine emulator.



Here are the steps to install Debian on emulated MIPS machine using Qemu:


Preparation:
Here I am using Ubuntu 14.04 x86 system as my host machine.

1 . Installing Qemu on host system - install qemu package,

apt-get install qemu

2. Need to download a debian-installer kernel (vmlinux-3.16.0-4-4kc-malta) and initrd (initrd.gz) to boot from.

Setting up the MIPS system:

1. First need to create a virtual disk to install Debian on,

qemu-img create -f qcow2 debian_mips.qcow2 10G

This will create virtual disk of 10G size.

2. Next, install Debian to this virtual disk
qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -initrd initrd.gz -append "console=ttyS0" -nographic

Then follow shown on terminal as of normal Debian installation to the end.
This will take quite a while (so better get that fresh cup of coffee) as it will download all packages needed for installation.

boot:
After installations, next step is to boot into the system we just installed.

qemu-system-mips -hda debian_mips.qcow2 -kernel vmlinux-3.16.0-4-4kc-malta -append "root=/dev/sda1 console=ttyS0" -nographic

VoilĂ , you will be booted into MIPS system with Debian Linux!!
Rest is just usual Debian/Linux.


Accessing Host: 
Next thing that any developer will need is access to the Host system for exchanging all sort of stuff....driver, applicatin, source code etc.

You can SSH into the Host as bellow or just do SCP.
ssh host_user@10.0.2.2

Referances:
Networking: http://wiki.qemu.org/Documentation/Networking
Qemu: http://wiki.qemu.org/Main_Page

Cheers!!