android内核编译及模拟器运行过程记录

版权声明:本文为博主原创文章,欢迎转载!转载请写明原文链接出处! https://blog.csdn.net/brightming/article/details/49837081

android内核是在前段时间下载的,由于之前android的源码没有编译成功,所以只是拿来看代码。今天把android的源码编过了,开始到kernel了。

在kernel目录查看版本情况:
[zzz@localhost goldfish]$ git branch -a
* (detached from origin/android-goldfish-3.4)
master
remotes/origin/HEAD -> origin/master
remotes/origin/android-3.10
remotes/origin/android-3.18
remotes/origin/android-3.4
remotes/origin/android-goldfish-2.6.29
remotes/origin/android-goldfish-3.10
remotes/origin/android-goldfish-3.10-l-mr1-dev
remotes/origin/android-goldfish-3.10-m-dev
remotes/origin/android-goldfish-3.18-dev
remotes/origin/android-goldfish-3.4
remotes/origin/android-goldfish-3.4-l-mr1-dev
remotes/origin/linux-goldfish-3.0-wip
remotes/origin/master

重新checkout 了3.4的goldfish的内核:
git checkout remotes/origin/android-goldfish-3.4
这个很快。

[gumh@localhost goldfish]$ make ARCH=arm goldfish_armv7_defconfig .config

configuration written to .config

make[1]: Nothing to be done for `.config’.

[zzz@localhost goldfish]$ make ARCH=arm CROSS_COMPILE=/home/gumh/opensource/android-src/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin/arm-linux-androideabi-

上面要说明一下,这个CROSS_COMPILE工具网上有些说要下载,我这边是看到在下载的android的源码的prebuilts目录下就自带了。

scripts/kconfig/conf –silentoldconfig Kconfig
WRAP arch/arm/include/generated/asm/auxvec.h
WRAP arch/arm/include/generated/asm/bitsperlong.h
WRAP arch/arm/include/generated/asm/cputime.h
WRAP arch/arm/include/generated/asm/emergency-restart.h
WRAP arch/arm/include/generated/asm/errno.h
WRAP arch/arm/include/generated/asm/ioctl.h
WRAP arch/arm/include/generated/asm/irq_regs.h
WRAP arch/arm/include/generated/asm/kdebug.h
WRAP arch/arm/include/generated/asm/local.h
WRAP arch/arm/include/generated/asm/local64.h


AS arch/arm/boot/compressed/lib1funcs.o
SHIPPED arch/arm/boot/compressed/ashldi3.S
AS arch/arm/boot/compressed/ashldi3.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready

运行模拟器:
[zzz@localhost generic]emulator -image system.img -data userdata.img -ramdisk ramdisk.img -kernel ~/opensource/android/goldfish/arch/arm/boot/zImage &  
[1] 22352  
[zzz@localhost generic]
emulator: WARNING: Please note that -image is obsolete and that -system is now used to point
to the system image. Next time, try using ‘-sysdir -system ’ instead.

emulator: WARNING: system partition size adjusted to match image file (1536 MB > 200 MB)

emulator: WARNING: data partition size adjusted to match image file (550 MB > 200 MB)

emulator: WARNING: Increasing RAM size to 1GB
emulator: UpdateChecker: skipped version check

等了很多(5,6分钟吧),看起来图片是这样的:
这里写图片描述

好像不成功的样子。。。。

再等多3分钟左右:
这里写图片描述

出来主界面了~~~~~~

操作一下,解锁进入主界面:
这里写图片描述

看一下联系人应用:
这里写图片描述

感觉还是不错的 ~~~

接下来可开始学习写hal层的代码,熟悉其流程了。

展开阅读全文

没有更多推荐了,返回首页