Tuesday, June 14, 2011

ARM Qemu

Qemu

Qemu
[ ]# mkdir /home/qemu
[ ]# cd /home/qemu/
[ ]# git clone git://git.qemu.org/qemu.git qemu-git
[ ]# cd qemu-git/
[ ]# ./configure --target-list="arm-softmmu"
[ ]# make
[ ]# cp arm-softmmu/qemu-system-arm /usr/bin/

Or
http://download.savannah.gnu.org/releases/qemu/qemu-0.14.1.tar.gz

U-boot
[ ]# cd /home/qemu/
[ ]# wget http://ftp.denx.de/pub/u-boot/u-boot-2010.03.tar.bz2
[ ]# cd u-boot-2010.03
[ ]# make versatilepb_config ARCH=arm CROSS_COMPILE=arm-linux-
[ ]# make all ARCH=arm CROSS_COMPILE=arm-linux-
[ ]# qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin

U-Boot 2010.03 (Jun 15 2011 - 14:38:26)

DRAM: 0 kB
## Unknown FLASH on Bank 1 - Size = 0x00000000 = 0 MB
Flash: 0 kB
*** Warning - bad CRC, using default environment

In: serial
Out: serial
Err: serial
Net: SMC91111-0
VersatilePB # print
bootargs=root=/dev/nfs mem=128M ip=dhcp netdev=25,0,0xf1010000,0xf1010010,eth0
bootdelay=2
baudrate=38400
bootfile="/tftpboot/uImage"
stdin=serial
stdout=serial
stderr=serial
verify=n
ethact=SMC91111-0

Environment size: 202/8188 bytes
VersatilePB #

Simple "Hello World!" Root File System
[ ]# cd /home/qemu/
[ ]# echo "#include " > test.c
[ ]# echo "int main() {" >> test.c
[ ]# echo -e '\tprintf("Hello World!\\n");' >> test.c
[ ]# echo -e "return 0;" >> test.c
[ ]# echo "}" >> test.c

[ ]# arm-linux-gcc -static test.c -o test
[ ]# echo test | cpio -o --format=newc > rootfs

ARM Linux Versatile (ARMv5)
[ ]# cd /home/qemu/
[ ]# wget http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.12.tar.bz2
[ ]# tar jxvf linux-2.6.35.12.tar.bz2
[ ]# cd linux-2.6.35.12
[ ]# make ARCH=arm versatile_defconfig
[ ]# make ARCH=arm menuconfig

Enabling EABI support in the kernel. (CONFIG_AEABI=y, CONFIG_OABI_COMPAT=y)

[ ]# make ARCH=arm CROSS_COMPILE=arm-linux- all
[ ]# qemu-system-arm -M versatilepb -m 128M -kernel arch/arm/boot/zImage -initrd rootfs -serial stdio -append "console=ttyAMA0 root=/dev/ram rdinit=/test"

You can use “-nographic” instead of “-serial stdio” to launch QEMU without opening another window, but then to close it you have to type Ctrl-A and then “x”.

How to install Qemu in Linux for Versatile Express platform
Processor: Cortex A9

COREMU

No comments: