2. Legal info
Android internals by Egor Elizarov is licensed under a
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
You are free to
– copy, distribute, display, and perform the work
– make derivative works
Under the following conditions
– Attribution. You must give the original author credit
– Share Alike. If you alter, transform, or build upon this work, you may
distribute the resulting work only under a license identical to this one
All pictures and trademarks are the property of their respective owners. Use of
these trademarks and pictures is subject to owners permissions.
Corrections, suggestions, contributions and translations are welcome!
2 Egor Elizarov SPbSU 2012
4. Previous time
AOSP
High level architecture
Android OS bring up
CTS & CDD
repo / git / gerrit
Code layout
4 Egor Elizarov SPbSU 2012
5. Android build system
Based on GNU Make
Build system code is in “build” directory
(./build/core/main.mk - start point)
Android.mk files
All output and temporary files are in “out”
directory
5 Egor Elizarov SPbSU 2012
6. Makefile structure
Structure:
Target: depenencies
List of commands
Usage:
make target
6 Egor Elizarov SPbSU 2012
7. Interesting files
Android.mk — build scenario for module
buildspec.mk — variable defenitions for build
system
envsetup.sh — setup environment, add some
helper functions
7 Egor Elizarov SPbSU 2012
12. Some make targets
make droid (default target)
make update-api (update current API)
make sdk (build SDK)
make help (prints more targets)
12 Egor Elizarov SPbSU 2012
16. Board specific files
BoardConfig.mk (Target configuration)
Board_name.mk (board related defenitions, list
of packages)
Device.mk (list of files to be copied, list of
packages, etc.)
16 Egor Elizarov SPbSU 2012
17. Android emulator
Based on Qemu VM
Goldfish – codename for emulator
Code in development/tools/emulator &
external/qemu
Provided as part of SDK
17 Egor Elizarov SPbSU 2012
18. Emulator features
Runs full Android stack down to the kernel level
ARM v5 CPU and correcponding MMU
LCD with different resolutions
GSM modem
Simulates application interrupts, data channel
lost, etc.
18 Egor Elizarov SPbSU 2012
19. Qemu
Single loop for each core
Worker threads for long term tasks
Tiny Code Generator (TCG)
Kernel Virtual Machine (KVM)
19 Egor Elizarov SPbSU 2012
25. Target filesystem layout
/system — main system directory
/data — main data directory
/cache — Dalvik cache
/sdcard — SD card mount point
/etc; /sys; /proc; /dev; /sbin; /root; /mnt —
derived from linux
25 Egor Elizarov SPbSU 2012
26. Next time
“Androdized” kernel
Bionic standard C library
Logging system
Source: http://androidcommunity.com
26 Egor Elizarov SPbSU 2012
27. Useful links
http://vk.com/android_internals
http://mrbook.org/tutorials/make/
http://elinux.org/Android_Build_System
K. Yaghmour. Embedded Android. Early Release, O'Reilly, October 2011
http://developer.android.com/guide/developing/tools/emulator.html
http://developer.android.com/guide/developing/devices/emulator.html
http://blog.vmsplice.net/2011/03/qemu-internals-overall-architecture-and.html
27 Egor Elizarov SPbSU 2012
28. Thanks to
Sergey Matyukevich for review and advices
(www.linkedin.com/pub/sergey-
matyukevich/31/889/769)
Nikolay F. Fominykh for review and advices
Nikita Shulga for advices and notes
(http://www.linkedin.com/pub/nikita-
shulga/8/582/287)
28 Egor Elizarov SPbSU 2012