For LNG work, we're currently using Qemu to emulate an A15 system.

We leverage the following work done by Linaro:

  • A15 support in Qemu.
  • 13.05 release image.

Below are notes on how to get a development setup working.

References

Preparing Images

  • Install linaro-image-tools

sudo add-apt-repository ppa:linaro-maintainers/tools
sudo apt-get update
sudo apt-get install linaro-image-tools
  • Download packages

wget http://releases.linaro.org/13.05/ubuntu/vexpress/hwpack_linaro-vexpress_20130526-344_armhf_supported.tar.gz
wget http://releases.linaro.org/13.05/ubuntu/vexpress/linaro-raring-developer-20130526-380.tar.gz
  • Create image

sudo linaro-media-create --rootfs ext3 --image-file file.img --binary linaro-raring-developer-20130526-380.tar.gz --hwpack hwpack_linaro-vexpress_20130526-344_armhf_supported.tar.gz --dev vexpress
sudo chown $USER:$USER file.img
  • Extract binaries (vmlinuz, initrd, dtb)

sudo apt-get install kpartx
sudo kpartx -a file.img

mkdir mnt1
sudo mount /dev/mapper/loop0p1 mnt1
cp mnt1/v2p-ca15-tc1.dtb .
sudo umount mnt1

mkdir mnt2
sudo mount /dev/mapper/loop0p2 mnt2
cp mnt2/boot/initrd.img-3.10.0-1-linaro-vexpress .
sudo cp mnt2/boot/vmlinuz-3.10.0-1-linaro-vexpress .
sudo chown $USER:$USER vmlinuz-3.10.0-1-linaro-vexpress
sudo umount mnt2

sudo kpartx -d file.img

Building Qemu

sudo apt-get install glib2.0-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libpixman-1-dev

git clone git://git.linaro.org/qemu/qemu-linaro.git

cd qemu-linaro
mkdir build; cd build
../configure --prefix=$PWD/../install --target-list=arm-softmmu --enable-debug
make
make install

Running Qemu

qemu-system-arm \
  -kernel vmlinuz-3.10.0-1-linaro-vexpress \
  -M vexpress-a15 -cpu cortex-a15 \
  -serial stdio -m 2048 \
  -initrd initrd.img-3.10.0-1-linaro-vexpress \
  -append 'root=/dev/mmcblk0p2 rw mem=2048M raid=noautodetect console=ttyAMA0,38400n8 rootwait vmalloc=256MB devtmpfs.mount=0' \
  -sd file.img \
  -dtb v2p-ca15-tc1.dtb

Running Qemu with TAP

1. Install bridge-utils package:

    $ sudo apt-get install bridge-utils

2. Determine what interface your connected network is on (i.e. by using ifconfig). We will assume in the remaining steps that it is on eth0. If your interface is different, replace all instances of eth0 with your interface.

3. Open /etc/network/interfaces for editing (as root)

Add the following section to /etc/network/interfaces:

auto br0
iface br0 inet dhcp
  bridge_ports eth0
  bridge_maxwait 0

Save and close /etc/network/interfaces

4. Bring-down the eth0 interface

$ sudo ifconfig eth0 0.0.0.0

5. Bring-up the br0 interface

$ sudo ifup br0

5. Load the tun module (you can add tun to /etc/modules if you want it loaded automatically on boot)

$ sudo modprobe tun

( Optional since default tun module present)

Make sure /dev/net/tun exists and has 0666 permission 
( Optional )

6. Now, Run Qemu with TAP

qemu-system-arm \
  -kernel vmlinuz-3.10.0-1-linaro-vexpress \
  -M vexpress-a15 -cpu cortex-a15 \
  -serial stdio -m 2048 \
  -initrd initrd.img-3.10.0-1-linaro-vexpress \
  -append 'root=/dev/mmcblk0p2 rw mem=2048M raid=noautodetect console=ttyAMA0,38400n8 rootwait vmalloc=256MB devtmpfs.mount=0' \
  -sd file.img \
  -dtb v2p-ca15-tc1.dtb \
  -net nic,macaddr=00:16:3e:00:00:01 -net tap

ZiShenLim/sandbox/UsingQemuVersatileExpress (last modified 2013-06-19 16:18:25)