Wednesday, February 13, 2008

Android Porting Experience



Recently, I have spent 3 working days on porting Android to our PXA270 HW platform
Brief Condition:
HW:
PXA270 with PCI and IDE support
SW:
Linux 2.6.21 source code with our own driver (for PCI & IDE)
Linux 2.6.23 source code with android patch

Method:
1. porting customized driver from 2.6.21 to 2.6.23
2. porting android patch to 2.6.21

First of all, I must to explain what Android Kernel require.
1. EABI support
config:
CONFIG_AEABI=y
2. Thumb support
config:
CONFIG_ARM_THUMB=y
3. OpenBinder (from PalmSource)
file:
drivers/binder, include/linux/binder*
config: CONFIG_BINDER
4. Android Special Device
file:
drivers/android, include/linux/android*
config:
CONFIG_ANDROID_POWER
CONFIG_ANDROID_POWER_STAT
CONFIG_ANDROID_LOGGER

It looks like porting android patch into 2.6.21 is more simple. Therefore, I decide to use the second method. After porting drivers/android/*, EABI and Thumb. I can see a red-dot on the screen. Then I start to porting the openbinder to get into the Android desktop.

There are a lot of web pages talking about porting the Android binary into ARM platform. The steps is copy system/, data/, etc/, /init. And Writing a startup script to start Android. You can find these information in http://benno.id.au/blog/, http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-hw.html. After I do all of this, the android still block in

clock_gettime(CLOCK_MONOTONIC, {127, 101400000}) = 0
clock_gettime(CLOCK_MONOTONIC, {127, 103070000}) = 0
clock_gettime(CLOCK_MONOTONIC, {127, 104026000}) = 0
futex(0x134ac, FUTEX_WAIT, -1, {4, 997000000}) = 0
Finally, I found that my rootfs is jffs2, but jffs2 can't support mmap and /init will be failed. I put everything into the IDE hard disk and format as ext2 and BINGO!!!!!
Here is a very useful reference discuss.
http://groups.google.com/group/android-internals/browse_thread/thread/93570c41bce07f16

6 comments:

Anonymous said...

因為要苦思如何認識你阿
我是個"閉俗"的鄉民
你PPT應該也是momodalo 吧 XD
我有丟水球了 科科

Unknown said...

恩~我是個對於Android的新手,對於你的這篇文章很有興趣,所以很想認識你,希望日後能跟你請教這個相關的問題。 謝謝

Unknown said...

你好~我想請問你有關porting Android的問題,就是如果試著poring 其硬體的最基本配備等級是如何? 在這之前又該做那些準備或了解些什麼呢?

momodalo said...

硬體: ARMv5 cpu
RAM: 128mb
FLASH: 128mb
以上 :P

Unknown said...

感謝你的回答。

小印 said...

你好:

我想問一下怎麼porting?
Google之後還是不知道android patch是什麼東西,想要跟你請教一下,不曉得可以嗎?謝謝!