How to compile the Android kernel android android goldfish 3.4 and run the emulator

First let me tell you that I am working on a MAC with OS X 10.7.5. I am trying to compile the Goldfish 3.4 kernel and run it on an emulator. It compiles fine, but when I run it, the emulator opens and freezes. When I make a "top", I see that the emulator works like crazy, but nothing appears on the screen. This is how I compiled the kernel

git clone https://android.googlesource.com/kernel/goldfish.git git checkout -t origin/android-goldfish-3.4 -b goldfish3.4 make ARCH=arm goldfish_defconfig make ARCH=arm SUBARCH=arm CROSS_COMPILE=/Volumes/androidSpace/android_work/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6/bin/arm-eabi- 

Then I run the emulator through

 ./emulator -debug init -kernel /Volumes/androidSpace/goldfish/goldfish/arch/arm/boot/zImage -system /Volumes/androidSpace/android_work/out/target/product/generic/system.img -ramdisk /Volumes/androidSpace/android_work/out/target/product/generic/ramdisk.img -avd firstAvd -wipe-data 

Here is the last part of the debug output from emulator startup

 QEMU options list: emulator: argv[00] = "./emulator64-arm" emulator: argv[01] = "-android-hw" emulator: argv[02] = "/Users/deathwillarrive/.android/avd/firstAvd.avd/hardware-qemu.ini" Concatenated QEMU options: ./emulator64-arm -android-hw /Users/deathwillarrive/.android/avd/firstAvd.avd/hardware-qemu.ini emulator: registered 'boot-properties' qemud service emulator: nand_add_dev: system,size=0x22600000,initfile=/Volumes/androidSpace/android_work/out/target/product/generic/system.img,pagesize=512,extrasize=0 emulator: mapping 'system' NAND image to /tmp/android-deathwillarrive/emulator-2Wyv0t emulator: nand_add_dev: userdata,size=0xc800000,file=/Users/deathwillarrive/.android/avd/firstAvd.avd/userdata-qemu.img,initfile=/Users/deathwillarrive/.android/avd/firstAvd.avd/userdata.img,pagesize=512,extrasize=0 emulator: registered 'boot-properties' qemud service emulator: Adding boot property: 'dalvik.vm.heapsize' = '64m' emulator: Adding boot property: 'qemu.sf.lcd_density' = '320' emulator: Adding boot property: 'qemu.hw.mainkeys' = '0' emulator: Adding boot property: 'qemu.sf.fake_camera' = 'none' emulator: nand_add_dev: cache,size=0x4200000,file=/Users/deathwillarrive/.android/avd/firstAvd.avd/cache.img,pagesize=512,extrasize=0 emulator: Initializing hardware OpenGLES emulation support emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1 emulator: Trace file name is not set emulator: autoconfig: -scale 0.583594 emulator: Could not open file: (null)/system/build.prop: No such file or directory emulator: control console listening on port 5554, ADB on port 5555 emulator: sent '0012host:emulator:5555' to ADB server emulator: ping program: /Volumes/androidSpace/android_work/out/host/darwin-x86/bin/./DDSs 

The exit here just freezes. Does anyone know the steps to create a 3.4 goldfish kernel.

+6
source share
2 answers

The goldfish_defconfig target configures the kernel for the ARM 926, but now the emulator is configured to work on the A8 cortex, which is an armv7 architecture. Instead, you should use "goldfish_armv7_defconfig".

Follow these steps to create a 3.4 kernel for the emulator

 git clone https://android.googlesource.com/kernel/goldfish.git git checkout -t origin/android-goldfish-3.4 -b goldfish3.4 make ARCH=arm goldfish_armv7_defconfig make ARCH=arm SUBARCH=arm CROSS_COMPILE=/Volumes/androidSpace/android_work/prebuilts/gcc/darwin-x86/arm/arm-eabi-4.6/bin/arm-eabi- 

This should build a 3.4 kernel that you can run this way (I assume your directory structure has a default of sdk ramdisk.img)

 ./emulator -debug init -kernel /Volumes/androidSpace/goldfish/goldfish/arch/arm/boot/zImage -system /Volumes/androidSpace/android_work/out/target/product/generic/system.img -ramdisk /Volumes/androidSpace/android_work/out/target/product/generic/ramdisk.img -avd firstAvd -wipe-data 

Try it and let us know

+10
source

where to get this emulator to test the kernel. or how can I add this compiled kernel to the android studio emulator. It will be very helpful.

0
source

All Articles