User Tools

Site Tools


cs438:cs-438_compile_and_run_the_android_goldfish_kernel_for_intel_x86

Compile And Run The Android Goldfish Kernel for Intel x86


This tutorial builds on the previous tutorial in which you compiled and ran the Android goldfish kernel for the ARM architecture.

For long Terminal commands, I recommend copying and pasting from this page to the Terminal.


If you have not done this already, create a symbolic link (shortcut) to the /usr/local/android/sdk/src/kernel/goldfish directory with the following Terminal commands:

    ln -s /usr/local/android/sdk/src/kernel/goldfish ~/goldfish

After you have created the symbolic link with the ln command, to change to the goldfish kernel source directory, you just need to run

    cd ~/goldfish

Part 2. Prepare the kernel source for recompile

Change to the goldfish kernel source directory:

    cd ~/goldfish

Delete any old compiled binaries:

    make clean
    make mrproper # reset kernel configuration

Part 3. Set compile variables to compile kernel for x86

Add linux-x86 Android Native Development Kit (NDK) compile toolchain path to $PATH:

    export PATH=/usr/local/android/sdk/prebuilt/linux-x86/toolchain/i686-linux-android-4.6/bin:$PATH

Set up gcc to compile kernel for x86 architecture.

    export CROSS_COMPILE=i686-linux-android-

Part 4. Compile kernel for x86

Configure x86 kernel:

    make ARCH=x86 CC="${CROSS_COMPILE}gcc -mno-android" goldfish_defconfig

Compile x86 kernel:

    make ARCH=x86 CC="${CROSS_COMPILE}gcc -mno-android" bzImage

Part 5. Run newly-compiled kernel with x86-based AVD

Copy newly compiled kernel image bzImage to ~/android:

    cp arch/x86/boot/bzImage bzImage-x86-goldfish-2.6.29

Start your Intel-based AVD with new kernel (substitute your Intel-based AVD name for “TestAVDintel” below):

    emulator -kernel bzImage-x86-goldfish-2.6.29 -avd TestAVDintel -qemu -enable-kvm -show-kernel

The -qemu -enable-kvm -show-kernel options are optional, but they might speed up your Intel-based AVD and also show kernel messages during bootup.


cs438/cs-438_compile_and_run_the_android_goldfish_kernel_for_intel_x86.txt · Last modified: 2013/10/31 23:25 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki