1 / 40

SamSung Electronics – CTO – SAIT – Graphics&OS Group – Linux Tech Part

2 nd Korea Android Seminar. Android Internals & Target Porting. SamSung Electronics – CTO – SAIT – Graphics&OS Group – Linux Tech Part Lim,GeunSik (geunsik.lim@samsung.com). 2008.11.10( Mon ). 1. Android Internals. Presentation Time : 14:00 ~ 14:50. 1. Android Overview

mahdis
Download Presentation

SamSung Electronics – CTO – SAIT – Graphics&OS Group – Linux Tech Part

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 2nd Korea Android Seminar Android Internals & Target Porting SamSung Electronics – CTO – SAIT – Graphics&OS Group – Linux Tech Part Lim,GeunSik (geunsik.lim@samsung.com) 2008.11.10(Mon)

  2. 1. Android Internals Presentation Time : 14:00 ~ 14:50 1. Android Overview 2. Android OS (Linux) 3. Android Native Libraries 4. Android Run-time 5. Android Application Framework 6. Android Start-up & Layer Interaction of Platform Stack 2/39

  3. Android Overview – Mobile History First, to be an excellent mobile platform on its merits, Second, to be open and open source 3/39

  4. Android Overview – TimeLine 1/2 GPL 4/39

  5. Android Overview – TimeLine 2/2 5/39

  6. Android Overview – Open access model T-Mobile Open Networks Open Devices Open Access 700Mhz Open Applications Open Services Reseller 6/39

  7. Android Overview - Emulator(SDK) VS. RealTarget WebBrowser GoogleMAP Mail・・・ Emulator(SDK) Real Target /tools/lib/images/skins (-skin) Java Code Misc Applications Misc Applications Java Code Java Virtual Machine (Dalvik VM) Java Virtual Machine (Dalvik VM) ARM Code ARM Code Misc Middleware Misc Middleware Linux Kernel (2.6.23/25) Linux Kernel (2.6.23/25) QEMU BasedEmulator Handset Hardware (i.MX 31L , PXA 310) ARM & X86 Goldfish(Virtual H/W) Hardware Emulator ARM CPU Emulator Target (ARM) Fedoar 9 (Host) X86 libc Webkit SQLite openGL ・・・ 7/39

  8. Android Overview - Android Layer http://source.android.com Applications X86 Linux Desktop IM Clock Media Player Photo Album Calculator Calendar Android Debug Bridge (ADB) Java GoogleMap Home Contacts Phone Browser . . . . Android Development Tool (ADT) Applications Framework Activity Manager Windows Manager Content Providers View System Notification Manager Dalvik Debug Monitor Service(DDMS) ) Java Package Manager Telephony Manager Resource Manager Location Manager XMPP Service AndroidAsset Packaging Tool System Libraries Android Runtime Android Interface efinition Language(AIDL) (Functional libraries) Core Libraries Surface manager Media Framework SQLite OpenGL/ES C/C++ Mksdcard Dalvik VM FreeType Webkit SGL SSL Bionic Libc (53 pthread) Class File Convertor HAL(Hardware Abstraction Layer) Graphics Audio Radio(RIL) WiFi . . . . . G P S Camera BlueTooth Emulator (QEMU, GoldFish) Linux (2.6.23/25) Linux Distribution(X86) C DisplayDriver CameraDriver BluetoothDriver Flash Driver Power M/M Binder Driver USB Driver Keypad Driver WiFi Driver Audio Driver 8/39

  9. Android Overview – License Issues • What is Android’s License? • Currently, Android Platform is open source completely. The Android mobile OS will be released under Apache License. This means that anyone can customize the android platform and then keep it proprietary. Openbinder Qemu Yaffs2 Sqlite3 OpenSSL Linux Dalvik OpenGL BSD Libc(=bionic) D-BUS KHTML Ant OpenGL Python zlib Openbinder System Expat SDL 9/39

  10. Android Kernel - Kernel Features 1/2 10/39

  11. Android Kernel - Kernel Features 2/2 ☞ Surface flinger uses double-buffering using page-flips. 11/39

  12. Opensource Toolchain for EABI Google’s Android ToolChain 1/2 • Definition: It sets the standard for the interoperation between relocated files, as well as executable files, for embedded architectures. • Usability: the standard makes it possible to combine object files built using different toolchains if both their compilers use EABI((Embedded Application Binary Interface). • More Efficient Syscall Convention • GCC : CS-2005Q3 release is a modified version of gcc-3.4.4 from gcc-4.1.0. The commercial ARM Realview C/C++ compiler was the first to support EABI (GCC4.1) • Kernel: EABI is supported in the ARM Linux kernel from version 2.6.16. • Glibc : Earlier glibc (2.3.3) support EABI userspace but had old-style syscalls to work with older kernels (2.6.0 ~ 2.6.15). ARM Information Center - http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ihi0036a/ 12/39

  13. Google’s Android ToolChain 2/2 Android Toolchain Information http://gplv3.fsf.org Ref: GCC 4.2.2+  GPL3 Glibc 2.6.1+  GPL3/LGPL3 • GCC Version : 4.2.1 (GPL2) • Download Sources: • http://android.git.kernel.org/pub/android-toolchain-20081019.tar.bz2 (70M) • Architecture: ARMV5te • Target: arm-eabi • ABI Convention: EABI , AAPCS • Supported Language: C, C++ • Floating Point : Soft Floting Point ( --with-float=soft --with-fpu=vfp ) • Thread Model: Single (--enable-threads) 13/39

  14. Vanilla Kernel’s Maintenance for Android1/5 ○Linux = Vanilla Kernel = Linus Tovalds’s Tademark http://gitstat.sourceforge.net/ 14/39

  15. Vanilla Kernel’s Maintenance for Android2/5 15/39

  16. Vanilla Kernel’s Maintenance for Android3/5 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 16/39

  17. Vanilla Kernel’s Maintenance for Android4/5 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 17/39

  18. Vanilla Kernel’s Maintenance for Android5/5 Code Monitoring 18/39

  19. android.git.kernel.org source.android.com Android Kernel’s WebServer 1. OS : Linux  Apache/2.2.9 (Fedora 9)  2. Last Changed: 27-Oct-2008 12:38:39 GMT 3. IP Address: 130.239.17.12   4. Netblock Owner: Umea University  1. OS : Linux ( GFE/1.3 WebServer )   2. Last Changed: 24-Oct-2008 07:25:02  GMT 3. IP Address: 74.125.47.121 / 66.249.91.121   4. Netblock Owner: Google Inc.  ☞ GFE: Front End 19/39

  20. Coffee Break 20/39

  21. 2. Android Porting Presentation Time: 15:00 ~ 15:50 Android Porting on Real Target (Target Device Prototyping) - zaurus c1000/c3200 , armadillo-500 , HTC P4550 Kaiser, OMAP2EVM, Nokia 810 ,WS007SH 21/39

  22. . How to get android *.img file Extract google's android file system image from android 1.0 SDK Release 1 1. uncompress ramdisk.img $cd ./android/tools/lib/images/ramdisk.img $ gzip -cd ramdisk.img > ramdisk $ cpio -iv -F ramdisk 2. open the emulator $ ./emulator & 3. enter into android shell and remount rootfs (Since rootfs is mounted as read only, you need to remount.) $ ./adb shell # mount -o remount,rw rootfs / # mkdir /tmp 4. push busybox in the tmp folder $ ./adb push busybox /tmp 5. open a android shell command window $ ./adb shell 6. change the busybox mode to 555 # chmod 555 /tmp/busybox 7. create the tarball for /system and /data: # ./busybox tar cvf /tmp/system.tar /system # ./busybox tar cvf /tmp/data.tar /data # ./busybox tar cvf /tmp/dev.tar /dev 8. pull the tarball file from the google android emulator $ ./adb pull /tmp/system.tar . $ ./adb pull /tmp/data.tar . $ ./adb pull /tmp/dev.tar . 9. how to get boot log of the emulator. # mkdir /tmp # /system/bin/dumpstate # exit $ ./adb pull /tmp/state state.log $ more state.log $  Fedora Desktop Prompt#  Android Platform Prompt 22/39

  23. . Android Project Layout ☞ Info : http://source.android.com/projects The Android platform consists of several projects already in progress. These projects can be divided into three categories 1) Core projects: These projects make up the foundation of the Android platform. ( bionic, bootloader/legacy, build , dalvik, development, frameworks/base , hardware<libhardware/ril> , kernel , prebuild , recovery, system<bluetooth,coe,extras,ti-wlan) 2) External projects: The Android Open Source Project makes use of many other open source projects. ( aes, apache-http, asm, bluez, ccache, clearsilver, dbus, dhcpcd, dropbear, eclipse, elfcopy, elfutils, embunit, emma, esd, expat, fdlibm, flex, freetype, gdata, diflib, googleclient, icu4c, iptables, jdiff, jfreechart, jpeg, kxml2, libffi, an so on) 3) Packages: These projects are standard Android applications and services 3.1) Application Project: alarmclock, browser, calculator, calendar, camera, Contacts, email, googlesearch, html viewer,IM , Launcher, MMS, Music, an so on 3.2) Provider Project: CalendarProvider, ContactsProvider, DownloadProvider,DrmProvider, GoogleContactsProvider, GoogleSubscribedFeedsProvider, ImProvider,MediaProvider,SettingsProvider, SubscribedFeedsProvider, TelephonyProvider 23/39

  24. . Android Full Source 1/2 ☞ Info :http://www.kandroid.org/board/board.php?board=androidsource&command=body&no=6 ① bionic.git - modified BSD(Open/Net/Free) C library② bootloader - legacy.git bootloader ③ build.git -  build script④ dalvik.git - stacked based java virtual machine⑤ development.git -  files for development⑥ external ( 37 ) - aes.git , dropbear.git ,fdlibm.git ,iptables.git , libpng.git , openssl.git ,     safe-iop.git , tagsoup.git , apache-http.git , elfcopy.git , freetype.git , jdiff.git ,     oprofile.git , skia.git , tcpdump.git ,bluez.git , elfutils.git , gdata.git , jhead.git  ,     netcat.git , ping.git , sonivox.git , tinyxml.git , clearsilver.git , emma.git , giflib.git , jpeg.git , netperf.git ,  ppp.git , sqlite.git  ,  tremor.git , dbus.git , esd.git , libxml2.git , googleclient.git , libffi.git  ,  neven.git ,  protobuf.git , srec.git ,  webkit.git , dhcpcd.git , expat.git , icu4c.git  , libpcap.git , opencore.git , qemu.git , strace.git • Fedora 9  With yum • Ubuntu 8.X  With apt-get ./.repo/projects/ 24/39

  25. . Android Full Source 2/3 01) http://android.git.kernel.org/pub/bluez-%version%.tar.gz   02) http://android.git.kernel.org/pub/clearsilver-%version%.tar.gz   03) http://android.git.kernel.org/pub/dbus-1.0.2.tar.gz   04) http://android.git.kernel.org/pub/dropbear-%version%.tar.gz   05) http://android.git.kernel.org/pub/emma-%version%-src.zip   06) http://android.git.kernel.org/pub/expat-%version%.tar.gz   07) http://android.git.kernel.org/pub/freetype-%version%.tar.bz2   08) http://android.git.kernel.org/pub/giflib-%version%.tar.gz   09) http://android.git.kernel.org/pub/icu4c-%version%-src.tgz   10) http://android.git.kernel.org/pub/iptables-%version%.tar.bz2   11) http://android.git.kernel.org/pub/jpegsrc.v%version%.tar.gz   12) http://android.git.kernel.org/pub/libpcap-%version%.tar.gz   13) http://android.git.kernel.org/pub/libpng-%version%.tar.gz   14) http://android.git.kernel.org/pub/libxml2-sources-%version%.tar.gz   15) http://android.git.kernel.org/pub/nc%version%.tgz ./.repo/manifests/default.xml  25/39

  26. . Android Full Source 3/3    16) http://android.git.kernel.org/pub/netperf-%version%.tar.gz   17) http://android.git.kernel.org/pub/openssl-%version%.tar.gz   18) http://android.git.kernel.org/pub/oprofile-%version%.tar.gz   19) http://android.git.kernel.org/pub/ppp-%version%.tar.gz   20) http://android.git.kernel.org/pub/qemu-%version%.tar.gz   21) http://android.git.kernel.org/pub/safe-iop-%version%.tgz   22) http://android.git.kernel.org/pub/sqlite-amalgamation-%version%.tar.gz   23) http://android.git.kernel.org/pub/strace-%version%.tar.bz2   24) http://android.git.kernel.org/pub/tagsoup-%version%-src.zip   25) http://android.git.kernel.org/pub/tcpdump-%version%.tar.gz   26) http://android.git.kernel.org/pub/tinyxml_%version%.tar.gz   27) http://android.git.kernel.org/pub/wpa_supplicant-%version%.tar.gz   28) http://android.git.kernel.org/pub/zlib-%version%.tar.bz2   29) http://builds.nightly.webkit.org/files/trunk/src/WebKit-%version%.tar.bz2 ./.repo/manifests/default.xml  26/39

  27. . Android Help Book After “#>repo sync” 27/39

  28. How do you do Thouble Shooting? 1. Google Groups http://groups.google.com/group/android-developers 3. IRC(Internet Relay Chatting) irc.freenode.net (#android) 2. Korea Android Website http://www.kandroid.org 28/39

  29. Android /init Running Sequence #> chroot /root/androidrootfs/strace -f -ff -tt -s 200 /init Loading OpenBinder Module target#> insmod binderdev.ko target#> lsmod Module Size Used by Not tainted Binderdev 63152 0 - Live 0xbf000000 target#> mknod /dev/binder c 10 0 target#> /bin/chmod -R a+rw /dev/binder Environment Variables Setting export PATH=/sbin:/system/sbin:/system/bin:$PATH export LD_LIBRARY_PATH=/system/lib export ANDROID_ROOT=/system export ANDROID_ASSETS=/system/app export ANDROID_DATA=/data export EXTERNAL_STORAGE=/sdcard export DRM_CONTENT=/data/drm/content ① ⑥ Run Zygote Process target#> /system/bin/app_process -Xzygote /system/bin --zygote & target#> strace -ff -F -tt -s 200 -o /tmp/log/zygote \ /system/bin/app_process -Xzygote /system/bin --zygote & Create Temp FS target#> umask 000 target#> /bin/chmod -R a+rw /tmp/ ⑦ ② ③ System Property’s Permission target#> /bin/chmod -R a+rw /data/ /database/ Start D-bus Daemon arget#> /system/bin/dbus-daemon --system --nofork & ⑧ Mount FIleSYstem target#> mount -t tmpfs tmpfs /tmp target#> mount -t proc proc /proc target#> mount -t sysfs sysfs /sys Start Runtime Process target#> /system/bin/runtime target#> strace -f -ff -tt -s 200 -o /tmp/runtimetrace /system/bin/runtime ⑨ ④ Network Setting #!/system/bin/sh export PATH=/sbin:/bin:/usr/bin:/system/bin LOCALIP=`192.168.1.21` DNS1=`208.67.222.222` DNS2=`208.67.220.222` GATEWAY=`192.168.1.1` ifconfig eth0 $LOCALIP netmask 255.255.255.0 up route add default gw $GATEWAY dev eth0 /system/bin/setprop net.eth0.dns1 $DNS1 /system/bin/setprop net.eth0.dns2 $DNS2 /system/bin/setprop net.gprs.local-ip $LOCALIP /system/bin/setprop ro.radio.use-ppp no /system/bin/setprop ro.config.nocheckin yes Log Sub System (Device Node) target#> /bin/rm -r /dev/log target#> cd /dev target#> /bin/ln -s /var/tmp/log log target#> /bin/rm -f log/* target#> /bin/touch log/main target#> /bin/touch log/events target#> /bin/touch log/radio target#> cd / ⑤ ⑩ 29/39

  30. Analysis of BootingSequence ☞ Bootchart is a tool for performance analysis and visualization of the GNU/Linux boot process www.bootchart.org 30/39

  31. Android Porting 1– HTC Kaiser * Architecture: QualComm MSM7200A * CPU Core : ARM9 (modem processor) & ARM11 (application processor) 400 MHz Qualcomm 7200 (Duall CPU, and integrates Imageon hardware 2D/3D) * Manufacturer: HTC TYTNII P4550 Kaiser * Type: Smartphone / PDA * OS: Windows Mobile 6.1 (Linux 2.6.X) * Board Type: HTCVOGUE * Camera(s): 3.0(2048x1536) MP still/video camera with autofocus. * Memory: 128 MB RAM, 256 MB ROM * Memory card: SDIO, microSD, microSDHC[9][10] 4GB and up, TransFlash * Screen: 240x320, 2.8" (42 x 57 mm) TFT-LCD * Weight: 190g * Size: 112mm (L) x 59mm (W) x 19mm (T) 31/39

  32. Android Porting 2– Zaurus C1000 * Architecture: ARM Xscale (ARMv5t-le) * CPU Core : 416MHz Intel PXA270 processor * BoardType: HTCVOGUE * Manufacturer: Sharp Zaurus * Type: PDA * OS: Lineo Solutions uLinux(Linux 2.6.23) * Memory: 128 MB Flash RAM, 64 MB ROM * External Memory: SD/MMC cards , CompactFlash cards * Screen: VGA touchscreen (640 x 480) - 65K * Weight: 190g * Size: 112mm (L) x 59mm (W) x 19mm (T) * Additional I/O: IrDA, USB, and LAN ports * Weights: 10 oz (278 grams) 32/39

  33. Android Porting 3– Zaurus C3200 * Architecture: ARM Xscale (ARMv5t-le) * CPU Core : 416MHz Intel PXA270 processor * BoardType: HTCVOGUE * Manufacturer: Sharp Zaurus * Type: PDA/ Personnel Mobile Tool * OS: Lineo Solutions uLinux(Linux 2.6.23) * Memory: 128 MB Flash RAM, 64 MB ROM * External Memory: SD/MMC cards , CompactFlash cards * HDD: 6Gb ( User Area : 5.9Gb ) * Screen: VGA touchscreen (640 x 480) - 65K * Weight: 298g * Size: 124mm (L) x 87mm (W) x 25mm (T) * Additional I/O: IrDA, USB, and LAN ports * Weights: 10 oz (278 grams) 33/39

  34. Android Porting 4– Nokia N810 * Architecture: ARM V6 * CPU Core : ARM 1136JF-S ( by TI’s OMAP 2420) 400Mhz * Manufacturer: Nokia * Type: Internet Tablet OS: * OS: maemo (Linux 2.6 based OS2008)* Memory: DDR RAM 128MB , Flash 256MB * External Memory: miniSD , microSD * Internal Storage: 2Gb * Weights: 10 oz (278 grams) * Battery: Nokia Maps BP-4L * Screen: 4.13" WVGA display (800 x 480 pixels) with up to 65,000 colors * Size: 124mm (L) x 87mm (W) x 25mm (T) * Additional I/O: IrDA, USB, and LAN ports * WLAN standard: IEEE 802.11b/g * Bluetooth specification v. 2.0. +EDR 34/39

  35. Android Porting 5– OMAP2EVM * Architecture: ARM V6 * CPU Core : ARM 1136JF-S (400Mhz) * Manufacturer: www.mistralsolutions.com * Model: OMAP 2530 TI’s OMAP 2430 Minior Version * Type: Target Board for development * OS: Linux 2.6.19 , 2.6.21 * Memory: 64 MB Mobile DDR SDRAM , 128 MB NAND Flash * Board Dimensions: 4.25’’ x 7’’ * External Memory: 4-bit SD/MMC * Screen: Dual mode (640x480/320x240) LCD Display with Touch screen interface * Additional I/O: USB 2.0 OTG basedon Philips ISP1504 transceiver , and LAN ports, Keypad * Components : Pre-programmedbinaries for XLoader, uBoot,Linux Kernel and JFFS2 File system. 35/39

  36. Android Porting 6– Armadillo/500 * Architecture: ARM V6 * CPU Core : ARM 1136JF-S (400Mhz , 128kb level two cache) * Manufacturer: Atmark Techno Company * Model: i.MX31L * Type: Target Board for development * OS: Linux 2.6.18 & 2.6.26 * Memory: 64 MB DDR SDRAM , 16MB Nor Flash , 256MB Nand Flash * External Memory: 4-bit SD/MMC * Screen: CRT Screen(VGA) interface * Additional I/O: USB , CF , SD/MMC , Audio in/out , Serial x2 , 30Bit GPIO * Components : GNU cross development tools and Atmark Techno Development(ATDE) with Vmwar Player. * Weight : 120G 36/39

  37. Android Porting 7– WS007SH * Architecture: ARM Xscale (ARMv5) * CPU Core : 32bit Intel PXA 270 (CPU Clock : 416Mhz) * Manufacturer: Sharp (http://llwm.xii.jp/wiki/wiki.cgi?page=Download) * Model: W-Zero3[ES] WS007SH (sha_pon007) * Type: Mobile Phone * OS: Windows Mobile Edition 5.0 for PocketPC ( Linux 2.6.23/24/25 ) * Memory: 64 MB DDR SDRAM , 128MB Flash * External Memory: MiniSD * Screen: 2.8 Inch Screen (480X640 ) 65K * Dimensions: 56 x 135 x 21 * Additional I/O: 1.3 Mega Pixel Cam , USB Mini A-B * Components : HRET(HandSet Reverse Engineering Tool) * W-SIM : RX420AL/RX420IN * Weight: 175G 37/39

  38. Android Porting 8– Zoom OMAP34x MDK Todo * Architecture: ARM V7 * CPU Core : ARM Cortex-A8 (CPU Clock : 600Mhz) – TI OMAP 3430 * Manufacturer: www.logicpd.com * Model: Zoom™ OMAP34x Mobile Development Kit (MDK) * Type: Zoom Mobile Development Kit * OS: Windows Mobile Edition 5.0 for PocketPC Linux 2.6.X * Memory: 64 MB DDR SDRAM , 128MB Flash * External Memory: MicroSD * Screen: 3.7” TFT VGA Portrait LCD * Dimensions: 96.5 x 160.8 x 24.3 mm * Additional I/O: 3.1 Mega Pixel Cam , Jtag Connector, USB OTG Mini A-B Port * Battery: 1100 mAhr Li-Ion battery 38/39

  39. Android 1st Phone T-MObile G1 528Mhz Qualcomm 7201 processor (ARM1136EJ-S) ☞ Android DotPhone (Shopping Mall) -Price: 3,850.00RMB -Email: dotphone@sina.com -Mobile: 8610-13439626749 -Sellers: Android DotPhone -Website: http://auction1.taobao.com/auction/item_detail-0db2-190294b8479059423e8f07641cddc142.jhtml ☞ Ebay (Shopping Mall) ☞ Howto Unlock - http://www.unlock-tmobileg1.com/EN/unlock-code-G1.php ($22.99) -http://g1unlockcodes.com/  ($23.99) -http://G1SIMUnlock.com ($29.99) - Use T-Mobile SIM Card of your friend http://www.kandroid.org/board/board.php?board=HTCDream&command=body&no=14 39/39

  40. Thanks 40/39

More Related