1-Android Internals 10305904 - Nimit
1-Android Internals 10305904 - Nimit
1-Android Internals 10305904 - Nimit
Nimit Kalaria
M.Tech CSE,
Indian Institute of Technology Bombay
3rd March 2013
Contents
Android Kernel
Runtime Walkthrough
Zygote
Android Kernel
Why Linux Kernel ?
Good memory and process
management
Permission-based security model
Proven driver model
Support for shared libraries
Provide core system services
Power Management
Low Memory Killer
Contents
Android Kernel
Runtime Walkthrough
Zygote
Runtime Walkthrough
Similar to Linux based system
Boot-loader loads the Linux kernel
Runtime Walkthrough
Kernel
Initializes environment
Mounts root file system
Starts the Init process
Runtime Walkthrough
Init starts daemons
Runtime Walkthrough
Init starts the zygote process
Initializes a Dalvik VM instance
Links all core libraries and share it
Use copy-on-write
Runtime Walkthrough
Init starts runtime process
Initializes Service Manager
Context manager for Binder
Runtime Walkthrough
Forks a new Dalvik VM
Start system server
Runtime Walkthrough
Start native services
Surface and Audio Flinger
Runtime Walkthrough
Contents
Android Kernel
Runtime Walkthrough
Zygote
Inter-Process
Communication(IPC)
What is IPC?
Exchanges data with another
process
Why IPC?
IPC Mechanisms
Linux
Signal
Pipe
Socket
Semaphore
Message Queue
Shared Memory
IPC Mechanisms
Android
Binder : Lightweight RPC (Remote
Procedure Call) mechanism
IPC Mechanisms
Problems with old IPC
Mechanisms
Separate processes
Security holes
IPC Mechanisms
Solution
Driver
Shared memory
Per-process thread pool
Synchronous
Binder in Transaction
Limitation of Binder
Not ideal for transferring
large data
Data has to be converted into
Parcel
Contents
Android Kernel
Runtime Walkthrough
Zygote
Layer Interaction
Application Runtime Service
lib
Application Runtime Service
Native Service lib
Application Runtime Service
Native Daemon lib
Depends on type of application,
and type of native library.
Runtime
Service
Example:
Runtime
Service
Native
Service
Example:
Native
Service
Native
Daemon
Example:
Native
Daemon
References
A Survey on Android vs. Linux, Frank Maker1 and
Yu-Hsuan Chan
References
Jim Huang, http://www.slideshare.net
/jserv/android-ipc-mechanism [Online; accessed on
25-02-2013]