如何编译android goldfish 3.4内核并在模拟器上运行

时间:2023-04-21
本文介绍了如何编译android goldfish 3.4内核并在模拟器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

首先让我告诉你,我正在使用 OS X 10.7.5 开发 MAC.我正在尝试编译 Goldfish 3.4 内核并在模拟器上运行它.它可以编译,但是当我运行它时,模拟器会打开并冻结.当我做顶部"时,我可以看到模拟器疯狂地运行,但屏幕上什么也没有出现.这是我编译内核的方法

First let me tell you that I am working on MAC with OS X 10.7.5. I am trying to compile Goldfish 3.4 kernel and run it on emulator. It compiles alright but when I run it the emulator opens and freezes. When I do a "top", I can see the emulator running like crazy but nothing turns up on the screen. Here 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-

然后我通过

./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 running the emulator

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

输出只是在这里冻结.有谁知道构建3.4金鱼内核的步骤.

The output just freezes here. Does anybody know the steps to build 3.4 goldfish kernel.

推荐答案

目标goldfish_defconfig"为 ARM 926 配置内核,但现在模拟器配置为在 armv7 架构的 cortex A8 上运行.您应该改用goldfish_armv7_defconfig".

The target "goldfish_defconfig" configures the kernel for an ARM 926 but the now the emulator is configured to run on cortex A8 which is a armv7 architecture. You should use "goldfish_armv7_defconfig" instead.

按照这些步骤为模拟器构建 3.4 内核

Follow these steps to build a 3.4 kernel for 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-

这应该构建一个 3.4 内核,然后您可以像这样运行它(我假设您的目录结构具有默认的 sdk ramdisk.img)

This should build a 3.4 kernel which you can then run like this (I am assuming your directory structure has default 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

试试这个并告诉我们

这篇关于如何编译android goldfish 3.4内核并在模拟器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:如何在 Android Studio 的模拟器上更新 Google Play 服务 下一篇:如何在 Android Emulator 中禁用 Internet 连接?

相关文章