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
3. Lecture 5
Dalvik VM
yegor.yelizarov(at)gmail.com
Rev: 1.1
Last update: 05/30/2012 http://vk.com/android_internals
3 Egor Elizarov SPbSU 2012
4. Previous time
Vanilla
Kernel types
Android/Kernel interaction
“Androdized” kernel features
Bionic
Log system
4 Egor Elizarov SPbSU 2012
5. Virtual Machines
VM concept was introduced in 1960s in
Cambridge
Defined by Popek & Goldberg in 1973 as "an
efficient, isolated duplicate of a real machine"
System VM (Whole OS emulation)
Process VM (One program emulation)
5 Egor Elizarov SPbSU 2012
7. Process VM types
Register VM Stack VM
Limited number of
registers with addresses
Stack
State register
Reverse Polish notation
List of instructions
Load/Store
7 Egor Elizarov SPbSU 2012
8. Dalvik VM
Register based
Designed for low memory requirements
Relying on OS
– Memory management
– Thread support
– Process isolation
8 Egor Elizarov SPbSU 2012
9. Dalvik VM (2)
Allow multiple VM instances to run once
Supports Java Debug Wire Protocol
Based on Apache Harmony (Open Source Java)
9 Egor Elizarov SPbSU 2012
10. Dalvik bytecode
Quite similar to common real architectures
Fixed size frames with particular number of
registers (one per method)
32-bit registers
Reach meta information for each method
10 Egor Elizarov SPbSU 2012
15. Android application
No single entry point
Activities, Services, Broadcast Receivers,
Content Providers
Intents
New VM instance (Copy on write)
15 Egor Elizarov SPbSU 2012
24. 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)
Grigory Tolstolytkin for advices and notes
(http://www.linkedin.com/pub/grigory-
tolstolytkin/2a/b41/74)
24 Egor Elizarov SPbSU 2012