接下来详细列举下Android主要改动的部分:
1 、Goldfish
Android模拟器通过运行一个Goldfish的虚拟CPU.Goldfish来运行arm926t指令集(arm926t属于armv5构架),并且仿真了输入/输出,比如键盘输入和LCD 输出。这个模拟器其实是在qemu之上开发的,输入/输出是基于libSDL的。既然Goldfish是被模拟器运行的虚拟CPU,那么当Android在真实的硬件设备上运行时,我们就需要去掉它,因此,只有知道Google对Goldfish做了哪些具体改动之后才能正确地去掉。据统计,Android 内核对Goldfish的改动主要涉及44个文件,具体汇总如下。
这里被改动的文件前面加了Chg标记,在新增的文件前面加了New标记。
1、Chg:arch/arm/Makefile添加CONFIG_ARCH_GOLDFISH
2、New:arch/arm/configs/goldfish_defconfig默认配置文件
3、New:arch/arm/mach-goldfish/Kconfig为Goldfish CPU添加Kernel配置文件
4、New:arch/arm/mach-goldfish/Makefile添加board-goldfish.o
5、New:arch/arm/mach-goldfish/Makefile.boot为Goldfish CPU进行启动配置
6、New:arch/arm/mach-goldfish/audio.c Audio的输入/输出
7、New:arch/arm/mach-goldfish/board-goldfish.c中断请求、输入/输出等
8、New:arch/arm/mach-goldfish/pdev_bus.c设备总线
9、New:arch/arm/mach-goldfish/pm.c电源管理
10、New:arch/arm/mach-goldfish/switch.cSwitch控制
11、New:arch/arm/mach-goldfish/timer.c获取和设置时间
12、Chg:arch/arm/mm/Kconfig添加ARCH_GOLDFISH到支持列表
13、Chg:drivers/char/Makefile添加goldfish_tty
14、New:drivers/char/goldfish_tty.cTTY驱动
15、Chg:drivers/input/keyboard/Kconfig为Goldfish的键盘事件添加配置文件
16、Chg:drivers/input/keyboard/Makefile添加goldfish_events事件
17、New:drivers/input/keyboard/goldfish_events.cGoldfish键盘驱动
18、Chg:drivers/mmc/host/Kconfig添加Kernel配置选项Goldfish MMC卡
19、Chg:drivers/mmc/host/Makefile添加Goldfish MMC卡驱动
20、New:drivers/mmc/host/goldfish.c多媒体驱动
21、Chg:drivers/mtd/devices/Kconfig为Goldfish的NAND flash device添加Kernel配置选项
22、Chg:drivers/mtd/devices/Makefile添加goldfish_nand
23、New:drivers/mtd/devices/goldfish_nand.cNAND flash驱动
24、New:drivers/mtd/devices/goldfish_nand_reg.hNAND flash驱动
25、Chg:drivers/power/Kconfig为Goldfish的battery(电池)驱动添加kernel配置选项
26、Chg:drivers/power/Makefile添加Goldfish电池
27、New:drivers/power/goldfish_battery.c能源和电池状态驱动
28、Chg:drivers/rtc/Kconfig为Goldfish的rtc(时钟)驱动添加Kernel配置选项
29、Chg:drivers/rtc/Makefile添加rtc-goldfish
30、New:drivers/rtc/rtc-goldfish.c实时时钟驱动
31、Chg:drivers/video/Kconfig添加Goldfish的framebuffer
32、Chg:drivers/video/Makefile添加Goldfish的framebuffer
33、New:drivers/video/goldfishfb.cframebuffer驱动
34、New:include/asm-arm/arch-goldfish/dma.h
35、New:include/asm-arm/arch-goldfish/entry-macro.S
36、New:include/asm-arm/arch-goldfish/hardware.h
37、New:include/asm-arm/arch-goldfish/io.h
38、New:include/asm-arm/arch-goldfish/irqs.h
39、New:include/asm-arm/arch-goldfish/memory.h
40、New:include/asm-arm/arch-goldfish/system.h
41、New:include/asm-arm/arch-goldfish/timer.h
42、New:include/asm-arm/arch-goldfish/timex.h
43、New:include/asm-arm/arch-goldfish/uncompress.h
44、New:include/asm-arm/arch-goldfish/vmalloc.h