12/23/2007

Google Android runs on Sharp Zaurus SL-C3000

Now my Zaurus C3000 becomes an Android Zaurus.

I've followed Gergely's blog Google Android runs on Sharp Zaurus SL-C760 and got pretty much the same result.

o Keyboard working
o Touch panel not working
o Network from Android applet not working

I'll play with my Android Zaurus and I'll write another entry once I get some progress --- hopefully.

Here's the step by step what I did. I'm a newbie to OpenEmbedded, so there are better way to get, I guess.

First of all, get the OpenEmbedded environment. Follow the Building Angstrom | The Angstrom Distribution instruction.
$ mkdir -p openembedded/build/conf
$ cd openembedded
$ svn co svn://svn.berlios.de/bitbake/branches/bitbake-1.8/ bitbake
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
$ bunzip2 OE.mtn.bz2
$ sudo apt-get install monotone
$ mtn --db=OE.mtn checkout --branch=org.openembedded.dev
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
$ vi build/conf/local.conf
$ diff org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
27c27
< BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
---
> BBFILES = "/path/to/openembedded/org.openembedded.dev/packages/*/*.bb"
60a61
> MACHINE = "spitz"
80c81
< # DISTRO = "angstrom-2007.1"
---
> DISTRO = "angstrom-2007.1"
112c113
< IMAGE_FSTYPES = "jffs2 tar"
---
> IMAGE_FSTYPES = "jffs2 tar.gz"
140c141,142
< # PARALLEL_MAKE = "-j 4"
---
> PARALLEL_MAKE = "-j 4"
> BB_NUMBER_THREADS = "2"
150d151
< REMOVE_THIS_LINE:="${@bb.fatal('Read the comments in your conf/local.conf')}"


Now prepare some tools required to build. I did these installations while I was in try and error course, some might not be required.
$ sudo apt-get install help2man diffstat texi2html cvs gawk texinfo quilt autoconf
$ sudo apt-get install gcc-3.3 subversion monotone


If you are using Ubuntu (like me), you need to install kernel build packages, too.
$ sudo apt-get install build-essential kernel-package libncurses5-dev


To apply benno's android.diff in bitbaking time, modify the linux-rp_2.6.23.bb file. Also, linux-2.6.23.tar.bz2 in www.kernel.org already branched to some minor versions and not there anymore. So change the source to angstrom-distribution.org.
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ wget http://benno.id.au/android/android.diff
$ cd ..
$ cp linux-rp_2.6.23.bb linux-rp_2.6.23.bb.kernel.org
$ vi linux-rp_2.6.23.bb
$ diff linux-rp_2.6.23.bb.kernel.org linux-rp_2.6.23.bb
20c20
< SRC_URI = "http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.23.tar.bz2 \
---
> SRC_URI = "http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2 \
69a70
> file://android.diff;patch=1 \
$ cd openembedded/org.openembedded.dev/conf
$ cp checksums.ini checksums.ini.org
$ vi checksums.ini
$ diff checksums.ini.org checksums.ini
12888a12889,12891
> [http://www.angstrom-distribution.org/unstable/sources/linux-2.6.23.tar.bz2]
> md5=2cc2fd4d521dc5d7cfce0d8a9d1b3472
> sha256=d4e67c0935ffb2a4158234bff92cc791b83177866009fc9b2214104e0038dbdb


I came across a few errors while applying android.diff pacth, so I modified android.diff a little. Here's my version of android.diff. androidzaurus.tar

Start building toolchain. It takes very long. Telling you, veeerrrry looooong. With my Athlon 3500, I takes well half a day.
$ export PATH=~/openembedded/bitbake/bin:$PATH
$ export BBPATH=~/openembedded/build:~/openembedded/org.openembedded.dev
$ bitbake task-sdk


If fails, try some googles and bitbake task-sdk again.

To check the toolchain, try to build a minimal-image.
$ bitbake minimal-image
$ ls tmp/deploy/glibc/images/spitz/


Now I got kernel source tree. Try to retreive .config as defconfig-spitz. Also, turn Android specific configurations on. Here's my current defconfig-spitz. androidzaurus.tar
$ cd openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23
$ cp defconfig-spitz defconfig-spitz.org
$ cd tmp/work/spitz-angstrom-linux-gnueabi/linux-rp-2.6.23-r10/linux-2.6.23
$ make oldconfig
$ make menuconfig
$ cp .config /path/to/openembedded/org.openembedded.dev/packages/linux/linux-rp-2.6.23/defconfig-spitz
$ diff ../defconfig-spitz .config
1384a1392,1400
> # Android
> #
> # CONFIG_ANDROID_GADGET is not set
> # CONFIG_ANDROID_RAM_CONSOLE is not set
> CONFIG_ANDROID_POWER=y
> CONFIG_ANDROID_POWER_STAT=y
> CONFIG_ANDROID_LOGGER=y
>
> #


Let's build an Android-configured-Angstrom-kernel and console image.
$ bitbake linux-rp -c rebuild
$ bitbake console-image


Now ready to make Zaurus to Angstrom Zaurus. If you are new to altanative ROM (like me), first backup everything from your Zaurus. It is possible to make your Zaurus to a dead brick.

Copy the fresh baked image to Zaurus. Note that commands with $ prompt are on the host PC. Lines with # prompt are on Zaurus.
$ cd tmp/deploy/glibc/images/spitz/
$ scp Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz
# tar xvf Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit
# mv Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit /your/sdcard/root
# poweroff


I forgot to take a memo of the default mount point. Please check with mount command.

Time to burn the Angstrom image. Angstrom installation on Spitz | The Angstrom Distribution shows how to flash very well.
1) Shutdown Zaurus with poweroff command.
2) Flip Zaurus and unlock the battery switch. Open the battery cover.
3) Push the reset switch. It's a small rectangle black one.
4) Put the battery cover back and the lock switch on.
5) While pressing OK key in the center of cursor key, press On/Off switch.
6) Select "Update" and press OK key.
7) Select "SD Card" and press OK key.
8) Say Yes to the warning.
9) Cross your fingers and hold your breath.


Play with new Angstrom Zaurus and make sure you have ssh access to it. It would be better to modify /etc/network/interfaces to get rid of usb0 as default route. Just delete the gateway lines in usb sections.
$ ssh root@zaurus
# route del default
# vi /etc/network/interfaces


Now Android stuff. It's well explained in Google Android runs on Sharp Zaurus SL-C760. You also need Android SDK and unzip it.
$ cp /path/to/android-sdk/tools/lib/images/ramdisk.img ramdisk.img.gz
$ wget http://benno.id.au/android/system.tar.gz
$ wget http://benno.id.au/android/data.tar.gz
$ scp ramdisk.img.gz system.tar.gz data.tar.gz root@zaurus:/home/root
$ ssh root@zaurus
# gunzip ramdisk.img.gz
# gunzip system.tar.gz
# gunzip data.tar.gz
# mkdir android-root
# cd android-root
# cpio -iv < ../rammdisk.img
# tar xvf ../system.tar
# tar xvf ../data.tar
# vi a.sh
# cat a.sh

#!/system/bin/sh

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

mount -t proc proc /proc
mount -t sysfs sysfs /sys

/system/bin/app_process -Xzygote /system/bin --zygote &
/system/bin/dbus-daemon --system &
runtime


a.sh should be same as Google Android runs on Sharp Zaurus SL-C760.

Copy all of the device files to android-root. Then chmod the binder to 666. If you don't change the binder access mode, you will end up looking at red cylon forever.
# cd /dev
# tar cvf /home/root/dev.tar .
# cd /home/root/android-root/dev
# tar xvf /home/root/dev.tar
# chmod 666 binder


Final moment. Start Android.
# rm -f android-root/tmp/*
# umask 000
# chroot /home/root/android-root /a.sh


This could be a shell script as in Google Android runs on Sharp Zaurus SL-C760.

Have fun.

Todo is;
o Bring network up for Android applet.
o Keycode in android-root/etc/init.rc.
o Hack touch pannel driver to generate Android event.
o Vertical/Horizontal view style.
o Localization. I want my Japanese font and IM :-)
posted by 安藤恐竜 at 13:55 | Comment(25) | TrackBack(0) | 日記
Comments for this entry
Hi and I would like to say nice job!

OK I have IMX31 I would like to install android on it.


http://www.freescale.com/webapp/sps/site/homepage.jsp?nodeId=0162468rH311432973


Do you think that your procedure could work for me? It will be the first time that I do this so do not hesitated to give a lot of details ;)

Right now I have Computer with CentOS 5 connected on the bord that is running Linux freescale 2.6.22.6

What should I do first?

Why are you using Angstrom? Because this is a version of Linux for Sharp Zaurus?

Why you didnt use
http://code.google.com/p/android/downloads/list
linux-2.6.23-android-m3-rc20.tar.gz

????
Sorry for all those questions but Im trying to undertand a lot and have a lot to learn

THX
ps: This have already be done by Willcom:
http://www.engadget.com/2007/12/11/willcom-shows-off-an-android-prototype/





Posted by kapare at 01/10/2008 02:40
Kapare,

The reason of choice of Angstrom was I just followed the step of;
eu.edge &#187; Blog Archive &#187; Google Android runs on Sharp Zaurus SL-C760
http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus-sl-c760/

This article would be interresting to read.
About Google Android: Android Porting to Real Target HW
http://nemustech.blogspot.com/2007/12/android-porting-to-real-target-hw.html

As engadget reported, Wilcom's working group successfully ported Android to their dev board. I had a chance to see their demo. It works faster than my Android Zaurus because IMX31 runs at 530MHz vs Zaurus XScale has 400MHz.
Posted by androidzaurus at 01/10/2008 08:50
Dear AndroidZaurus,

Please pardon me as i dont know Japanese. Would be grateful is you too could reply in english. My query is below -

I was able to port Android on my ARM9 device (its not a Sharp device) , but i am having problem with the display colors.

The colors on the android startup wallpaper (mountains,snow,valley river) dont come out well on my display screen - there’s lots of pink instead of white and green color shows up instead of blue.

Through strace utility i saw that android sets the display driver to 16bpp. So i replaced the original wallpaper with a 16bpp picture but still the colors did not come out well.

Did you face any such problems ? What was your display driver configuration ? Any clues ?

Regards
&#8211;HAbdul
Posted by HAbdul at 01/15/2008 20:10
HAbdul,

I should be the one who says sorry for bloken English. I've been in California for some time and I got spoiled on grammer and miss spelling.

Regarding your concern, it might be a frame buffer configuration. As far as I know, none of front runners came across such a problem.

A lot in pink instead of white sounds like a couple of bits are shifted at the hardware. Some LCD driver might take bits shifted RGB to GBR.
Posted by androidzaurus at 01/15/2008 21:41
Hi,

Thanks for the detailed steps to build this. I had to do a couple minor things differently but overall this has been really useful.

You may want to actually gzip the androidzaurus.tar.gz file, right now it's just a .tar inside.

And I had to change the android.diff to make it apply cleanly. My current version's at http://patraulea.com/hacks/android/ (along with diffs from benno's version).

Cheers!
Bogdan
Posted by Bogdan at 01/16/2008 07:36
Thanks, Bogdan!

I corrected ta.gz to tar. How come nobody noticed till now, well including me. :-)

Also, thanks for your efforts for cleaning up diff file.

Cheers,
Posted by androidzaurus at 01/16/2008 09:27
47dc4760b962ff4bbf43784b3f8930e1
Posted by John Doe at 01/16/2008 09:53
Hi Androidzaurus:

After studying your article, I'm trying to make android runing on Nokia N800. But I face the first problem now. Becasue Nokia N800 linux kernel version is 2.6.18(maemo 3.2 SDK)

http://repository.maemo.org/pool/maemo3.2/free/source/kernel-source-rx-34_2.6.18.orig.tar.gz

so I supposed that I cann't patch androidzaurus.tar, and follow your step to make it work.

Even in (maemo4.x SDK) the linux kernel is 2.6.21, I still can't use the patch file directly.

Would you mind giving me some suggestions?

Cheers!
Posted by Colin at 01/17/2008 20:06
Colin,

I don't know anything about Nokia thing. First of all, you have to make sure that CPU is Armv5 or later and your build tool supports EABI.

Actually, you don't have to apply the Android patch. Try to make OpenBinder module driver and insmod it to your system. Then, follow the original benno's and/or eu.edge's way to bring up Android.

Also, your rootfs should be capable of mmap.

As far as I know, these three points are critical to bring Android up.

Good luck,
Posted by androidzaurus at 01/17/2008 23:16
Hello,

I have placed the android filesystem images in NAND flash of my ARM9 device, in jffs2 format. When i run a.sh, the zygote process exits. I get the following strace log for zygote -

Looks some mmap2() call to a file inside data folder is failing. But why ? mmap2() calls to libraries in the system folder seem to be working fine.
-------------------------------------
00:03:14.071414 open("/system/framework/core.jar", O_RDONLY|O_LARGEFILE) = 7
00:03:14.080763 lseek(7, 0, SEEK_CUR) = 0
00:03:14.080429 lseek(7, 0, SEEK_END) = 2400329
00:03:14.090516 lseek(7, 0, SEEK_SET) = 0
00:03:14.090205 mmap2(NULL, 2400329, PROT_READ, MAP_SHARED, 7, 0) = 0x41402000
00:03:14.210612 brk(0x13000) = 0x13000
00:03:14.210866 mkdir("/data", 0777) = -1 EEXIST (File exists)
00:03:14.221297 mkdir("/data/dalvik-cache", 0777) = -1 EEXIST (File exists)
00:03:14.240187 open("/data/dalvik-cache/system@framework@core.jar@classes.dex",
00:03:14.250349 flock(8, LOCK_EX) = 0
00:03:14.251338 fstat64(8, {st_mode=S_IFREG|0666, st_size=7252804, ...}) = 0
00:03:14.261538 stat64("/data/dalvik-cache/system@framework@core.jar@classes.dex
00:03:14.260308 read(8, "dey\n006\0(\0\0\0\375\252k\0(\253k\0\20\0\0\0008\253k\0
00:03:14.280527 lseek(8, 7056168, SEEK_SET) = 7056168
00:03:14.280702 read(8, "6gk7t\355\346\230\v\0\0\0\0\0\0\0", 16) = 16
00:03:14.290720 lseek(8, 0, SEEK_SET) = 0
00:03:14.290410 lseek(8, 0, SEEK_CUR) = 0
00:03:14.300851 lseek(8, 0, SEEK_END) = 7252804
00:03:14.300045 lseek(8, 0, SEEK_SET) = 0
00:03:14.310654 mmap2(NULL, 7252804, PROT_READ, MAP_SHARED, 8, 0) = -1 EINVAL (I
00:03:14.310757 writev(3, [{"\5", 1}, {"dalvikvm\0", 9}, {"mmap(7252804, R, FILE
00:03:14.321732 writev(3, [{"\6", 1}, {"dalvikvm\0", 9}, {"Unable to map file\n\
00:03:14.321060 writev(3, [{"\4", 1}, {"dalvikvm\0", 9}, {"Unable to map classes
--------------------------------------

Did you face such a problem ? Any clues ?

--Joey
Posted by Joey at 01/22/2008 22:10
Joey,

It's a famous mmap on jffs2 issue. Try to copy my android.img to your jffs2 partition and chroot to there after lopp mounting. Or you could workaround by initrd on RAM.
Posted by androidzaurus at 01/22/2008 23:35
Hi AZ,

Thanks mate,it worked after loop mounting.

BTW, does your touchpanel work ? On my device (its not Sharp Zaurus) the touchpanel driver passes absolute co-ordinate values to the kernel input subsystem. I later hacked it to pass co-ordinate values calibrated according to screensize , in my case VGA 640x480. In both cases nothing ever happens on the android screen when i touch (display is in landscape mode).

What else does the android touchscreen application expect from my kernel driver ?

-- Joey
Posted by Joey at 01/24/2008 19:41
Joey,

Glad to hear that.

The touchscreen of Zaurus works incomplete. Sometime I can use it, but sometime can not. It's really pain on the neck for us, too.

As far as I know, Android grabs touch pannel information from /sys/class/input/event1. If your touch screen driver doesn't support udev, implement it first.

drivers/input/touchscreen/corgi_ts.c is the driver of Zaurus touchscreen.
Posted by androidzaurus at 01/25/2008 18:15
AZ,

I can see my driver specific data in /sys/class/input/event0 (my touchp device is /dev/input/event0).

Also, I noticed a strange pattern with my touchscreen - any touch on the main android window is not recognised - i cannot open anything from the main panel using my touchscreen. But when i open the browser with keypad i can touch "Google search" button and the browser starts searching ! It then splashes a network error box (since i do not have network setup) - i can press "ok" on this box fairly well.

Using strace i went through details of the process that processes the touch events - i find that all of my touches (including the main screen ones) are read() . But sadly no action is taken on the main screen touches.

Cant understand this strange behaviour !

-Joey
Posted by Joey at 01/25/2008 20:54
Joey,

I agree with you. We need source code for sure.
Posted by androidzaurus at 01/26/2008 19:30
How do you resolve the famous mmap on jffs2 issue?
Would you please tell me the commands of chroot and loop mounting?

Thanks!
Posted by Edard Lee at 02/29/2008 17:09
Edard Lee,

jff2 can be work around using loopback mounting a ext2 file system image. You can study details in my SD boot image.

http://androidzaurus.seesaa.net/article/80102284.html
Posted by androidzaurus at 03/01/2008 11:26
Dear Sir,

I am trying porting Android to Spitz platform in Qemu, and the touchscreen doesn't working too. I guess that the Dalvik VM seems never catch touchscreen event, but mouse event.

The emulator of Android SDK(goldfish), it catchs mouse event and pass message to Dalvik VM to contrl.

Is this assumption correct ?

thank you!!
Posted by Marty at 05/12/2008 11:49
Marty san,

I just wrote an article about touchscreen.

Android Zaurus: Touchscreen works!
http://androidzaurus.seesaa.net/article/96581331.html

Hope that it helps a bit for you, too.
Posted by androidzaurus at 05/13/2008 17:49
cool, interesting
Posted by david at 09/08/2008 06:06
現在SL-C760にAndroidを入れようと試行錯誤しています。
しかしAngstromとやらを入れた後、さっぱりわからずにとりあえず、元のZaurusに戻そうと考えたのですが、一向にわかりません。
この記事も幾分か古いものですし、安藤恐竜さんは既にZaurusでのAndroidのインストール方法についてあまり覚えてらっしゃらないかもしれませんが、ご存知でしたら教えていただけないでしょうか?
よろしくお願いします。
Posted by half at 02/20/2010 00:51
C-760を持っていないので、工場出荷時の状態へのリカバリ方法はわからないです。ごめんなさい。;><
Posted by androidzaurus at 02/22/2010 08:43
ご回答ありがとうございます。
一応Androidは起動しました。
現在はアプリケーションのインストール方法を調べています。
Posted by half at 02/22/2010 18:06
Dear Androidzaurus, Your article http://androidzaurus.seesaa.net/article/96581331.html on Touchscreen is interensting. However, can you please tell me if I can have multi-touch API ported on our Android based camera board? Its because I have recently bought one camera board from e-con Systems with Android ported on it and wondering if I can write a driver/API for dual touch.
Posted by VenkipuramNarsimhan at 02/16/2011 17:16
ybiqmr [url=http://paydayloansbbj.co.uk/]payday UK[/url] 0545 [url=http://paydayloansbbj.com/]payday loans[/url] XZpxgU [url=http://paydayloansbbj.ca/]pay day loans[/url] 3359
Posted by payday UK at 01/12/2013 02:47
Leave your comment
Name: [Must]

EMail: [Must]

URL: [Must]

Comment: [Must]

Confirmation Code: [Must]


Type in alphabets what you see in this image.

Trackbacks to this entry
×

この広告は90日以上新しい記事の投稿がないブログに表示されております。