Has anyone successfully compiled the android kernel and tested it in the Android emulator, and if so is there anything that special that needs to be done?
Documentation for the SDK is excellent, however documentation for compiling the kernel and setting up a custom machine in the emulator has been hard for me to find.
'goldfish' is the name of a family of similar virtual hardware platforms, that. mostly differ in the virtual CPU they support. ' goldfish' started as an. ARM-specific platform, but has now been ported to x86 and MIPS virtual CPUs. Inside of QEMU, goldfish-specific virtual device implementation sources files.
lunch. Choose which target to build with lunch . lunch product_name - build_variant selects product_name as the product to build, and build_variant as the variant to build, and stores those selections in the environment to be read by subsequent invocations of m and other similar commands.
Since August 2009 the kernel is no longer part of the standard repo manifest that you get when you follow the instructions to download the source code for the android open source project. The steps that are needed to successfully download, build and run a specific kernel on the emulator are as follows:
git clone https://android.googlesource.com/kernel/goldfish.git
git checkout -t origin/android-goldfish-2.6.29 -b goldfish
make ARCH=arm goldfish_defconfig
make ARCH=arm goldfish_armv7_defconfig
make ARCH=arm CROSS_COMPILE=mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.2.1/bin/arm-eabi-
emulator -kernel mydroid/kernel/common/arch/arm/boot/zImage
Note that I have used the default paths in the above description, you need to change them to what applies to your setup. It has been a some time since last time I tested this but I think it should work.
Some extra information: In the standard Android open source distribution the kernel is distributed as a pre-built binary in the mydroid/prebuilt/android-arm/kernel
folder and the source code is not included. The kernel source was removed from the default manifest for two reasons as I take it. One is that it takes a lot of bandwith and diskspace for a platform component that most people will not work with much. The other reason is that since the kernel is built with the kernel build system and not as part of the aosp build system it makes sense to keep it separated. The common branch for the kernel is the one used by the emulator. There are also branches for experimental, msm (Qualcomm platforms) and Omap (TI platform) and maybe some more. If you want to use the Android kernel with hardware these may be more interesting to you.
Just to correct a few things from BMB's post (which was very useful to me, it saved my project) :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With