Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux...
Transcript of Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux...
![Page 1: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/1.jpg)
These slides at http://insymbols.com/misc/android-atop-linux-ee2014.pdf
Ryan Kuester Independent Consultant
Running Android atop a proper embedded Linux
![Page 2: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/2.jpg)
Motivate Android atop Linux
Linux atop the Nexus 7
Android atop Linux
Integrating the two worlds
![Page 3: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/3.jpg)
Contribute to discussion of Android’s suitability for embedded work
!
Demonstrate one way of using Android in an embedded system
![Page 4: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/4.jpg)
Motivation: Why Android?
![Page 5: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/5.jpg)
Enormously successful !
Productive and enjoyable environment for writing applications
Java has great tools
![Page 6: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/6.jpg)
![Page 7: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/7.jpg)
![Page 8: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/8.jpg)
Application framework excellent, e.g., modularity of activities and intents
Users are familiar with Android GUIs
Framework services address common needs: network, power, audio,
management
![Page 9: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/9.jpg)
Biggest Weakness
Android couples the operating system choice to the GUI choice
Build System
Package Management
Library and program availability
![Page 10: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/10.jpg)
Issues with Android as OS
Software availability with build system Software compatibility with libc
![Page 11: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/11.jpg)
Software compatibility with libc
see bionic/libc/CAVEATS
not complete POSIX, only what Android needs, e.g.:
no C++ exceptions
no locales or wide chars
missing functions like getpwd()
![Page 12: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/12.jpg)
Issues with Android as OS
Package management
Field upgrades
Build system
SCM scheme
![Page 13: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/13.jpg)
Issues with Android as OS
Limited and less-than-open community of platform developers
![Page 14: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/14.jpg)
You need to partition your solution in any case
Running within Android framework is not suitable for some time-
sensitive code
Can run code outside of framework, but not well-supported, and library
challenges remain
![Page 15: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/15.jpg)
Motivation: So what’s the problem?
![Page 16: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/16.jpg)
OS libraries
OS Services
OS utilities, runtime, etc.
App.
Bootloader
Linux Kernel
![Page 17: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/17.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
![Page 18: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/18.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
![Page 19: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/19.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
![Page 20: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/20.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
![Page 21: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/21.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
![Page 22: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/22.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
Bootloader
Linux kernel
Misc.
Application framework
Init
Ideally we could just use the application framework
![Page 23: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/23.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
Bootloader
Linux kernel
Misc.
Application framework
Init
but Android is architected and delivered as a tightly-coupled combination
![Page 24: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/24.jpg)
forcing us to keep it intact and put other software alongside it
Bootloader
Linux kernel
Libraries
Application framework
Init
EmbeddedLinux OS
![Page 25: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/25.jpg)
Why Linux, again?
software availability
package management
build system
tools
EmbeddedLinux OS
![Page 26: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/26.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
How? Some suggest injecting pre-built Embedded OS into Android build process
EmbeddedLinux OS
![Page 27: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/27.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
Backwards!—this leaves Android in charge of build process, package management, etc.
EmbeddedLinux OS
![Page 28: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/28.jpg)
Proposal—treat Android as package within the Embedded Linux OS
Linux kernel
Libraries
Application framework
Init
EmbeddedLinux OS
Embedded Linux Init
![Page 29: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/29.jpg)
Demonstration of this concept
applied to the Nexus 7
![Page 30: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/30.jpg)
Pragmatux
A community-developed Linux distribution for embedded systems
!
http://pragmatux.org
Linux atop the Nexus 7
![Page 31: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/31.jpg)
Pragmatux
Workstation environment
Target device operating system
Deployment management system
Developer ecosystem
![Page 32: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/32.jpg)
Pragmatux
Utilizes tools, concepts from the Debian Project
Isn’t “Debian”, but has a similar look and feel
![Page 33: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/33.jpg)
Pragmatux
package management and repository tools
cross-toolchains
minimized packages
keeps binary compatibility
![Page 34: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/34.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
Normally don’t touch this
# fastboot flash $IMAGE
How Android device storage is partitioned
![Page 35: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/35.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
# fastboot flash $IMAGE
boot.img
How Android device storage is partitioned
![Page 36: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/36.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
# fastboot flash $IMAGE
system.img
How Android device storage is partitioned
![Page 37: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/37.jpg)
Bootloader
Linux kernel
Misc.
Application framework
Init
# fastboot flash $IMAGE
New kernel, new system image (now in userdata partition)
![Page 38: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/38.jpg)
Demo: Building and loading images
![Page 39: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/39.jpg)
Nexus 7 kernel source: https://github.com/pragmatux/linux-
n7-2013 !
Originates from AOSP’s Qualcomm kernel: https://android.googlesource.com/kernel/msm.git
![Page 40: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/40.jpg)
Android package source: https://github.com/rkuester/android-
n7-2013-wifi-aosp !
Originates with the binary output of an AOSP build for the Nexus 7, see:
http://source.android.com/source/building.html
![Page 41: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/41.jpg)
Android filesystem in chroot
Embedded OSAndroid
![Page 42: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/42.jpg)
Demo: Integrating and Android app and a Linux daemon
![Page 43: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/43.jpg)
Communication via kernel still works as always
Linux kernel
Libraries
Application framework
Init
EmbeddedLinux OS
Embedded Linux Init
![Page 44: Running Android atop ainsymbols.com/misc/android-atop-linux-ee2014.pdf · Android atop Linux Integrating the two worlds. Contribute to discussion of Android’s ... needs: network,](https://reader031.fdocuments.net/reader031/viewer/2022013022/5f39e30c893e572694084b67/html5/thumbnails/44.jpg)
These slides at http://insymbols.com/misc/android-atop-linux-ee2014.pdf
Ryan Kuester Independent Consultant
Running Android atop a proper embedded Linux