Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

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

Sunday, January 27, 2008

Gtk Embedded MPlayer


Recently, I want to embed a mplayer into my gtk program. I use the -wid option of mplayer to assign the parent X Window ID and draw the mplayer on a GtkDrawingArea. However, It still need some control widgets to control the mplayer. MPlayer provide the -input option to read input command from a file. The file could be a UNIX FIFO, so others can send command to mplayer through fifo. The command list is here. ( you can see it by type "mplayer -input cmdlist").

seek Float [Integer]
pause
loop Integer [Integer]
volume Float [Integer]
mute [Integer]
get_percent_pos
get_time_pos
get_time_length

I write a simple widget to embed mplayer and provide some require api to specified command. The project is named GtkEmbMPlayer. Here is the code for version 0.1.0
There is also a sample program to demo the widget.
PS: the sample and the widget still buggy.

Wednesday, August 29, 2007

MPE Launched!

我在sourceforce跟朋友開了一個project, 叫做mpe, 全名是modulized pages environment,
打算把一些想法做在裡面, 之後會跟GPE phone作整合, 做出一個更適合用在feature phone的環境. mpe介紹如下:

Modulized Pages Environment for embedded system. It can be used on mobile phones, car, or set-top box. MPE provide a lot of basic pages and a modulized environment to implement embedded system user interface.