Weitere ähnliche Inhalte Ähnlich wie Linuxカーネルから紐解くAndroid (20) Kürzlich hochgeladen (20) Linuxカーネルから紐解くAndroid2. •
• Web Android (?)
•“ Android”
• Android
• twitter : @checkela
2
4. NDK
• JNI • CPU
architecture
• NativeActivity
• OpenGL|ES • Optimization
(1.x,2.x) • NEON
• OpenSL|ES
• Sensor AndroidNDK
7/25
4
5. • Android Linux
• Android Linux
• Linux
• Android ...
http://www.androidproduction.com/
smartphones/the-tablets-can-be-
used-in-honeycomb-mounted-with-
linux.html
5
6. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
• ○○○
• ○○○
• ○○○
• ○○○
•
6
9. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
• ○○○
• ○○○
• ○○○
• ○○○
•
9
10. Ubuntu
• Linux
• Linux + GUI +
+ ...
• PC Linux
10
11. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
• ○○○
• ○○○
• ○○○
• ○○○
•
11
15. libraries
Application Framework
Application Java JNI
Linux
Application Framework
Linux API
15
16. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
• ○○○
• ○○○
• ○○○
• ○○○
•
16
18. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
• ○○○
• ○○○
• ○○○
• ○○○
•
18
20. /
•
• Binder(IPC )
•
•
• ApplicationFramework ( logcat)
http://elinux.org/Android_Kernel_Features
20
21. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
•
• Binder
•
•
•
21
22. • Linux
•
Ubuntu
http://www.flickr.com/photos/ivanwalsh/4506526865/
22
23. •
• UID:GID
•
SandBox SandBox
sa
A B
http://www.flickr.com/photos/katmere/117444001/
23
24. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
•
• Binder
•
•
•
24
25. Binder
• IPC(Internal Procedure Call)
•
• ls | sort -r
• AIDL(Android Interface Definition Language),
Intent
•
http://www.flickr.com/photos/mrvelocipede/501749557/
25
26. Binder
SandBox SandBox
sa
A B
Intent
Intent Intent
AIDL AIDL
Binder
26
27. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
•
• Binder
•
•
•
27
30. wakelocks
• Sleep !
• )
•
(Java )
PowerManager pm = (PowerManager) getSystemService
(Context.POWER_SERVICE);
PowerManager.WakeLock wakeLock = pm.newWakeLock(
pm.SCREEN_DIM_WAKE_LOCK, "My wakelook");
30
31. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
•
• Binder
•
•
•
31
32. Android Ubuntu Linux
512MB 1GB 16GB
(Xperia acro) +swap
32
33. (Android)
•
• ashmem(android shared memory)
• pmem(Physical Memory Allocator)
•
• Out of Memory Handling
• LowMemoryKiller
33
34. (Android)
•
• ashmem(android shared memory)
• pmem(Processor Memory Allocator)
•
• Out of Memory Handling
• LowMemoryKiller
34
35. • ?
• Ubuntu
• OutOfMemory Handling
• Android
• OutOfMemory Handling
• LowMemoryKiller
35
36. Ubuntu
•
• OutOfMemoryHandling
• kill
• OOM
•
• Swap
36
38. Android Ubuntu Linux
512MB 1GB 16GB
(Xperia acro) +swap
38
41. • &
• > > content provider
•
• ?
• /init.rc
41
42. /init.rc ( )
# Define the oom_adj values for the classes of processes that can be
# killed by the kernel. These are used in ActivityManagerService.
setprop ro.FOREGROUND_APP_ADJ 0
setprop ro.VISIBLE_APP_ADJ 1
setprop ro.SECONDARY_SERVER_ADJ 2
setprop ro.BACKUP_APP_ADJ 2
setprop ro.HOME_APP_ADJ 4
setprop ro.HIDDEN_APP_MIN_ADJ 7
setprop ro.CONTENT_PROVIDER_ADJ 14
setprop ro.EMPTY_APP_ADJ 15
# Define the memory thresholds at which the above process classes will
# be killed. These numbers are in pages (4k).
setprop ro.FOREGROUND_APP_MEM 1536
setprop ro.VISIBLE_APP_MEM 2048
setprop ro.SECONDARY_SERVER_MEM 4096
setprop ro.BACKUP_APP_MEM 4096
setprop ro.HOME_APP_MEM 4096
setprop ro.HIDDEN_APP_MEM 5120
setprop ro.CONTENT_PROVIDER_MEM 5632
setprop ro.EMPTY_APP_MEM 6144
42
43. • Linux
• Ubuntu
• Android
• Android Ubuntu
• Android
•
• Binder
•
•
•
43
44. • PC Android Linux
• Android
•
•
44
Hinweis der Redaktion \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n http://groups.google.com/group/android-developers/browse_thread/thread/705cdfde2aa20ce4/dc0e0e872de9b0d2?lnk=raot\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n