Hello,

2011/5/27 Bahadır Balban <bbalban@b-labs.com>
Hello,

The Android emulator supplied by Google:
http://developer.android.com/guide/developing/tools/emulator.html
http://developer.android.com/guide/developing/devices/emulator.html

is based on a very old version of QEMU (0.8.2?).

Technically, the emulator started a long time ago as a fork of 0.8.2 but we performed various integrations of upstream changes periodically.
For example, I just completed one very recently, see: https://review.source.android.com//#change,23266
 
There are still many upstream features that we don't support, but that's mainly due to two things:

- upstream changes _really_ tend to break/rewrite significant parts of the code every couple of months :)
- we are very conservative about what we integrate, we must support more than 150K application developers, most of them on platforms like Windows and OS X that are not really supported by upstream.

AFAIK it only supports an ARMv5 platform. It would be very useful to run later kernels and
ARMv7 platforms such as versatile express on the same emulator.

I agree, but please note that the last time I tried integrating the upstream ARM translator (about one year ago), it failed to properly emulate the platform.
Reasons were bugs in the ARM emulation (e.g. the "IT" Thumb-2 instruction was not handled properly when the list of conditional instructions spanned multiple pages, or when a page fault occured during the sequence). Also, there were drastic bugs and limitations in Neon emulation, which we rely heavily on the platform.

It might be interesting to try again to see if these problems persist (many of these issues seem to have been addressed in upstream by now), but the translator has, yet again, changed significantly,
and cannot be easily integrated into our codebase. Note that the most recent integration listed above was tempted to specifically get the new ARMv7 translator in, but this proved a bit too hard for the
small development window I dedicated to this task.
 
We can help with part of this work if anyone is willing to initiate and project-manage it.

We would certainly appreciate if anyone could work on this. It is a very time-consuming task with, I fear, low chances of success.

Note that the current code is currently able to emulate an ARMv7 kernel running an ARMv5TE platform image (or even an ARMv7 CPU running an ARMv5TE kernel+platform image).
You can test this by specifying the ARMv7 kernel, i.e. with -kernel $ANDROID_SOURCES/prebuilt/android-arm/kernel/kernel-qemu-armv7
There is a small hack under android/main.c that automatically enabled "-qemu -cpu cortex-a8" when the kernel file name ends with "-armv7"

Would you still be interested in doing this, I would be glad to provide any kind of guidance for this kind of work.

Thanks for your consideration.

- David

PS: I would strongly recommend using the Meego qemu branch rather than upstream, since it seems to have better ARMv7 support.
 
Regards,
Bahadir