全世界首发!!!在Raspberry Pi 3B上运行Android 9.0系统
- 动机
需要有这么一个硬件:
1. 带有GPIO/I2C/SPI/UART接口
2. 可以运行Android系统,这意味着至少要有1G的内存
3. 有kernel源代码
4. 可以通过串口在线看kernel log, 因为需要开发kernel的驱动
5. 便宜并且有很不错的硬件性能
软件上:
需要能够比较轻松地将Android或者Android things系统移植上去。Android things系统已经可以在Raspberry Pi 3B上运行了,这样我们做系统移植的时候,就可以做一些参考。
Google已经将Android系统开源了,为什么不将Android things系统也开源呢,有点让人费解。
所以,这里我们选择了树莓派。
Android things是基于Android 8.1的系统,我们之前也试过将Android 8.1的系统移植到树莓派:
但这次,我们需要将最新的Android 9.0的系统移植上去。
- 性能
从之前的移植Android 8.1的经验及使用Google Android things 1.0.4版本的系统,就可以预见到在树莓派上运行Android 9.0系统会非常的卡。
对于 4核1.2G主频,1G内存(实际使用到的只有700多M),并且图形渲染使用的是swiftshader这种纯软件的渲染,还能期望它性能能好到哪里去呢。
Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Initializing cgroup subsys schedtune [ 0.000000] schedtune configured to support 4 boost groups [ 0.000000] Linux version 4.4.19-v7+ (android-build@vpeg11.mtv.corp.google.com) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Mon Sep 17 23:18:10 UTC 2018 [ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache [ 0.000000] Machine model: Raspberry Pi 3 Model B Rev 1.2 [ 0.000000] debug: ignoring loglevel setting. [ 0.000000] cma: Reserved 8 MiB at 0x2e400000 [ 0.000000] Memory policy: Data cache writealloc [ 0.000000] On node 0 totalpages: 192512 [ 0.000000] free_area_init_node: node 0, pgdat c11a8bc0, node_mem_map ed956000 [ 0.000000] Normal zone: 1692 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 192512 pages, LIFO batch:31 [ 0.000000] [bcm2709_smp_init_cpus] enter (1015a0->f3003010) [ 0.000000] [bcm2709_smp_init_cpus] ncores=4 [ 0.000000] PERCPU: Embedded 11 pages/cpu @eefa5000 s23296 r0 d21760 u45056 [ 0.000000] pcpu-alloc: s23296 r0 d21760 u45056 alloc=11*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 190820 [ 0.000000] Kernel command line: 8250.nr_uarts=1 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2709.boardrev=0xa22082 bcm2709.serial=0xdc0f3c90 smsc95xx.macaddr=B8:27:EB:0F:3C:90 bcm2708_fb.fbdepth=16 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 ro rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait earlyprintk init=/init androidboot.hardware=rpi3 androidboot.selinux=permissive ignore_loglevel androidboot.serialno=00000000dc0f3c90 androidboot.slot_suffix=_a root="/dev/mmcblk0p6" skip_initramfs buildvariant=userdebug [ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes) [ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes) [ 0.000000] Memory: 730968K/770048K available (12018K kernel code, 711K rwdata, 2880K rodata, 1024K init, 881K bss, 30888K reserved, 8192K cma-reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0xef800000 - 0xff800000 ( 256 MB) [ 0.000000] lowmem : 0xc0000000 - 0xef000000 ( 752 MB) [ 0.000000] .text : 0xc0008000 - 0xc0f8cb80 (15891 kB) [ 0.000000] .init : 0xc1000000 - 0xc1100000 (1024 kB) [ 0.000000] .data : 0xc1100000 - 0xc11b1fb4 ( 712 kB) [ 0.000000] .bss : 0xc11b4000 - 0xc12906cc ( 882 kB) [ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] Build-time adjustment of leaf fanout to 32. [ 0.000000] NR_IRQS:16 nr_irqs:16 16 [ 0.000000] Architected cp15 timer(s) running at 19.20MHz (phys).
==待续==
大神,看了您的文章,对您佩服到五体投地啊!希望能加您的qq或者微信像您请教一些问题,非常感谢!我的qq是450547566!
1
1