SlideShare ist ein Scribd-Unternehmen logo
1 von 97
Downloaden Sie, um offline zu lesen
What & How to Customize Android?
Noritsuna Imamura
noritsuna@siprop.org

©SIProp Project, 2006-2008

1
Agenda
What’s Android System?
Kinds of Android Devices
Kinds of Android Type
Android Source Code

Inside Android
Boot Sequence
About init File

Hands On
Nexus7
Pandaboard
How to Debug
©SIProp Project, 2006-2008

2
Kinds of Android Device
Smart Phone
Tablet
Mini PC
Note PC
Car Navigation
Set Top Box
Smart Watch
Smart Glass

Camera
Game Console
Audio System
Micro Wave
Refrigerator
Cut Board
EVB

If you get today’s knowledge,
You can customize these devices yourself!!!
©SIProp Project, 2006-2008

3
Why Customize it?
More Functions
Add Other Library
Add Other Software

Attach Other Device
Add Driver

So Slow(Ex. Old PC)
Modify Bottleneck Software
Delete needless Software & Library

Useless
Customized UI/UX Software

©SIProp Project, 2006-2008

4
Kinds of Android Type
Android

Kernel

More
Functions

Attach
Other
Device

So Slow

Useless

No Source No Source

×

×

×

×

No Source

w/Source

×

△
No-Use as
Android
App

△

×

w/Source

No Source

○

×

○
Almost
Bottleneck
In Here

○
UI/UX
Engine
In Here

w/Source

w/Source

◎
Use Kernel
Level Driver

○

◎

○

©SIProp Project, 2006-2008

5
About Android
Android Framework has 3 Layer Stack for
SmartPhone & Tablet PC.
Application Framework Layer (Java)
Library Layer (Linux C/C++)
Kernel/Driver Layer (Linux Kernel C/ASM)

©SIProp Project, 2006-2008

6
About Android Source Code
packages
App for Android

frameworks
Lib for Android Apps

system
Sys Lib for Framework

docs
Java Doc for Android

developers
Sample, Demos

build
Tool for Android Build

prebuilts
Toolchain

sdk
Android SDK

ndk
Native SDK

pdk
for 3rd Party SDK

cts
Compatibility Test

tools
Tools for External 2006-2008
©SIProp Project,

7
About Android Source Code
external
Linux Lib

libcore
Lib for Android

bionic
libc for Android

device
Diff for Devices

hardware
Drivers

bootable
BootLoader

libnativehelper
Helper for JNI

abi
Application Binary Interface

dalvik
Java VM

art
Next Generation VM

©SIProp Project, 2006-2008

8
License
3 Types License
Apache 2.0

Google Proprietary

All Application
Framework
Some Libraries
Bionic

GPL
Almost Libraries
Linux Kernel

Apache 2.0

Google Proprietary
Google Applications
from Play Store

GPL

How to Get Play
Store?
Pass CTS
©SIProp Project, 2006-2008

9
License
3 Types License
Apache 2.0
All Application
Framework
Some Libraries
Bionic

GPL
Almost Libraries
Linux Kernel

Google Proprietary
Google Applications
from Play Store

AOSP
(Android Open Source
Project)

How to Get Play
Store?
Pass CTS
©SIProp Project, 2006-2008

10
License
3 Types License
Apache 2.0

Google Android

All Application
Framework
Some Libraries
Bionic

GPL
Almost Libraries
Linux Kernel

Google Proprietary
Google Applications
from Play Store

AOSP
(Android Open Source
Project)

How to Get Play
Store?
Pass CTS
©SIProp Project, 2006-2008

11
GApp
Goo.im – Premium Android Developer File Hosting
This Site hosts Google Proprietary Apps!!!
http://goo.im/home

You can use Google Proprietary Apps on your Device.
However it’s illegal…

©SIProp Project, 2006-2008

12
Feature Matrix of ARM Chips
AllWinner

RockChip

MediaTek

Freescale

TI

Samsung

Qualcomm

Chip
Name

A31

RK3188

MT6589

i.MX6Q

OMAP54
32

Exynos5

Krait400

CPU Type

A7 Quad A9 Quad

A7 Quad

A9 Quad

A15 Dual

A15 Quad A15 Quad

Device
Type

Tablet

Mini PC

Smart
Phone

EVB

EVB

EVB

Used Area Cheap
Device

Cheap
Device

Cheap
Phone

N/A

Customiz N/A
ed Device

3G/LTE
Device

Official
Source
Code

Kernel

Kernel

Some
Android
Kernel

Full
Android
Kernel

Full
Android
Kernel

Full
Android
Kernel

Support

×

△

×

○

◎

◎

○

Availability

○

○

?

◎

◎

?

×

Promising

○

◎

○

×

×

○

△

Reason

Cheapes
t

Better
chip

RF chip

Dev team
is gone

Full
Android
Kernel

Tablet

Expensiv
e
13
©SIProp Project, 2006-2008
Inside Android

©SIProp Project, 2006-2008

14
Boot Up Flow CPU~Kernel
Ex. x-loader&u-boot

©SIProp Project, 2006-2008

15
Boot Up Flow Kernel~Android System
Init
Set Permission
Mount Disks
Load Driver

Demons
Linux App

Zygote
Sharing
JavaResource
Manager

Runtime
Linux SO
Driver

©SIProp Project, 2006-2008

16
About init File
What’s works?
Prepare dir, file for Service
Run Services(Demon), Runtime
Setup Permission
1.
2.
3.
4.
5.
6.

on post-fs-data
mkdir /data/media 0770 media_rw media_rw
setprop vold.post_fs_data_done 1
mkdir /data/misc/dhcp 0770 dhcp dhcp
chown dhcp dhcp /data/misc/dhcp
mkdir /data/misc/wifi/sockets 0770 wifi wifi

7.
8.
9.

service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL
disabled
oneshot

10. #for V4L
11. /dev/video0
12. /dev/video1

0666 system
0666 system

system
system

©SIProp Project, 2006-2008

17
Difference of Between Linux to Android

©SIProp Project, 2006-2008

18
Sorry!!!
About SMP(Multi Core) Compile
Next Week!

©SIProp Project, 2006-2008

19
Hands On

©SIProp Project, 2006-2008

20
Setup 2 Kinds of Android
SmartPhone
Nexus7 (2013)
Android 4.3
Released by Community
Non-Driver(BSP)

EVB
Pandaboard
Android 4.4
Released by Google
All Softwares

©SIProp Project, 2006-2008

21
Building Environment
CPU
Core i7
4core – 8thread

Memory
8GB

OS
Ubuntu12.04 64bits

©SIProp Project, 2006-2008

22
Common Setup

©SIProp Project, 2006-2008

23
Common Setup 1/2
Setup Build Tools
sudo apt-get install
bison build-essential curl flex git-core gnupg gperf libesd0dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2
libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush
schedtool squashfs-tools xsltproc zip zlib1g-dev
g++-multilib gcc-multilib lib32ncurses5-dev lib32readlinegplv2-dev lib32z1-dev

Setup Build Tools for ARM
sudo apt-get install
uboot-mkimage

©SIProp Project, 2006-2008

24
Common Setup 2/2
Setup Build Tools for Android
› curl http://commondatastorage.googleapis.com/gitrepo-downloads/repo > ~/bin/repo
› chmod a+x ~/bin/repo
› export PATH=$PATH:~/bin/repo

› sudo add-apt-repository ppa:nilarimogard/webupd8
› sudo apt-get update
› sudo apt-get install android-tools-fastboot

©SIProp Project, 2006-2008

25
Nexus7

©SIProp Project, 2006-2008

26
What’s Nexus7?
Target
Tablet
Nexus7(2013)
http://www.google.com/
nexus/7/

OS
JCROM
With Build Manual
https://sites.google.com/
site/jcromproject/

©SIProp Project, 2006-2008

27
Check Points
How to Customize Community Source Code
How did they get them?
They don’t have BSP(Driver).

How about Android System.
eMMC, OTA-Package

You can Customize GUI(HOME)
What can you Customize Android System?
UI System, Settings

©SIProp Project, 2006-2008

28
How to Build
Setup Process
1.
2.
3.
4.
5.

Download Source Code
Download BSP from site & your real device
Download & Build kernel
Make OTA image
Write new OTA image

©SIProp Project, 2006-2008

29
Download Source Code
Download from JCROM’s repository
› repo init -u
https://bitbucket.org/sola/jcrom_manifest m jcrom_jb-4.3-master.xml
› repo sync

©SIProp Project, 2006-2008

30
Download BSP from site & your real
device 1/2
Register your board to udev.
Add the following line to ‘/etc/udev/rules.d/51android.rules’
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4e40", MODE="0666" # Bootloader
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="d001", MODE="0666" # Recovery
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4e43", MODE="0666" # PTP media, USB debug off
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4e44", MODE="0666" # PTP media, USB debug on
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4e41", MODE="0666" # MTP media, USB debug off
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4e42", MODE="0666" # MTP media, USB debug on
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1",
ATTR{idProduct}=="4ee2", MODE="0666" # MTP media, USB debug on

Restart ‘udev’ service

©SIProp Project, 2006-2008

31
Download BSP from site & your real
device 2/2
Download BSPs from Real Device & Internet
*This version uses Internet only.

Use adb
If your system doesn’t have adb, please do:
sudo apt-get install android-tools-fastboot

› cd ~/nexus_work/android/device/asus/flo
› ./download-blobs.sh
› cd
~/nexus_work/android/jcrom/asus/flo/proprie
tary/
› ./extract-files.sh
©SIProp Project, 2006-2008

32
Download & Build kernel
Download & Build kernel
› cd ~/nexus_work
› export ARCH=arm
› export
CROSS_COMPILE=~/nexus_work/android/prebuilts/gc
c/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi› git clone
https://android.googlesource.com/kernel/msm.git -b
android-msm-flo-3.4-jb-mr2 kernel/nexus72
› cd kernel/nexus72
› make flo_defconfig
› make
› cp arch/arm/boot/zImage
~/nexus_work/android/device/asus/flo-kernel/kernel
©SIProp Project, 2006-2008

33
Make OTA image
Make OTA image
This OTA image is update image for Android.

›
›
›
›

cd ~/nexus_work/android/
source build/envsetup.sh
lunch aosp_flo-user
make otapackage

This file name is
aosp_flo-ota-eng.[your Linux’s User name].zip

©SIProp Project, 2006-2008

34
build/envsetup.sh
Helper Command Lib for Android Build
m

jgrep
Build from Top Dir

mm
Build from Current Dir

mmm [Target Dir]
Build from Target Dir

croot
Change Top Dir

Grep for Java Source
Code

resgrep
Grep for XML Source
Code

lunch
Choose Target Build

cgrep
Grep for C/C++ Source Code

©SIProp Project, 2006-2008

35
What’s Android OTA-Package
OTA = Over-The-Air (Update)
Android OTA-Package has ROM images.
boot.img
Kernel, Init, Minimam Linux

cache.img
Temporary Area

recovery.img
Recovery Manager Program

system.img
Android System

userdata.img
User Data
©SIProp Project, 2006-2008

36
What’s Fastboot?
Fastboot is ROM Manager for eMMC.
eMMC is managed by Address in Low Lovel.
When you write your Kernel, you MUST point kernel address.
If you mistake kernel address, your system is broken…

Separated by
Address

©SIProp Project, 2006-2008

37
What’s Inside of Image File?
It’s ramdisk
boot.img-ramdisk.gz
› mkdir ramdisk
› cd ramdisk
› gunzip -c ../boot.img-ramdisk.gz | cpio –I

If your new kernel has new functions, please modify
ramdisk files.
Ex. .ko file, new init file, etc.

©SIProp Project, 2006-2008

38
Write new OTA image 1/3
If your phone has OEM lock, please unlock it.
› adb reboot bootloader
› fastboot oem unlock

Change Recovery image.
› wget
http://download2.clockworkmod.com/recover
ies/recovery-clockwork-6.0.4.3-flo.img
› fastboot flash recovery recovery-clockwork6.0.4.3-flo.img
› fastboot boot recovery-clockwork-6.0.4.3flo.img

※Connect your N7 to PC

©SIProp Project, 2006-2008

39
Write new OTA image 2/3
Push your new OTA image to your N7
› adb push
~/nexus_work/android/out/target/product/fl
o/aosp_flo-ota-eng.[your Linux's User
name].zip /sdcard/

If you want to use Google Apps
› wget http://goo.im/gapps/gapps-jb20130813-signed.zip
› adb push gapps-jb-20130813-signed.zip
/sdcard/

©SIProp Project, 2006-2008

40
Write new OTA image 3/3
1. Turn off your phone
2. Volume Up & Power
3. Wipe data/factory reset
4. Install zip from sdcard
5. Choose zip from sdcard
6. aosp_flo-ota-eng.[your Linux's User name].zip
7. Choose zip from sdcard
8. gapps-jb-20130813-signed.zip
9. +++++Go Back+++++
10. Reboot system now
©SIProp Project, 2006-2008

41
Boot up Your Nexus7!

©SIProp Project, 2006-2008

42
Pandaboard

©SIProp Project, 2006-2008

43
What’s Pandaboard?
Target
EVB
Pandaboard
http://www.pandaboard.
org/

OS
Official Kernel & Android
With Build Manual
http://source.android.com
/source/downloading.html

©SIProp Project, 2006-2008

44
How to Use Peripherals?
ADK (Accessory Development Kit)
http://developer.android.com/tools/adk/index.html

Advantage
Develop on ADT
Pin like Arduino

Dis-Advantage
So Slow…
9600bps

©SIProp Project, 2006-2008

45
How to Use Peripherals?
GPIO(General Purpose Input/Output)
I2C(Inter-Integrated Circuit)
SPI(Serial Peripheral Interface)
UART(Serial)
Fast: SPI > I2C
Pin Num: SPI(4Pins) > I2C(3Pins)
GPIO can use Registers.

Advantage
Bus Speed
Connect All Peripheral

Dis-Advantage
Required Hardware Knowledge
Like Assembler for Hardware

©SIProp Project, 2006-2008

46
How to Build
Setup Process
1.
2.
3.
4.
5.

Download Source Code
Download BSP from Google
Download & Build Boot Loaders
Build Android
Setup SD Card

©SIProp Project, 2006-2008

47
Download 4.4 Source Code
Download from AOSP(Google)’s repository
›
›
›
›
›

mkdir ~/panda_work
cd ~/panda_work
mkdir mydroid
cd mydroid
repo init -u
https://android.googlesource.com/platform/
manifest -b android-4.4_r1.1
› repo sync

©SIProp Project, 2006-2008

48
Download BSP from Google
Download BSPs(Driver)
› cd ~/panda_work/mydroid
› wget
https://dl.google.com/dl/android/aosp/imgtec
-panda-20130603-539d1ac3.tgz
› tar zxvf imgtec-panda-20130603539d1ac3.tgz
› ./extract-imgtec-panda.sh
› git clone https://github.com/soladolphin1/sola_device_ti_panda.git -b kitkat
device/ti/panda
©SIProp Project, 2006-2008

49
Download Toolchain
Required Android Toolchain for Panda’s Source
› cd ~/panda_work
› git clone
https://android.googlesource.com/platform/pr
ebuilt
› export ARCH=arm
› export
CROSS_COMPILE=$PWD/prebuilt/linuxx86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-

©SIProp Project, 2006-2008

50
Download & Build x-loader
First Boot Loader for Pandaboard
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/xloader.git
› cd x-loader
› git checkout -b omap4_dev origin/omap4_dev
› make omap4430panda_config
› make ift
› cp -a MLO
~/panda_work/mydroid/device/ti/panda/xload
er.bin

©SIProp Project, 2006-2008

51
Download & Build u-boot
Second Boot Loader for Pandaboard
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/uboot.git
› cd u-boot
› git checkout -b omap4_dev origin/omap4_dev
› wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch
› git apply 0001-change-bootarges.patch
› make omap4430panda_config
› make
› cp -a u-boot.bin
~/panda_work/mydroid/device/ti/panda/bootl
oader.bin
©SIProp Project, 2006-2008

52
Download & Build kernel
Kernel for Pandaboard
› cd ~/panda_work
› git clone
https://android.googlesource.com/kernel/oma
p.git kernel
› cd kernel
› git checkout -b android-omap-panda-3.0
origin/android-omap-panda-3.0
› make panda_defconfig
› make
› cp -a arch/arm/boot/zImage
~/panda_work/mydroid/device/ti/panda/kerne
l
©SIProp Project, 2006-2008

53
Build Android
Build Android
›
›
›
›

cd ~/panda_work/mydroid
source build/envsetup.sh
lunch aosp_panda-userdebug
make

©SIProp Project, 2006-2008

54
Setup SD Card
Make Partition for Android on SD Card
boot
system
cache
userdata
media

› wget
http://www.noritsuna.com/download/mksdcar
d_pandaboard.sh
› chmod a+x mksdcard_pandaboard.sh
› LANG=C sudo ./mksdcard_pandaboard.sh
/dev/sdX ~/panda_work/mydroid
©SIProp Project, 2006-2008

55
Boot up Your Pandaboard!

©SIProp Project, 2006-2008

56
But……… TI support until 4.2

2012.06.27 4.1 Jelly Bean
2012.11.13 4.2
2013.07.24 4.3

4.1, 4.2
Available USB Audio
Support i18n(Internationalization)
Support Vibration for Input Device
Support Miracast
Support Writing Vertically
Support RenderScript
Change Android Market to Google Play
Linux: 3.1.10

4.3
Support OpenGL/ES 3.0
Support Bluetooth LE
Support Wi-Fi Location
Linux: 3.4.0

©SIProp Project, 2006-2008

57
How to Build
Setup Process
1.
2.
3.
4.
5.

Download Source Code
Download BSP from Google
Download & Build Boot Loaders
Build Android
Setup SD Card

©SIProp Project, 2006-2008

58
Download 4.2 Source Code
Download from AOSP(Google)’s repository
›
›
›
›
›

mkdir ~/panda_work
cd ~/panda_work
mkdir mydroid
cd mydroid
repo init -u
https://android.googlesource.com/platform/
manifest -b android-4.2.1_r1
› repo sync

©SIProp Project, 2006-2008

59
Download BSP from Google
Download BSPs(Driver)
› cd ~/panda_work/mydroid
› wget
https://dl.google.com/dl/android/aosp/imgtec
-panda-20120807-c4e99e89.tgz
› tar zxvf imgtec-panda-20120807c4e99e89.tgz
› ./extract-imgtec-panda.sh

Get some Patches
›
›
›
›
›
›
›
›
›
›
›
›

cd ~/panda_work/mydroid/build/
wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_build.patch
git apply 0001-panda-jb4.2_build.patch
cd ~/panda_work/mydroid/device/ti/panda/
wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_device-ti-panda.patch
git apply 0001-panda-jb4.2_device-ti-panda.patch
cd ~/panda_work/mydroid/hardware/ti/omap4xxx/
wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_hardware-ti-omap4xxx.pah
git apply 0001-panda-jb4.2_hardware-ti-omap4xxx.patch
cd ~/panda_work/mydroid/hardware/ti/wpan/
wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_hardware-ti-wpan.patch
©SIProp Project, 2006-2008
git apply 0001-panda-jb4.2_hardware-ti-wpan.patch

60
Download Toolchain
Required Android Toolchain for Panda’s Source
› cd ~/panda_work
› git clone
https://android.googlesource.com/platform/pr
ebuilt
› export ARCH=arm
› export
CROSS_COMPILE=$PWD/prebuilt/linuxx86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-

©SIProp Project, 2006-2008

61
Download & Build x-loader
First Boot Loader for Pandaboard
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/xloader.git
› cd x-loader
› git checkout -b omap4_dev origin/omap4_dev
› make omap4430panda_config
› make ift
› cp -a MLO
~/panda_work/mydroid/device/ti/panda/xload
er.bin

©SIProp Project, 2006-2008

62
Download & Build u-boot
Second Boot Loader for Pandaboard
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/uboot.git
› cd u-boot
› git checkout -b omap4_dev origin/omap4_dev
› wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch
› git apply 0001-change-bootarges.patch
› make omap4430panda_config
› make
› cp -a u-boot.bin
~/panda_work/mydroid/device/ti/panda/bootl
oader.bin
©SIProp Project, 2006-2008

63
Download & Build kernel
Kernel for Pandaboard
› cd ~/panda_work
› git clone
https://android.googlesource.com/kernel/oma
p.git kernel
› cd kernel
› git checkout -b android-omap-panda-3.0
origin/android-omap-panda-3.0
› make panda_defconfig
› make
› cp -a arch/arm/boot/zImage
~/panda_work/mydroid/device/ti/panda/kerne
l
©SIProp Project, 2006-2008

64
Build Android
Build Android
›
›
›
›

cd ~/panda_work/mydroid
source build/envsetup.sh
lunch aosp_panda-userdebug
make

©SIProp Project, 2006-2008

65
Setup SD Card
Make Partition for Android on SD Card
boot
system
cache
userdata
media

› wget
http://www.noritsuna.com/download/mksdcar
d_pandaboard.sh
› chmod a+x mksdcard_pandaboard.sh
› LANG=C sudo ./mksdcard_pandaboard.sh
/dev/sdX ~/panda_work/mydroid
©SIProp Project, 2006-2008

66
Boot File of Pandaboard

©SIProp Project, 2006-2008

67
Download & Build u-boot
Download it with Patch of Boot Option
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/uboot.git
› cd u-boot
› git checkout -b omap4_dev origin/omap4_dev
› wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch
› git apply 0001-change-bootarges.patch
› make omap4430panda_config
› make
› cp -a u-boot.bin
~/panda_work/mydroid/device/ti/panda/bootl
oader.bin
©SIProp Project, 2006-2008

68
About boot.scr
Contents of Patch
›
›
›
›
›
›
›
›
›

--- a/include/configs/omap4430panda.h
+++ b/include/configs/omap4430panda.h
@@ -147,8 +147,7 @@
" ip=dhcp"
#else
-#define CONFIG_BOOTARGS "console=ttyO2,115200n8
mem=512M" 
" init=/init vram=32M omapfb.vram=0:16M
androidboot.console=ttyO2"
+#define CONFIG_BOOTARGS "kgdboc=ttyO2,115200
console=ttyO2,115200n8 mem=1G
androidboot.console=ttyO2"

©SIProp Project, 2006-2008

69
About boot.scr
If you want to change boot option by script file
Sample of Boot Script file: File Name=boot.txt
›
›

›

setenv fdt_high "0xffffffff"
setenv bootcmd "fatload mmc 0:1 0x80200000 uImage; fatload
mmc 0:1 0x81600000 uInitrd; fatload mmc 0:1 0x815f0000
board.dtb; bootm 0x80200000 0x81600000 0x815f0000"
setenv bootargs "console=ttyO2,115200n8 rootwait ro
earlyprintk fixrtc nocompcache vram=48M
omapfb.vram=0:24M,1:24M mem=456M@0x80000000
mem=512M@0xA0000000 init=/init androidboot.console=ttyO2
omapfb.mode=dvi:1280x800MR-24@60 consoleblank=0"

How to Make boot.scr from Boot Script file
mkimage -A arm -T script -O linux -C none -a 0 -e 0 -n
"boot.scr" -d boot.scr.txt boot.scr
©SIProp Project, 2006-2008

70
Common Setup 1/2
Setup Build Tools
sudo apt-get install
bison build-essential curl flex git-core gnupg gperf libesd0dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2
libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush
schedtool squashfs-tools xsltproc zip zlib1g-dev
g++-multilib gcc-multilib lib32ncurses5-dev lib32readlinegplv2-dev lib32z1-dev

Setup Build Tools for ARM
sudo apt-get install
uboot-mkimage

©SIProp Project, 2006-2008

71
Extra Stage

©SIProp Project, 2006-2008

72
How to Use JTAG-ICE

©SIProp Project, 2006-2008

73
Debugging by ICE(In Circuit Emulator)
Full ICE
This has CPU&CPU Debugging Func.
When you use it, you change Real CPU to This CPU.

JTAG ICE
Real CPU has Debugging Func.
JTAG is Control Pin for CPU Debugging Func,

©SIProp Project, 2006-2008

74
Why Need?
Soft Level Debugger can debug
their managed apps only.
Ex. Kernel Panic: Console Log Only
Ex. DDMS: Android Framework
managed Linux Lib

©SIProp Project, 2006-2008

75
How to Setup JTAG-ICE

©SIProp Project, 2006-2008

76
Flyswatter2 Pandaboard
One of Cheapest JTAG-ICE.
Today, getting popular under $300USD.
Old one is Over $3000USD

©SIProp Project, 2006-2008

77
Setup udev
Register your board to udev.
Add the following line to ‘/etc/udev/rules.d/51android.rules’
# usbboot protocol on panda (PandaBoard)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451",
ATTR{idProduct}=="d00f", MODE="0666", OWNER="<username>"
# usbboot protocol on panda (PandaBoard ES)
SUBSYSTEM=="usb", ATTR{idVendor}=="0451",
ATTR{idProduct}=="d010", MODE="0666", OWNER="<username>"
SUBSYSTEM=="usb", ATTR{idVendor}=="0451",
ATTR{idProduct}=="d022", MODE="0666", OWNER="<username>"

Restart ‘udev’ service

©SIProp Project, 2006-2008

78
Add Debug Information to Source Code
What’s Debug Information?
Executed File(Compiled File) is machine code.
Human can NOT read it…
1.
2.
3.
4.
5.
6.

I/DEBUG
I/DEBUG
I/DEBUG
I/DEBUG
I/DEBUG
I/DEBUG
40000030
I/DEBUG

7.

( 3037): pid: 3233, tid: 3234 >>> /system/bin/netd <<<
( 3037): signal 11 (SIGSEGV), fault addr deadbaad
( 3037): r0 00001728 r1 100ffd7c r2 00000027 r3 00000000
( 3037): r4 afd42328 r5 00000000 r6 00000000 r7 00011000
( 3037): r8 00100000 r9 aef01cad 10 10000000 fp 40008008
( 3037): ip ffffffff sp 100ffd68 lr deadbaad pc afd11ca4 cpsr
( 3037): d0 3d454d414e564544 d1 6164732f7665642f

Ex. gcc (DWARF)
-g(n)
Debug Option. n=Debug Level

–O0
Optimized Option & Level. 0=non-optimized. Always use “3”.
©SIProp Project, 2006-2008

79
Change KGDB Config
Turn On Kernel Config
Kernel hacking
Compile the kernel with debug info
KGDB: kernel degugger
KGDB: user kgdb over the serial console (NEW)

› cd ~/panda_work/kernel
› make menuconfig
› make

©SIProp Project, 2006-2008

80
Change KGDB Config

©SIProp Project, 2006-2008

81
Change KGDB Config

©SIProp Project, 2006-2008

82
Change KGDB Config

©SIProp Project, 2006-2008

83
Change KGDB Config

©SIProp Project, 2006-2008

84
Change u-boot
Need Boot Option for KGDB
“kgdboc=ttyO2,115200” in “bootargs” section
› wget
http://www.noritsuna.com/download/0001change-bootarges.patch
› git apply 0001-change-bootarges.patch
› make
› cp -a u-boot.bin
~/panda_work/mydroid/device/ti/panda/bootl
oader.bin

©SIProp Project, 2006-2008

85
Old u-boot
Different Point
› cd ~/panda_work
› git clone git://git.omapzoom.org/repo/uboot.git
› cd u-boot
› git checkout -b omap4_dev origin/omap4_dev
› wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch
› git apply 0001-change-bootarges.patch
› make omap4430panda_config
› make
› cp -a u-boot.bin
~/panda_work/mydroid/device/ti/panda/bootl
oader.bin
©SIProp Project, 2006-2008

86
Setup Debugging Software
Why Need?
1.

#00 pc 00011ca4 /system/lib/libc.so

How do you debug it???

If your code has DWARF(Debug Info), you can
use “objdump” command.
arm-eabi-objdump -S -C libc.so |less
-S Show de-assembler source code
-C Show C/C++ function name of source code
1.

11ca4:

f005 ff25

bl

11c40 <abort>

bionic/libc/unistd/abort.c
©SIProp Project, 2006-2008

87
Setup Debugging Software

©SIProp Project, 2006-2008

88
Setup FTDI Driver (Serial)
›
›

cd ~/panda_work
wget
http://www.intra2net.com/en/developer/libftdi/download/libft
di-0.19.tar.gz
› tar zxfv libftdi-0.19.tar.gz
› cd ~/panda_work/libftdi-0.19/src
› sudo cp ftdi.h /usr/include
› cd /usr/local/include
› sudo ln -s /usr/include/ftdi.h ftdi.h
› cd ~/panda_work/libftdi-0.19
› ./configure
› make
› sudo make install

›
›
›
›
›
›

cd /usr/lib
sudo ln -s /usr/local/lib/libftdi.a libftdi.a
sudo ln -s /usr/local/lib/libftdi.la libftdi.la
sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so.1.19.0
sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so
sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so.1
©SIProp Project, 2006-2008

89
Setup OpenODC(On-Chip Debugging)
This Debugger is Software for JTAG Debugger.
Hardware JTAG Debugger get “RAW Data” only.
› cd ~/panda_work
› wget
http://downloads.sourceforge.net/project/openocd.berli
os/openocd-0.5.0.tar.gz
› tar zxfv openocd-0.5.0.tar.gz

› cd ~/panda_work/openocd-0.5.0
› wget
http://www.tincantools.com/w/images/5/5d/Tincantool
s-openocd-b0.12.patch
› patch -p1 -i Tincantools-openocd-b0.12.patch
› sudo ./configure --disable-werror --enableft2232_libftdi
› sudo make
©SIProp Project, 2006-2008
› sudo make install

90
Prepare JTAG Tools
JTAG Commands
›
›
›
›
›
›
›

cd ~/panda_work
mkdir openocd-bin
cd ~/panda_work/openocd-0.5.0/tcl
cp -r * ~/panda_work/openocd-bin
cd ~/panda_work/openocd-0.5.0/src
cp openocd ~/panda_work/openocd-bin
export PATH=$PATH:~/panda_work/openocdbin

©SIProp Project, 2006-2008

91
Connect Cables

©SIProp Project, 2006-2008

92
Connect JTAG Debugger
This tool uses telnet command.
› cd ~/panda_work/openocd-bin
› sudo ./openocd -f interface/flyswatter2.cfg -f
board/ti_pandaboard.cfg
› telnet localhost 4444

©SIProp Project, 2006-2008

93
JTAG Commands
reset, halt, resume
Use for Break Point

reg
reg
Show register

reg [entry]
Show entry register

reg [entry] [value]
Set value to entry register

©SIProp Project, 2006-2008

94
Setup DDD(Data Display Debugger)
GUI Debugger
› sudo apt-get install ddd

©SIProp Project, 2006-2008

95
How to Use Debugger
1. Start OpenOCD
› sudo ./openocd -f interface/flyswatter2.cfg -f
board/ti_pandaboard.cfg

2. Connect Console, And exec “halt”
› telnet localhost 4444
› > halt

3. Start DDD
›
›
›
›

$ ddd --debugger arm-eabi-gdb
GDB Console
(gdb) file vmlinux
(gdb) target remote localhost:3333

©SIProp Project, 2006-2008

96
Ex. Break Point
Stop
"resume" command on telnet

Do exec
"c" command on DDD GDB Console

©SIProp Project, 2006-2008

97

Weitere ähnliche Inhalte

Was ist angesagt?

A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)Matthias Brugger
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)Nanik Tolaram
 
Fast-paced Introduction to Android Internals
Fast-paced Introduction to Android InternalsFast-paced Introduction to Android Internals
Fast-paced Introduction to Android InternalsHamilton Turner
 
Android os installation
Android os installationAndroid os installation
Android os installationNipun Jolly
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011pundiramit
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...ijafrc
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughBenjamin Zores
 
ABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsBenjamin Zores
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
Headless Android Strikes Back!
Headless Android Strikes Back!Headless Android Strikes Back!
Headless Android Strikes Back!Gary Bisson
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyBenjamin Zores
 
FTF2014 - Android Accessory Protocol
FTF2014 - Android Accessory ProtocolFTF2014 - Android Accessory Protocol
FTF2014 - Android Accessory ProtocolGary Bisson
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting SequenceJayanta Ghoshal
 
Android Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинAndroid Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинGDG Saint Petersburg
 
ABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsBenjamin Zores
 
How To Connect Hardware To Device Emulatorx
How To Connect Hardware To Device EmulatorxHow To Connect Hardware To Device Emulatorx
How To Connect Hardware To Device EmulatorxZebra Chen
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleCloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleBenjamin Zores
 
ExoPlayer for Application developers
ExoPlayer for Application developersExoPlayer for Application developers
ExoPlayer for Application developersHassan Abid
 
What should you know about Net Core?
What should you know about Net Core?What should you know about Net Core?
What should you know about Net Core?Damir Dobric
 

Was ist angesagt? (20)

A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
A War Story: Porting Android 4.0 to a Custom Board (ELCE 2012)
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Fast-paced Introduction to Android Internals
Fast-paced Introduction to Android InternalsFast-paced Introduction to Android Internals
Fast-paced Introduction to Android Internals
 
Android os installation
Android os installationAndroid os installation
Android os installation
 
Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011Android porting for dummies @droidconin 2011
Android porting for dummies @droidconin 2011
 
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
Customizing AOSP For Different Embedded Devices And Integration at Applicatio...
 
ABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting WalkthroughABS 2012 - Android Device Porting Walkthrough
ABS 2012 - Android Device Porting Walkthrough
 
ABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded SystemsABS 2014 - The Growth of Android in Embedded Systems
ABS 2014 - The Growth of Android in Embedded Systems
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
Headless Android Strikes Back!
Headless Android Strikes Back!Headless Android Strikes Back!
Headless Android Strikes Back!
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Droidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform AnatomyDroidcon 2013 France - Android Platform Anatomy
Droidcon 2013 France - Android Platform Anatomy
 
FTF2014 - Android Accessory Protocol
FTF2014 - Android Accessory ProtocolFTF2014 - Android Accessory Protocol
FTF2014 - Android Accessory Protocol
 
Android Booting Sequence
Android Booting SequenceAndroid Booting Sequence
Android Booting Sequence
 
Android Meetup, Илья Лёвин
Android Meetup, Илья ЛёвинAndroid Meetup, Илья Лёвин
Android Meetup, Илья Лёвин
 
ABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat InternalsABS 2014 - Android Kit Kat Internals
ABS 2014 - Android Kit Kat Internals
 
How To Connect Hardware To Device Emulatorx
How To Connect Hardware To Device EmulatorxHow To Connect Hardware To Device Emulatorx
How To Connect Hardware To Device Emulatorx
 
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets AnsibleCloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
CloudOpen 2014 - Extending Cloud Automation, When OpenStack Meets Ansible
 
ExoPlayer for Application developers
ExoPlayer for Application developersExoPlayer for Application developers
ExoPlayer for Application developers
 
What should you know about Net Core?
What should you know about Net Core?What should you know about Net Core?
What should you know about Net Core?
 

Ähnlich wie What & How to Customize Android?

Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01letuan9999
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with androidfirenze-gtug
 
Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Nanik Tolaram
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PICliff Samuels Jr.
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android晓东 杜
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Codemotion
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Ron Munitz
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitVasily Ryzhonkov
 
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...Netwalker lab kapper
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...Hackito Ergo Sum
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Ron Munitz
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Ron Munitz
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android EmulatorSamael Wang
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleMirco Vanini
 

Ähnlich wie What & How to Customize Android? (20)

Lecture02web 140phpapp01
Lecture02web 140phpapp01Lecture02web 140phpapp01
Lecture02web 140phpapp01
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Programming objects with android
Programming objects with androidProgramming objects with android
Programming objects with android
 
Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7Learning AOSP - Building AOSP for Nexus 7
Learning AOSP - Building AOSP for Nexus 7
 
Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
 
How to Hack Edison
How to Hack EdisonHow to Hack Edison
How to Hack Edison
 
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
Building Android for the Cloud: Android as a Server (Mobile World Congress 2014)
 
IoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT DevkitIoT Getting Started with Intel® IoT Devkit
IoT Getting Started with Intel® IoT Devkit
 
Начало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev KitНачало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev Kit
 
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
Beginner for install Linux and *BSD in the inexpensive ARM and Intel based mo...
 
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
[HES2013] Hacking apple accessories to pown iDevices – Wake up Neo! Your phon...
 
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
Android As a Server- Building Android for the Cloud (AnDevCon SF 2013)
 
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
Building android for the Cloud: Android as a Server (AnDevConBoston 2014)
 
Study on Android Emulator
Study on Android EmulatorStudy on Android Emulator
Study on Android Emulator
 
Udev
UdevUdev
Udev
 
Zedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on ZedboardZedroid - Android (5.0 and later) on Zedboard
Zedroid - Android (5.0 and later) on Zedboard
 
Windows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sampleWindows 10 IoT Core, a real sample
Windows 10 IoT Core, a real sample
 

Mehr von Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院)

Mehr von Industrial Technology Research Institute (ITRI)(工業技術研究院, 工研院) (20)

What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?What is the world where you can make your own semiconductors?
What is the world where you can make your own semiconductors?
 
半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!半導体製造(TinyTapeout)に挑戦しよう!
半導体製造(TinyTapeout)に挑戦しよう!
 
Introduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPWIntroduction of ISHI-KAI with OpenMPW
Introduction of ISHI-KAI with OpenMPW
 
Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会Kernel/VMレイヤーを自分色に染める!By ISHI会
Kernel/VMレイヤーを自分色に染める!By ISHI会
 
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPiPrinciple Representation of The 8 Qubits Quantum Computer by RaspberryPi
Principle Representation of The 8 Qubits Quantum Computer by RaspberryPi
 
Microwaveguquantum
MicrowaveguquantumMicrowaveguquantum
Microwaveguquantum
 
The easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on WindowsThe easiest way of setup QuTiP on Windows
The easiest way of setup QuTiP on Windows
 
GNU Radio Study for Super beginner
GNU Radio Study for Super beginnerGNU Radio Study for Super beginner
GNU Radio Study for Super beginner
 
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
The Self-Contained SDR Satellite Grand Station with Raspberry Pi 3
 
Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3Self‐Contained SDR Grand Station with Raspberry Pi 3
Self‐Contained SDR Grand Station with Raspberry Pi 3
 
衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記衛星追尾用パラボラアンテナ建設記
衛星追尾用パラボラアンテナ建設記
 
All list of the measuring machines for microwave
All list of the measuring machines for microwaveAll list of the measuring machines for microwave
All list of the measuring machines for microwave
 
5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局5000円で誰でも作れる新世代衛星地上局
5000円で誰でも作れる新世代衛星地上局
 
How to setup mastodon in chinese
How to setup mastodon in chineseHow to setup mastodon in chinese
How to setup mastodon in chinese
 
Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-Radiation Test -Raspberry PI Zero-
Radiation Test -Raspberry PI Zero-
 
將DNA在廚房抽出的程序
將DNA在廚房抽出的程序將DNA在廚房抽出的程序
將DNA在廚房抽出的程序
 
Protocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in KitchenProtocol of the DNA Extraction in Kitchen
Protocol of the DNA Extraction in Kitchen
 
How to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android StudioHow to Build & Use OpenCL on Android Studio
How to Build & Use OpenCL on Android Studio
 
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
OpenCV acceleration battle:OpenCL on Firefly-RK3288(MALI-T764) vs. FPGA on Ze...
 
How to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDKHow to Build & Use OpenCL on OpenCV & Android NDK
How to Build & Use OpenCL on OpenCV & Android NDK
 

Kürzlich hochgeladen

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 

Kürzlich hochgeladen (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 

What & How to Customize Android?

  • 1. What & How to Customize Android? Noritsuna Imamura noritsuna@siprop.org ©SIProp Project, 2006-2008 1
  • 2. Agenda What’s Android System? Kinds of Android Devices Kinds of Android Type Android Source Code Inside Android Boot Sequence About init File Hands On Nexus7 Pandaboard How to Debug ©SIProp Project, 2006-2008 2
  • 3. Kinds of Android Device Smart Phone Tablet Mini PC Note PC Car Navigation Set Top Box Smart Watch Smart Glass Camera Game Console Audio System Micro Wave Refrigerator Cut Board EVB If you get today’s knowledge, You can customize these devices yourself!!! ©SIProp Project, 2006-2008 3
  • 4. Why Customize it? More Functions Add Other Library Add Other Software Attach Other Device Add Driver So Slow(Ex. Old PC) Modify Bottleneck Software Delete needless Software & Library Useless Customized UI/UX Software ©SIProp Project, 2006-2008 4
  • 5. Kinds of Android Type Android Kernel More Functions Attach Other Device So Slow Useless No Source No Source × × × × No Source w/Source × △ No-Use as Android App △ × w/Source No Source ○ × ○ Almost Bottleneck In Here ○ UI/UX Engine In Here w/Source w/Source ◎ Use Kernel Level Driver ○ ◎ ○ ©SIProp Project, 2006-2008 5
  • 6. About Android Android Framework has 3 Layer Stack for SmartPhone & Tablet PC. Application Framework Layer (Java) Library Layer (Linux C/C++) Kernel/Driver Layer (Linux Kernel C/ASM) ©SIProp Project, 2006-2008 6
  • 7. About Android Source Code packages App for Android frameworks Lib for Android Apps system Sys Lib for Framework docs Java Doc for Android developers Sample, Demos build Tool for Android Build prebuilts Toolchain sdk Android SDK ndk Native SDK pdk for 3rd Party SDK cts Compatibility Test tools Tools for External 2006-2008 ©SIProp Project, 7
  • 8. About Android Source Code external Linux Lib libcore Lib for Android bionic libc for Android device Diff for Devices hardware Drivers bootable BootLoader libnativehelper Helper for JNI abi Application Binary Interface dalvik Java VM art Next Generation VM ©SIProp Project, 2006-2008 8
  • 9. License 3 Types License Apache 2.0 Google Proprietary All Application Framework Some Libraries Bionic GPL Almost Libraries Linux Kernel Apache 2.0 Google Proprietary Google Applications from Play Store GPL How to Get Play Store? Pass CTS ©SIProp Project, 2006-2008 9
  • 10. License 3 Types License Apache 2.0 All Application Framework Some Libraries Bionic GPL Almost Libraries Linux Kernel Google Proprietary Google Applications from Play Store AOSP (Android Open Source Project) How to Get Play Store? Pass CTS ©SIProp Project, 2006-2008 10
  • 11. License 3 Types License Apache 2.0 Google Android All Application Framework Some Libraries Bionic GPL Almost Libraries Linux Kernel Google Proprietary Google Applications from Play Store AOSP (Android Open Source Project) How to Get Play Store? Pass CTS ©SIProp Project, 2006-2008 11
  • 12. GApp Goo.im – Premium Android Developer File Hosting This Site hosts Google Proprietary Apps!!! http://goo.im/home You can use Google Proprietary Apps on your Device. However it’s illegal… ©SIProp Project, 2006-2008 12
  • 13. Feature Matrix of ARM Chips AllWinner RockChip MediaTek Freescale TI Samsung Qualcomm Chip Name A31 RK3188 MT6589 i.MX6Q OMAP54 32 Exynos5 Krait400 CPU Type A7 Quad A9 Quad A7 Quad A9 Quad A15 Dual A15 Quad A15 Quad Device Type Tablet Mini PC Smart Phone EVB EVB EVB Used Area Cheap Device Cheap Device Cheap Phone N/A Customiz N/A ed Device 3G/LTE Device Official Source Code Kernel Kernel Some Android Kernel Full Android Kernel Full Android Kernel Full Android Kernel Support × △ × ○ ◎ ◎ ○ Availability ○ ○ ? ◎ ◎ ? × Promising ○ ◎ ○ × × ○ △ Reason Cheapes t Better chip RF chip Dev team is gone Full Android Kernel Tablet Expensiv e 13 ©SIProp Project, 2006-2008
  • 15. Boot Up Flow CPU~Kernel Ex. x-loader&u-boot ©SIProp Project, 2006-2008 15
  • 16. Boot Up Flow Kernel~Android System Init Set Permission Mount Disks Load Driver Demons Linux App Zygote Sharing JavaResource Manager Runtime Linux SO Driver ©SIProp Project, 2006-2008 16
  • 17. About init File What’s works? Prepare dir, file for Service Run Services(Demon), Runtime Setup Permission 1. 2. 3. 4. 5. 6. on post-fs-data mkdir /data/media 0770 media_rw media_rw setprop vold.post_fs_data_done 1 mkdir /data/misc/dhcp 0770 dhcp dhcp chown dhcp dhcp /data/misc/dhcp mkdir /data/misc/wifi/sockets 0770 wifi wifi 7. 8. 9. service dhcpcd_wlan0 /system/bin/dhcpcd -ABKL disabled oneshot 10. #for V4L 11. /dev/video0 12. /dev/video1 0666 system 0666 system system system ©SIProp Project, 2006-2008 17
  • 18. Difference of Between Linux to Android ©SIProp Project, 2006-2008 18
  • 19. Sorry!!! About SMP(Multi Core) Compile Next Week! ©SIProp Project, 2006-2008 19
  • 21. Setup 2 Kinds of Android SmartPhone Nexus7 (2013) Android 4.3 Released by Community Non-Driver(BSP) EVB Pandaboard Android 4.4 Released by Google All Softwares ©SIProp Project, 2006-2008 21
  • 22. Building Environment CPU Core i7 4core – 8thread Memory 8GB OS Ubuntu12.04 64bits ©SIProp Project, 2006-2008 22
  • 24. Common Setup 1/2 Setup Build Tools sudo apt-get install bison build-essential curl flex git-core gnupg gperf libesd0dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readlinegplv2-dev lib32z1-dev Setup Build Tools for ARM sudo apt-get install uboot-mkimage ©SIProp Project, 2006-2008 24
  • 25. Common Setup 2/2 Setup Build Tools for Android › curl http://commondatastorage.googleapis.com/gitrepo-downloads/repo > ~/bin/repo › chmod a+x ~/bin/repo › export PATH=$PATH:~/bin/repo › sudo add-apt-repository ppa:nilarimogard/webupd8 › sudo apt-get update › sudo apt-get install android-tools-fastboot ©SIProp Project, 2006-2008 25
  • 27. What’s Nexus7? Target Tablet Nexus7(2013) http://www.google.com/ nexus/7/ OS JCROM With Build Manual https://sites.google.com/ site/jcromproject/ ©SIProp Project, 2006-2008 27
  • 28. Check Points How to Customize Community Source Code How did they get them? They don’t have BSP(Driver). How about Android System. eMMC, OTA-Package You can Customize GUI(HOME) What can you Customize Android System? UI System, Settings ©SIProp Project, 2006-2008 28
  • 29. How to Build Setup Process 1. 2. 3. 4. 5. Download Source Code Download BSP from site & your real device Download & Build kernel Make OTA image Write new OTA image ©SIProp Project, 2006-2008 29
  • 30. Download Source Code Download from JCROM’s repository › repo init -u https://bitbucket.org/sola/jcrom_manifest m jcrom_jb-4.3-master.xml › repo sync ©SIProp Project, 2006-2008 30
  • 31. Download BSP from site & your real device 1/2 Register your board to udev. Add the following line to ‘/etc/udev/rules.d/51android.rules’ SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e40", MODE="0666" # Bootloader SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="d001", MODE="0666" # Recovery SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e43", MODE="0666" # PTP media, USB debug off SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e44", MODE="0666" # PTP media, USB debug on SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e41", MODE="0666" # MTP media, USB debug off SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4e42", MODE="0666" # MTP media, USB debug on SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", ATTR{idProduct}=="4ee2", MODE="0666" # MTP media, USB debug on Restart ‘udev’ service ©SIProp Project, 2006-2008 31
  • 32. Download BSP from site & your real device 2/2 Download BSPs from Real Device & Internet *This version uses Internet only. Use adb If your system doesn’t have adb, please do: sudo apt-get install android-tools-fastboot › cd ~/nexus_work/android/device/asus/flo › ./download-blobs.sh › cd ~/nexus_work/android/jcrom/asus/flo/proprie tary/ › ./extract-files.sh ©SIProp Project, 2006-2008 32
  • 33. Download & Build kernel Download & Build kernel › cd ~/nexus_work › export ARCH=arm › export CROSS_COMPILE=~/nexus_work/android/prebuilts/gc c/linux-x86/arm/arm-eabi-4.6/bin/arm-eabi› git clone https://android.googlesource.com/kernel/msm.git -b android-msm-flo-3.4-jb-mr2 kernel/nexus72 › cd kernel/nexus72 › make flo_defconfig › make › cp arch/arm/boot/zImage ~/nexus_work/android/device/asus/flo-kernel/kernel ©SIProp Project, 2006-2008 33
  • 34. Make OTA image Make OTA image This OTA image is update image for Android. › › › › cd ~/nexus_work/android/ source build/envsetup.sh lunch aosp_flo-user make otapackage This file name is aosp_flo-ota-eng.[your Linux’s User name].zip ©SIProp Project, 2006-2008 34
  • 35. build/envsetup.sh Helper Command Lib for Android Build m jgrep Build from Top Dir mm Build from Current Dir mmm [Target Dir] Build from Target Dir croot Change Top Dir Grep for Java Source Code resgrep Grep for XML Source Code lunch Choose Target Build cgrep Grep for C/C++ Source Code ©SIProp Project, 2006-2008 35
  • 36. What’s Android OTA-Package OTA = Over-The-Air (Update) Android OTA-Package has ROM images. boot.img Kernel, Init, Minimam Linux cache.img Temporary Area recovery.img Recovery Manager Program system.img Android System userdata.img User Data ©SIProp Project, 2006-2008 36
  • 37. What’s Fastboot? Fastboot is ROM Manager for eMMC. eMMC is managed by Address in Low Lovel. When you write your Kernel, you MUST point kernel address. If you mistake kernel address, your system is broken… Separated by Address ©SIProp Project, 2006-2008 37
  • 38. What’s Inside of Image File? It’s ramdisk boot.img-ramdisk.gz › mkdir ramdisk › cd ramdisk › gunzip -c ../boot.img-ramdisk.gz | cpio –I If your new kernel has new functions, please modify ramdisk files. Ex. .ko file, new init file, etc. ©SIProp Project, 2006-2008 38
  • 39. Write new OTA image 1/3 If your phone has OEM lock, please unlock it. › adb reboot bootloader › fastboot oem unlock Change Recovery image. › wget http://download2.clockworkmod.com/recover ies/recovery-clockwork-6.0.4.3-flo.img › fastboot flash recovery recovery-clockwork6.0.4.3-flo.img › fastboot boot recovery-clockwork-6.0.4.3flo.img ※Connect your N7 to PC ©SIProp Project, 2006-2008 39
  • 40. Write new OTA image 2/3 Push your new OTA image to your N7 › adb push ~/nexus_work/android/out/target/product/fl o/aosp_flo-ota-eng.[your Linux's User name].zip /sdcard/ If you want to use Google Apps › wget http://goo.im/gapps/gapps-jb20130813-signed.zip › adb push gapps-jb-20130813-signed.zip /sdcard/ ©SIProp Project, 2006-2008 40
  • 41. Write new OTA image 3/3 1. Turn off your phone 2. Volume Up & Power 3. Wipe data/factory reset 4. Install zip from sdcard 5. Choose zip from sdcard 6. aosp_flo-ota-eng.[your Linux's User name].zip 7. Choose zip from sdcard 8. gapps-jb-20130813-signed.zip 9. +++++Go Back+++++ 10. Reboot system now ©SIProp Project, 2006-2008 41
  • 42. Boot up Your Nexus7! ©SIProp Project, 2006-2008 42
  • 44. What’s Pandaboard? Target EVB Pandaboard http://www.pandaboard. org/ OS Official Kernel & Android With Build Manual http://source.android.com /source/downloading.html ©SIProp Project, 2006-2008 44
  • 45. How to Use Peripherals? ADK (Accessory Development Kit) http://developer.android.com/tools/adk/index.html Advantage Develop on ADT Pin like Arduino Dis-Advantage So Slow… 9600bps ©SIProp Project, 2006-2008 45
  • 46. How to Use Peripherals? GPIO(General Purpose Input/Output) I2C(Inter-Integrated Circuit) SPI(Serial Peripheral Interface) UART(Serial) Fast: SPI > I2C Pin Num: SPI(4Pins) > I2C(3Pins) GPIO can use Registers. Advantage Bus Speed Connect All Peripheral Dis-Advantage Required Hardware Knowledge Like Assembler for Hardware ©SIProp Project, 2006-2008 46
  • 47. How to Build Setup Process 1. 2. 3. 4. 5. Download Source Code Download BSP from Google Download & Build Boot Loaders Build Android Setup SD Card ©SIProp Project, 2006-2008 47
  • 48. Download 4.4 Source Code Download from AOSP(Google)’s repository › › › › › mkdir ~/panda_work cd ~/panda_work mkdir mydroid cd mydroid repo init -u https://android.googlesource.com/platform/ manifest -b android-4.4_r1.1 › repo sync ©SIProp Project, 2006-2008 48
  • 49. Download BSP from Google Download BSPs(Driver) › cd ~/panda_work/mydroid › wget https://dl.google.com/dl/android/aosp/imgtec -panda-20130603-539d1ac3.tgz › tar zxvf imgtec-panda-20130603539d1ac3.tgz › ./extract-imgtec-panda.sh › git clone https://github.com/soladolphin1/sola_device_ti_panda.git -b kitkat device/ti/panda ©SIProp Project, 2006-2008 49
  • 50. Download Toolchain Required Android Toolchain for Panda’s Source › cd ~/panda_work › git clone https://android.googlesource.com/platform/pr ebuilt › export ARCH=arm › export CROSS_COMPILE=$PWD/prebuilt/linuxx86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- ©SIProp Project, 2006-2008 50
  • 51. Download & Build x-loader First Boot Loader for Pandaboard › cd ~/panda_work › git clone git://git.omapzoom.org/repo/xloader.git › cd x-loader › git checkout -b omap4_dev origin/omap4_dev › make omap4430panda_config › make ift › cp -a MLO ~/panda_work/mydroid/device/ti/panda/xload er.bin ©SIProp Project, 2006-2008 51
  • 52. Download & Build u-boot Second Boot Loader for Pandaboard › cd ~/panda_work › git clone git://git.omapzoom.org/repo/uboot.git › cd u-boot › git checkout -b omap4_dev origin/omap4_dev › wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch › git apply 0001-change-bootarges.patch › make omap4430panda_config › make › cp -a u-boot.bin ~/panda_work/mydroid/device/ti/panda/bootl oader.bin ©SIProp Project, 2006-2008 52
  • 53. Download & Build kernel Kernel for Pandaboard › cd ~/panda_work › git clone https://android.googlesource.com/kernel/oma p.git kernel › cd kernel › git checkout -b android-omap-panda-3.0 origin/android-omap-panda-3.0 › make panda_defconfig › make › cp -a arch/arm/boot/zImage ~/panda_work/mydroid/device/ti/panda/kerne l ©SIProp Project, 2006-2008 53
  • 54. Build Android Build Android › › › › cd ~/panda_work/mydroid source build/envsetup.sh lunch aosp_panda-userdebug make ©SIProp Project, 2006-2008 54
  • 55. Setup SD Card Make Partition for Android on SD Card boot system cache userdata media › wget http://www.noritsuna.com/download/mksdcar d_pandaboard.sh › chmod a+x mksdcard_pandaboard.sh › LANG=C sudo ./mksdcard_pandaboard.sh /dev/sdX ~/panda_work/mydroid ©SIProp Project, 2006-2008 55
  • 56. Boot up Your Pandaboard! ©SIProp Project, 2006-2008 56
  • 57. But……… TI support until 4.2 2012.06.27 4.1 Jelly Bean 2012.11.13 4.2 2013.07.24 4.3 4.1, 4.2 Available USB Audio Support i18n(Internationalization) Support Vibration for Input Device Support Miracast Support Writing Vertically Support RenderScript Change Android Market to Google Play Linux: 3.1.10 4.3 Support OpenGL/ES 3.0 Support Bluetooth LE Support Wi-Fi Location Linux: 3.4.0 ©SIProp Project, 2006-2008 57
  • 58. How to Build Setup Process 1. 2. 3. 4. 5. Download Source Code Download BSP from Google Download & Build Boot Loaders Build Android Setup SD Card ©SIProp Project, 2006-2008 58
  • 59. Download 4.2 Source Code Download from AOSP(Google)’s repository › › › › › mkdir ~/panda_work cd ~/panda_work mkdir mydroid cd mydroid repo init -u https://android.googlesource.com/platform/ manifest -b android-4.2.1_r1 › repo sync ©SIProp Project, 2006-2008 59
  • 60. Download BSP from Google Download BSPs(Driver) › cd ~/panda_work/mydroid › wget https://dl.google.com/dl/android/aosp/imgtec -panda-20120807-c4e99e89.tgz › tar zxvf imgtec-panda-20120807c4e99e89.tgz › ./extract-imgtec-panda.sh Get some Patches › › › › › › › › › › › › cd ~/panda_work/mydroid/build/ wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_build.patch git apply 0001-panda-jb4.2_build.patch cd ~/panda_work/mydroid/device/ti/panda/ wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_device-ti-panda.patch git apply 0001-panda-jb4.2_device-ti-panda.patch cd ~/panda_work/mydroid/hardware/ti/omap4xxx/ wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_hardware-ti-omap4xxx.pah git apply 0001-panda-jb4.2_hardware-ti-omap4xxx.patch cd ~/panda_work/mydroid/hardware/ti/wpan/ wget http://sola-dolphin-1.net/data/Panda/0001-panda-jb4.2_hardware-ti-wpan.patch ©SIProp Project, 2006-2008 git apply 0001-panda-jb4.2_hardware-ti-wpan.patch 60
  • 61. Download Toolchain Required Android Toolchain for Panda’s Source › cd ~/panda_work › git clone https://android.googlesource.com/platform/pr ebuilt › export ARCH=arm › export CROSS_COMPILE=$PWD/prebuilt/linuxx86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- ©SIProp Project, 2006-2008 61
  • 62. Download & Build x-loader First Boot Loader for Pandaboard › cd ~/panda_work › git clone git://git.omapzoom.org/repo/xloader.git › cd x-loader › git checkout -b omap4_dev origin/omap4_dev › make omap4430panda_config › make ift › cp -a MLO ~/panda_work/mydroid/device/ti/panda/xload er.bin ©SIProp Project, 2006-2008 62
  • 63. Download & Build u-boot Second Boot Loader for Pandaboard › cd ~/panda_work › git clone git://git.omapzoom.org/repo/uboot.git › cd u-boot › git checkout -b omap4_dev origin/omap4_dev › wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch › git apply 0001-change-bootarges.patch › make omap4430panda_config › make › cp -a u-boot.bin ~/panda_work/mydroid/device/ti/panda/bootl oader.bin ©SIProp Project, 2006-2008 63
  • 64. Download & Build kernel Kernel for Pandaboard › cd ~/panda_work › git clone https://android.googlesource.com/kernel/oma p.git kernel › cd kernel › git checkout -b android-omap-panda-3.0 origin/android-omap-panda-3.0 › make panda_defconfig › make › cp -a arch/arm/boot/zImage ~/panda_work/mydroid/device/ti/panda/kerne l ©SIProp Project, 2006-2008 64
  • 65. Build Android Build Android › › › › cd ~/panda_work/mydroid source build/envsetup.sh lunch aosp_panda-userdebug make ©SIProp Project, 2006-2008 65
  • 66. Setup SD Card Make Partition for Android on SD Card boot system cache userdata media › wget http://www.noritsuna.com/download/mksdcar d_pandaboard.sh › chmod a+x mksdcard_pandaboard.sh › LANG=C sudo ./mksdcard_pandaboard.sh /dev/sdX ~/panda_work/mydroid ©SIProp Project, 2006-2008 66
  • 67. Boot File of Pandaboard ©SIProp Project, 2006-2008 67
  • 68. Download & Build u-boot Download it with Patch of Boot Option › cd ~/panda_work › git clone git://git.omapzoom.org/repo/uboot.git › cd u-boot › git checkout -b omap4_dev origin/omap4_dev › wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch › git apply 0001-change-bootarges.patch › make omap4430panda_config › make › cp -a u-boot.bin ~/panda_work/mydroid/device/ti/panda/bootl oader.bin ©SIProp Project, 2006-2008 68
  • 69. About boot.scr Contents of Patch › › › › › › › › › --- a/include/configs/omap4430panda.h +++ b/include/configs/omap4430panda.h @@ -147,8 +147,7 @@ " ip=dhcp" #else -#define CONFIG_BOOTARGS "console=ttyO2,115200n8 mem=512M" " init=/init vram=32M omapfb.vram=0:16M androidboot.console=ttyO2" +#define CONFIG_BOOTARGS "kgdboc=ttyO2,115200 console=ttyO2,115200n8 mem=1G androidboot.console=ttyO2" ©SIProp Project, 2006-2008 69
  • 70. About boot.scr If you want to change boot option by script file Sample of Boot Script file: File Name=boot.txt › › › setenv fdt_high "0xffffffff" setenv bootcmd "fatload mmc 0:1 0x80200000 uImage; fatload mmc 0:1 0x81600000 uInitrd; fatload mmc 0:1 0x815f0000 board.dtb; bootm 0x80200000 0x81600000 0x815f0000" setenv bootargs "console=ttyO2,115200n8 rootwait ro earlyprintk fixrtc nocompcache vram=48M omapfb.vram=0:24M,1:24M mem=456M@0x80000000 mem=512M@0xA0000000 init=/init androidboot.console=ttyO2 omapfb.mode=dvi:1280x800MR-24@60 consoleblank=0" How to Make boot.scr from Boot Script file mkimage -A arm -T script -O linux -C none -a 0 -e 0 -n "boot.scr" -d boot.scr.txt boot.scr ©SIProp Project, 2006-2008 70
  • 71. Common Setup 1/2 Setup Build Tools sudo apt-get install bison build-essential curl flex git-core gnupg gperf libesd0dev libncurses5-dev libsdl1.2-dev libwxgtk2.8-dev libxml2 libxml2-utils lzop openjdk-6-jdk openjdk-6-jre pngcrush schedtool squashfs-tools xsltproc zip zlib1g-dev g++-multilib gcc-multilib lib32ncurses5-dev lib32readlinegplv2-dev lib32z1-dev Setup Build Tools for ARM sudo apt-get install uboot-mkimage ©SIProp Project, 2006-2008 71
  • 73. How to Use JTAG-ICE ©SIProp Project, 2006-2008 73
  • 74. Debugging by ICE(In Circuit Emulator) Full ICE This has CPU&CPU Debugging Func. When you use it, you change Real CPU to This CPU. JTAG ICE Real CPU has Debugging Func. JTAG is Control Pin for CPU Debugging Func, ©SIProp Project, 2006-2008 74
  • 75. Why Need? Soft Level Debugger can debug their managed apps only. Ex. Kernel Panic: Console Log Only Ex. DDMS: Android Framework managed Linux Lib ©SIProp Project, 2006-2008 75
  • 76. How to Setup JTAG-ICE ©SIProp Project, 2006-2008 76
  • 77. Flyswatter2 Pandaboard One of Cheapest JTAG-ICE. Today, getting popular under $300USD. Old one is Over $3000USD ©SIProp Project, 2006-2008 77
  • 78. Setup udev Register your board to udev. Add the following line to ‘/etc/udev/rules.d/51android.rules’ # usbboot protocol on panda (PandaBoard) SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d00f", MODE="0666", OWNER="<username>" # usbboot protocol on panda (PandaBoard ES) SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d010", MODE="0666", OWNER="<username>" SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d022", MODE="0666", OWNER="<username>" Restart ‘udev’ service ©SIProp Project, 2006-2008 78
  • 79. Add Debug Information to Source Code What’s Debug Information? Executed File(Compiled File) is machine code. Human can NOT read it… 1. 2. 3. 4. 5. 6. I/DEBUG I/DEBUG I/DEBUG I/DEBUG I/DEBUG I/DEBUG 40000030 I/DEBUG 7. ( 3037): pid: 3233, tid: 3234 >>> /system/bin/netd <<< ( 3037): signal 11 (SIGSEGV), fault addr deadbaad ( 3037): r0 00001728 r1 100ffd7c r2 00000027 r3 00000000 ( 3037): r4 afd42328 r5 00000000 r6 00000000 r7 00011000 ( 3037): r8 00100000 r9 aef01cad 10 10000000 fp 40008008 ( 3037): ip ffffffff sp 100ffd68 lr deadbaad pc afd11ca4 cpsr ( 3037): d0 3d454d414e564544 d1 6164732f7665642f Ex. gcc (DWARF) -g(n) Debug Option. n=Debug Level –O0 Optimized Option & Level. 0=non-optimized. Always use “3”. ©SIProp Project, 2006-2008 79
  • 80. Change KGDB Config Turn On Kernel Config Kernel hacking Compile the kernel with debug info KGDB: kernel degugger KGDB: user kgdb over the serial console (NEW) › cd ~/panda_work/kernel › make menuconfig › make ©SIProp Project, 2006-2008 80
  • 81. Change KGDB Config ©SIProp Project, 2006-2008 81
  • 82. Change KGDB Config ©SIProp Project, 2006-2008 82
  • 83. Change KGDB Config ©SIProp Project, 2006-2008 83
  • 84. Change KGDB Config ©SIProp Project, 2006-2008 84
  • 85. Change u-boot Need Boot Option for KGDB “kgdboc=ttyO2,115200” in “bootargs” section › wget http://www.noritsuna.com/download/0001change-bootarges.patch › git apply 0001-change-bootarges.patch › make › cp -a u-boot.bin ~/panda_work/mydroid/device/ti/panda/bootl oader.bin ©SIProp Project, 2006-2008 85
  • 86. Old u-boot Different Point › cd ~/panda_work › git clone git://git.omapzoom.org/repo/uboot.git › cd u-boot › git checkout -b omap4_dev origin/omap4_dev › wget http://android-developmentenvironment.googlecode.com/files/0001change-bootarges.patch › git apply 0001-change-bootarges.patch › make omap4430panda_config › make › cp -a u-boot.bin ~/panda_work/mydroid/device/ti/panda/bootl oader.bin ©SIProp Project, 2006-2008 86
  • 87. Setup Debugging Software Why Need? 1. #00 pc 00011ca4 /system/lib/libc.so How do you debug it??? If your code has DWARF(Debug Info), you can use “objdump” command. arm-eabi-objdump -S -C libc.so |less -S Show de-assembler source code -C Show C/C++ function name of source code 1. 11ca4: f005 ff25 bl 11c40 <abort> bionic/libc/unistd/abort.c ©SIProp Project, 2006-2008 87
  • 88. Setup Debugging Software ©SIProp Project, 2006-2008 88
  • 89. Setup FTDI Driver (Serial) › › cd ~/panda_work wget http://www.intra2net.com/en/developer/libftdi/download/libft di-0.19.tar.gz › tar zxfv libftdi-0.19.tar.gz › cd ~/panda_work/libftdi-0.19/src › sudo cp ftdi.h /usr/include › cd /usr/local/include › sudo ln -s /usr/include/ftdi.h ftdi.h › cd ~/panda_work/libftdi-0.19 › ./configure › make › sudo make install › › › › › › cd /usr/lib sudo ln -s /usr/local/lib/libftdi.a libftdi.a sudo ln -s /usr/local/lib/libftdi.la libftdi.la sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so.1.19.0 sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so sudo ln -s /usr/local/lib/libftdi.so.1.19.0 libftdi.so.1 ©SIProp Project, 2006-2008 89
  • 90. Setup OpenODC(On-Chip Debugging) This Debugger is Software for JTAG Debugger. Hardware JTAG Debugger get “RAW Data” only. › cd ~/panda_work › wget http://downloads.sourceforge.net/project/openocd.berli os/openocd-0.5.0.tar.gz › tar zxfv openocd-0.5.0.tar.gz › cd ~/panda_work/openocd-0.5.0 › wget http://www.tincantools.com/w/images/5/5d/Tincantool s-openocd-b0.12.patch › patch -p1 -i Tincantools-openocd-b0.12.patch › sudo ./configure --disable-werror --enableft2232_libftdi › sudo make ©SIProp Project, 2006-2008 › sudo make install 90
  • 91. Prepare JTAG Tools JTAG Commands › › › › › › › cd ~/panda_work mkdir openocd-bin cd ~/panda_work/openocd-0.5.0/tcl cp -r * ~/panda_work/openocd-bin cd ~/panda_work/openocd-0.5.0/src cp openocd ~/panda_work/openocd-bin export PATH=$PATH:~/panda_work/openocdbin ©SIProp Project, 2006-2008 91
  • 93. Connect JTAG Debugger This tool uses telnet command. › cd ~/panda_work/openocd-bin › sudo ./openocd -f interface/flyswatter2.cfg -f board/ti_pandaboard.cfg › telnet localhost 4444 ©SIProp Project, 2006-2008 93
  • 94. JTAG Commands reset, halt, resume Use for Break Point reg reg Show register reg [entry] Show entry register reg [entry] [value] Set value to entry register ©SIProp Project, 2006-2008 94
  • 95. Setup DDD(Data Display Debugger) GUI Debugger › sudo apt-get install ddd ©SIProp Project, 2006-2008 95
  • 96. How to Use Debugger 1. Start OpenOCD › sudo ./openocd -f interface/flyswatter2.cfg -f board/ti_pandaboard.cfg 2. Connect Console, And exec “halt” › telnet localhost 4444 › > halt 3. Start DDD › › › › $ ddd --debugger arm-eabi-gdb GDB Console (gdb) file vmlinux (gdb) target remote localhost:3333 ©SIProp Project, 2006-2008 96
  • 97. Ex. Break Point Stop "resume" command on telnet Do exec "c" command on DDD GDB Console ©SIProp Project, 2006-2008 97