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