Qemu options


9 posts
by dics » Wed Feb 08, 2012 12:55 pm
Hi guys,

i am trying to emulate the kernel provided on git with Qemu 1.0

After recompiling Qemu with support for arm-softmmu and arm-linux-user i try to run a virtual machine using the parameter -cpu arm1176 and nothing happens. Qemu starts, VNC server is initialized and i can connect to it but i get absolutely nothing on VNC client.

The R-Pi kernel has been compiled using code sourcery lite (arm-none-eabi...), ARM V6 is enabled.

Is there anything else i should be aware of when trying to do this the right way ? Has anyone succeeded in emulating the kernel inside Qemu ?

Thank you for your time

dics
Posts: 14
Joined: Mon Feb 06, 2012 3:54 pm
by nick.mccloud » Wed Feb 08, 2012 3:06 pm
You will need a root file system with most of the core bits of linux.

Here's one I prepared earlier:

http://dl.dropbox.com/u/606232.....ian.tar.gz

which is used in this:

http://www.raspberrypi.org/for.....oremulator - this is the VMware version

and this:

http://www.raspberrypi.org/for.....-added-cow

Built this largely using info from this:

http://www.cnx-software.com/20.....with-qemu/
User avatar
Posts: 797
Joined: Sat Feb 04, 2012 4:18 pm
by nick.mccloud » Wed Feb 08, 2012 3:10 pm
PS: The debian.tar.gz package also has a known good command line to launch qemu.
User avatar
Posts: 797
Joined: Sat Feb 04, 2012 4:18 pm
by teh_orph » Wed Feb 08, 2012 3:27 pm
I've been running the rpi git kernel in qemu (well, the qemu provided with the android 4.0 SDK) and have had decent success with it. Much of it was done with GDB and IDA Pro though.

How far exactly have you got? It was quite a lot of work to even get the kernel to start - I wouldn't expect any kind of networking to start up, as there's no qemu networking in the kernel (by default).

Out of interest, have you got any kernel TTY output?
User avatar
Posts: 345
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
by dics » Wed Feb 08, 2012 4:00 pm
Hello again

I know i need a root file system but i can't get to the point where i need it since my kernel is not even starting :)

I read http://www.cnx-software.com/20.....-with-qemu but i recompiled the kernel using the config file located under arch/arm/configs/bcmrpi_cutdown_defconfig

When i want to start qemu with this command line : qemu-system-arm -M versatilepb -cpu arm1176 -m 256 -hda rootfs.ext2 -kernel zImage -append "root=/dev/sda rw init=/bin/bash" -serial stdio

———–> nothing happens. I see the initialization parameters for Qemu, i see the VNC server starting and i can connect to it but other than this nothing happens. Is like Qemu is waiting for something or cannot understand the kernel i am providing (zImage which was under arch/arm/boot in the kernel source tree after recompilation)

LE: btw, i am using Debian 6.0.4 inside VirtualBox for the development
Posts: 14
Joined: Mon Feb 06, 2012 3:54 pm
by teh_orph » Wed Feb 08, 2012 4:10 pm
So can you confirm - is the linux kernel actually starting, or are you connecting to the qemu vnc output? (ie the vnc server provided by qemu, *not* by the emulated OS)
User avatar
Posts: 345
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
by dics » Wed Feb 08, 2012 4:17 pm
I tried the dropbox file posted by nmcc and that works ! I can see in the VNC output the whole dmesg scroll list.

So this means my kernel is not properly compiled. Can anyone send me a proper config file for recompilation if you made other modifications to the original arch/arm/configs/bcmrpi_cutdown_defconfig ?

It might me this or it might also be the compiler : Sourcery g++ lite i am using :(

ter_orph : my kernel is not starting, but the one from user "nmcc" is. What did you use to recompile the kernel ?
Posts: 14
Joined: Mon Feb 06, 2012 3:54 pm
by teh_orph » Wed Feb 08, 2012 4:28 pm
Yes the instructions on that linked site include settings options for hardware that is emulated by qemu, eg a SCSI controller. The rpi configuration file only includes what's necessary for the rpi hardware.
User avatar
Posts: 345
Joined: Mon Jan 30, 2012 2:09 pm
Location: London
by dics » Wed Feb 08, 2012 4:31 pm
So "SYM53C8XX  Version 2 SCSI support" is emulated by Qemu ? I could not find that option at the first glance...
Posts: 14
Joined: Mon Feb 06, 2012 3:54 pm