http://cecs.wright.edu/~pmateti/Courses/4440/Lectures/Internals/
Android Internals
Table of Contents
- 1. Android-Internals-1: First Glimpse
- 2. Android-Internals-2: Second Look
- 3. Android-Internals-3: Third Look
- 4. Build a ROM
- 5. References
- 6. End
1 Android-Internals-1: First Glimpse
- Android System
- Virtual Machines: Dalvik + ART
- Libraries
- Background: What is a Program? Process?
- Selected Processes
- File System: ext4, etc.
- Standard Linux Commands within Android
- Inter Process Communication (IPC)
2 Android-Internals-2: Second Look
2.1 Overview
- Android Partitions
- Boot Sequence/ Shutdown Sequence
- Android Init (Android Framework)
- Binder (Android Framework) Interprocess/ Component Communication
- Zygote (Android Framework) The Mother of All Apps
- System Tools: adb, installd, …
- Misc Managers: sm - Service, am - activity, pm - package
- Framework
2.2 Android's Init
- Android's First Process
- Action commands.
- Service declarations.
- Main init.rc
- ueventd
- Boot Logo
- Android's Init
3 Android-Internals-3: Third Look
- anon-shared-memory
- alarm
- wakelocks-etc
- low-memory-killer
- fastboot
- zipalign
- deodex
- Rooting
4 Build a ROM
- AOSP, CyanogenMod, …
- ../Build-ROM
5 References
- Karim Yaghmour, "Embedded Android", O'Reilly Media, Inc., 2013, 412 pp; WSU Safari Books Online 9781449327958
- Nikolay Elenkov, "An In-Depth Guide to Android's Security Architecture", https://www.nostarch.com/androidsecurity, October 2014, 432 pp. ISBN: 978-1-59327-581-5
- Jonathan Levin, Android Internals: A Confectioner's Cookbook, Volume I: The Power User's View, http://newandroidbook.com/AIvI-M-RL1.pdf, 267 pp, 2015.
- Prabhaker Mateti, Lecture Notes on Android Internals and Security, http://www.cs.wright.edu/~pmateti/Courses/4440/Top/
6 End
Copyright © 2016 www.wright.edu/~pmateti • 2017-08-27
=======================================================================
http://cecs.wright.edu/~pmateti/Courses/4440/Lectures/Internals/Init/init.html
Table of Contents
1 Linux Init
- Linux OS kernel invokes the first program (named init) and hence first process (pid == 1)
/sbin/init
standard location- In the Linux/Unix world, there are many designs + implementations that can be used as "init"
- A few famous ones: System V, upstart, systemd.
/sbin/init -> /lib/systemd/systemd
-
% file /lib/systemd/systemd
/lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=635141ec29ae1dec6bbb11b117a1a5dad5e0e9cb, stripped
- All inits are driven by their configuration files.
1.1 Expectations of "init"
- Services or Daemons: Processes that should start early and until system shutdown.
- Start the services. Watch over them. Should they die/crash, restart.
- Dependencies: Start the services in a certain order
2 Android Init
- Configuration Files
- Property-based triggers
- Action commands.
- Service definitions
- Main init.rc
- ueventd
- Android's Init excerpts from Embedded Linux, Chapter 6, PDF
2.1 Service Definition
- Example: Boot Animation
service bootanim /system/bin/bootanimation
user graphics
group graphics
disabled
oneshot
- https://github.com/android/platform_system_core/blob/master/init/readme.txt Android Init Language, 201x. Describes the language.
3 References
- Karim Yaghmour, "Embedded Android", O'Reilly Media, Inc., 2013, 412 pp; WSU Safari Books Online 9781449327958; Android Init PDF excerpts, Chapter 6. Required Reading.
- Karim Yaghmour, Embedded Android Workshop with Nougat, AnDevCon San Francisco 2016, PDF, 175 slides.
Copyright © 2015 pmateti@wright.edu • www.wright.edu/~pmateti 205-08-30