Difference between revisions of "QEMU"
m (→Launch it) |
m (→Get/generate simulation images) |
||
Line 48: | Line 48: | ||
* In our tests we used the QEMU Versatile PB emulated hardware. To get a compatible Linux kernel for this board then: | * In our tests we used the QEMU Versatile PB emulated hardware. To get a compatible Linux kernel for this board then: | ||
[armadeus]$ wget http://people.debian.org/~aurel32/arm-versatile/vmlinuz-2.6.18-6-versatile | [armadeus]$ wget http://people.debian.org/~aurel32/arm-versatile/vmlinuz-2.6.18-6-versatile | ||
− | * in ''buildroot/ | + | * in ''buildroot/project_build_armv4t/apf9328/root/etc/inittab'', comment following line: |
ttySMX0::respawn:/sbin/getty -L ttySMX0 115200,57600,38400 vt100 | ttySMX0::respawn:/sbin/getty -L ttySMX0 115200,57600,38400 vt100 | ||
* Generate your Armadeus Rootfs as an EXT2 image: | * Generate your Armadeus Rootfs as an EXT2 image: | ||
Line 56: | Line 56: | ||
* be sure that your rootfs image is less than 16Mbytes (Ramdisk limit) | * be sure that your rootfs image is less than 16Mbytes (Ramdisk limit) | ||
* and zip it (we will use it as Ramdisk first): | * and zip it (we will use it as Ramdisk first): | ||
− | [armadeus]$ gzip -9 buildroot/binaries/ | + | [armadeus]$ gzip -9 buildroot/binaries/apf9328/apf9328-rootfs.arm.ext2 |
* Create a fake QEMU Hard disk image | * Create a fake QEMU Hard disk image |
Revision as of 00:15, 7 December 2008
Contents
UNDER CONSTRUCTION
Well, you don't have enough money to buy an Armadeus board and just want to be part of the "Software" side of the project ? Then QEMU can be a good choice for you !!
Just be aware that currently Armadeus hardware is not emulated under QEMU, we are just using an other board hard and linux kernel to launch our Rootfs an test our software which is not custom hardware related (ie User interface, Network, etc...)
In order to build a hardware matching machine under Qemu for Armadeus boards, follow this link and add devices you are intrested to see emulated in Qemu: Qemu machine development
Installation
- on Debian, *Ubuntu just do a:
[armadeus]$ sudo apt-get install qemu bridge-utils ?vde?
Configuration
QEMU has several ways of emulating the network:
- user mode (by default): you can access Internet from your emulated target or an internal Samba/TFTP server but your are not directly accessible
- bridge mode: you can communicate directly with the Host
For a first try you can skip following part.
As we want want to mimic the devt environment with a real target (that has its own IP adress and is eccesible from the host) we will use "bridged mode". This mode require some configuration on your Host:
- Activate IPv4 forwarding, for example on Ubuntu, uncomment the following line in /etc/sysctl.conf:
$ sudo vim /etc/sysctl.conf # Uncomment the next line to enable packet forwarding for IPv4 #net/ipv4/ip_forward=1
- In /etc/network/interface comment the line refering to your current ethernet card and replace them with:
auto br0 iface br0 inet static address 192.168.1.2 ?? network 192.168.1.0 ?? netmask 255.255.255.0 broadcast 192.168.1.255 ?? gateway 192.168.1.1 ?? bridge_ports eth0 bridge_fd 9 bridge_hello 2 bridge_maxage 12 bridge_stp off #auto eth0 #iface eth0 inet dhcp
Get/generate simulation images
- In our tests we used the QEMU Versatile PB emulated hardware. To get a compatible Linux kernel for this board then:
[armadeus]$ wget http://people.debian.org/~aurel32/arm-versatile/vmlinuz-2.6.18-6-versatile
- in buildroot/project_build_armv4t/apf9328/root/etc/inittab, comment following line:
ttySMX0::respawn:/sbin/getty -L ttySMX0 115200,57600,38400 vt100
- Generate your Armadeus Rootfs as an EXT2 image:
[armadeus]$ make menuconfig Target filesystem options ---> [*] ext2 root filesystem [armadeus]$ make
- be sure that your rootfs image is less than 16Mbytes (Ramdisk limit)
- and zip it (we will use it as Ramdisk first):
[armadeus]$ gzip -9 buildroot/binaries/apf9328/apf9328-rootfs.arm.ext2
- Create a fake QEMU Hard disk image
[armadeus]$ qemu-img create -f qcow rootfs.arm_nofpu2.img 20M
Launch it
- At first boot, you have to launch the system as a Ramdisk:
[armadeus]$ qemu-system-arm -m 32 -M versatilepb -kernel vmlinuz-2.6.18-6-versatile \ -initrd rootfs.arm.ext2.gz -append "root=/dev/ram" -hda ./rootfs.arm_nofpu2.img
- When system has booted, we will create the "hard disk" image. But first, if you are French, do:
# loadkmap < /etc/i18n/fr.kmap
- then:
# mkdir /tmp/dev # mknod /tmp/dev/sda b 8 0 # mknod /tmp/dev/sda b 8 1 # fdisk /tmp/dev/sda n p 1 <enter> <enter> # mkfs.ext2 /tmp/dev/sda1