Google Android runs on Sharp Zaurus SL-C760

December 6, 2007 – 1:04 pm by Gergely

Android main screen Yesterday we managed to get Google Android running on a Sharp Zaurus SL-C760. This seems to be the first documented success with this device. This article provides instructions on how to get it working, in case you would like to try it at home :)

Google Android is a new software stack for mobile devices, specifically mobile phones. It uses the Linux kernel as the core, but Google developed a new user space stack:

  • Developers use the Java language to write applications.
  • The applications are executed using the Dalvik VM instead of the regular JVM.
  • Google provides an easy to use SDK, complete with a QEMU based hardware emulator.

However, there is currently no real device on the market that runs Android. Open-source hackers instantly started to get the software from the emulator running on various devices. Most of the initial work was done by Ben “Benno” Leslie, who almost managed to run Android on a Neo 1973. Unfortunately the Neo includes an older ARM core, so the builds of the emulator won’t run on it.

Android browser

Then, based on Benno’s guide it was possible to run Android on an Armadillo-500.

Based on the findings of the earlier work, Android should run on any device with an ARMv5TE CPU + suitable amounts of RAM and Flash. Work started to get Android running on various devices, like the Sharp Zaurus family. An initial guide on how to get to the “cylon screen” with the moving red dot was posted on the Android Developers group.

With using information from the above work, I was able to run Android on a Sharp Zaurus SL-C760.

Here comes the outline of the process:

  1. Build or download a console image for the SL-C760 from the Angstrom Distribution.
  2. Build a patched kernel for Android. I used the android.diff from Benno to patch the linux-rp-2.6.23 kernel of the Angstrom distribution. I had to do some minor tweaks in the patch to apply cleanly: I removed some Goldfish device specific parts. In the kernel configuration enable all Android specific options except the USB gadget and the QEMU / debug options.
  3. Flash the console image and the patched kernel onto the device.
  4. Extract the contents of the /data and the /system drives from the emulator using Busybox tar. Benno provides a busybox compiled for the emulator here. Make sure you get the device files as well.
  5. Extract the ramdisk image of the emulator using gzip and cpio.
  6. Build a directory tree of the Andoid software which mimics the emulator layout. Make sure to preserve the file ownerships and permissions from the tar archives.
  7. Share this directory over NFS
  8. Connect your Zaurus to your host PC either with usbnet or wlan.
  9. Mount the NFS share on your Zaurus to /android
  10. Copy the /dev/binder to /android/dev/binder. This was necessary because in the emulator the binder device had major number 252 while in the Zaurus it had 253. Make sure that the binder device has the mode 666.
  11. Create a small script on your Zaurus as /android/a.sh with the following contents:
    #!/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
    
  12. Create a small script on your Zaurus as /bin/a.sh with the following contents:
    #!/bin/sh
    umask 000
    chroot /android /a.sh
    
  13. Execute /bin/a.sh as root on your Zaurus and hope for the best

Current status:

  • The system boots and the applications seem to work.
  • Runs from an NFS share over a network connection.
  • Keyboard input is working.
  • Touchscreen is not working.
  • No network connection yet for Android applications.

Next steps:

  • Get the touchscreen to work.
  • Set up networking.
  • Make it work from the flash file system as well. (JFFS2 does not support read-write memory mapped files, so we will need to use Yaffs, just like Google does.)

Have fun, and leave a comment, if you get further along in the process!


Trackback URL

http://euedge.com/blog/2007/12/06/google-android-runs-on-sharp-zaurus-sl-c760/trackback

71 Responses to “Google Android runs on Sharp Zaurus SL-C760”

  • Good stuff :)

    By dH on Dec 6, 2007

  • Coooooool

    By Stanislav O. Pogrebnyak on Dec 6, 2007

  • You guys are great!!! Is the android stack fully integrated? BT, Audio/Video etc?

    Regards,

    Steffen

    By mcahornsirup on Dec 7, 2007

  • Steffen,

    As you can see in at the end of the post, some features don’t work yet. The Zaurus doesn’t have a Bluetooth interface, so we don’t really know about that. We have a Buffalo CF WiFi card for it, but it hasn’t yet been recognized by Android. It also has a touch screen, but it doesn’t see it as a mouse yet.

    So there are a lot of things to finish - but at least the first step is done - Android fires up :)

    Akos

    By maroy on Dec 7, 2007

  • Hi,

    This is really getting exciting and I would like to congratulate you guys on this effort. I have a Zaurus SL-C750 and am trying to replicate your steps. I am not an expert but would like to try this out.

    I got the Angstrom console image and android.diff as mentioned in point 1 above.

    I would like to get help and/or more details on how and on which device do I do the following:

    2. Build a patched kernel for Android. I used the android.diff from Benno to patch the linux-rp-2.6.23 kernel of the Angstrom distribution. I had to do some minor tweaks in the patch to apply cleanly: I removed some Goldfish device specific parts. In the kernel configuration enable all Android specific options except the USB gadget and the QEMU / debug options.

    I believe I need to do this on a Linux box before moving things over to the Zaurus.

    Any help will be appreciated. Which kernel source do I use for patching android.diff ? Where do I do a “make” for compiling my own patched kernel ? Does it need to be cross-compiled for ARM ?

    I will appreciate any help/steps for the same. Is there an IRC group where I can get some live help for this ?

    After I get through the steps outlined above, I can assist in getting Networking up and running.

    Thanks in advance,

    Regards
    Nishi

    By Nishi on Dec 11, 2007

  • > Build a patched kernel for Android. I used the
    > android.diff from Benno to patch the
    > linux-rp-2.6.23 kernel of the Angstrom
    > distribution.

    I’ve looked into Angstrom tree, but couldn’t find linux-rp-2.6.23 tar ball. It would be very appreciated if you could point out where I can find the tar ball.

    -OR- I’m wondering, by any chance, you mixed up with Open Embedded distribution?

    By mizmit on Dec 13, 2007

  • HI Gergely and Mizmit,

    I was told on irc.freenode.net, channel angstrom and android that Angstrom builds are based on openembedded.com. I have followed the steps listed in the “Building Angstrom” page but still can’t see where I can get the linux-rp-2.6.23 kernel source to patch “android.diff”. I will appreciate if you can assist in any way.

    Thanks

    Regards
    Nishi

    By Nishi on Dec 16, 2007

  • Hi,

    The Angstrom Distribution is based on OpenEmbedded. However, I couldn’t find the kernel sources for linux-rp-2.6.23 in the OpenEmbedded tree.

    Please let us know where to locate the sources so that we patch it with android.diff.

    Thanks in advance,

    Regards
    Nishi

    By Nishi on Dec 16, 2007

  • Well, I spent my spare time to explore Open Embedded and found how to get linux-rp source tree, I guess.

    1) Build bitbake environment as described in Open Embedded.

    2) Edit SRC_URI line in linux-rp_2.6.23.bb from http://www.kernel.org to http://www.angstrom-distribution.org. The reason why this modification is there’s no linux-2.6.23.tar.bz2 file in kernel.org tree anymore. All the tar balls got each sub-version.

    3) bitbake -b /path/to/linux-rp_2.6.23.bb and you will get an oe_256sha error.

    4) Add sha256 key for linux-2.6.23.tar.bz2 in checksums.ini. You can just copy and paste the value which you get along with the build error.

    5) Retry 3) and hope the best.

    I still don’t get arm toolchain successfully, so that’s what I got today so far. I got the linux-rp-2.6.23-r10 tree under tmp/work/spitz-angstrom-linux-gnueabi.

    Cheers,

    By mizmit on Dec 18, 2007

  • Dear Mizmit and Nishi,

    I am sorry that it took so long to answer. I simply used OpenEmbedded to build the angstrom images. Then I added the android.diff to the packages/linux/linux-rp-2.6.23 directory, and added a reference to it in the linux-rp_2.6.23.bb file. I also had to change the kernel configuration: I interrupted the kernel compilation, and ran make menuconfig manually. I enabled all android specific options except for QEMU specific (e.g. RAM console) options. Then I saved the resulting .config file as defconfig-c7×0 in the packages/linux/linux-rp-2.6.23 directory and used “bitbake -c rebuild” on linux-rp, As a final step I rebuilt the console image to include the just built kernel modules.

    I hope this helps,
    Gergely

    By gergely on Dec 18, 2007

  • HI Mizmit and Gergely,

    Thank you for your email. I’ve also been toying with OE and bitbake over the last 24 hours trying to get the environment to build me a base Angstrom image, before playing with android. However, I have been having issues with compilation when I issue bitbake gpe-image.

    My errors can be seen at : http://pastebin.ca/822813

    I will continue to play with this today and get back to you. In the meanwhile, if the errors I am seeing seem easy to fix and you know of the fix, I will appreciate if you can let me know what the fix is.

    Thanks a bunch for your email. I can be reached at nishin at hotmail dot com directly.

    Gergely, can you please send us your linux-rp-2.6.23.bb file or the line that you added android.diff to ?

    Thanks in advance,

    Regards
    Nishi

    By Nishi on Dec 19, 2007

  • good job! I would try my c1000.

    By encodeco on Dec 20, 2007

  • Dear Gergely and Nishi,

    Gergely,
    Thank you very much for your advice. Now I’m bitbaking console-image with android.dff patch. I’ll try to run it on my Zaurus this weekend.

    Regarding network access from Android applet, would you look into /etc/network/interfaces? If you find usb0 as a gateway, just delete the line. It might be the reason why you can’t connect to the net from Android applet.

    Nishi,
    I’m working on Spitz (C3000) and my not your case though, I would suggest to try;
    $ bitbake task-sdk
    $ bitbake console-image
    Bitbaking task-sdk takes very veeeerrrry long. But it builds whole toolchain nicely in my case.

    Regards,

    By mizmit on Dec 21, 2007

  • Dear Gergely,

    Somebody done it. ;-)

    Android Zaurus: Google Android runs on Sharp Zaurus SL-C3000
    http://androidzaurus.seesaa.net/article/74237419.html

    By mizmit on Dec 23, 2007

  • 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/

    By kapare on Jan 9, 2008

  • This article speak by it self:

    http://www.engadget.com/2008/01/09/android-hacked-to-run-on-real-hardware/

    By kapare on Jan 10, 2008

  • Hi

    Will this work on a Sharp Zaurus SL-C1000 as well?

    By Dani on Jan 11, 2008

  • Guys at the OpenEmbedded Software Foundation (OESF) created an installable image that can be used to flash a Zaurus SL-C3×00:

    http://www.oesf.org/forum/index.php?showtopic=25292

    Respect!

    By maroy on Jan 12, 2008

  • Hello, Yah has found many links to those question and has published it in a Spot.
    http://www.jamespot.com/s/344-Google-Android.html

    By Alan on Jan 12, 2008

  • Nagyon várom én is !

    By számítógép on Jan 14, 2008

  • Dear Gergely,

    I was able to port Android on my ARM9 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 ?

    Regards
    –HAbdul

    By HAbdul on Jan 15, 2008

  • Is that possible to lunch Android on Nokia smartphones?

    …I mean, someone tried to work it out?

    By david2tm on Jan 19, 2008

  • Hello Gergely,

    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) = 0×41402000
    00:03:14.210612 brk(0×13000) = 0×13000
    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(\375\252k(\253k\20008\253k
    00:03:14.280527 lseek(8, 7056168, SEEK_SET) = 7056168
    00:03:14.280702 read(8, “6gk7t\355\346\230\v”, 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”, 9}, {”mmap(7252804, R, FILE
    00:03:14.321732 writev(3, [{”\6″, 1}, {”dalvikvm”, 9}, {”Unable to map file\n\
    00:03:14.321060 writev(3, [{”\4″, 1}, {”dalvikvm”, 9}, {”Unable to map classes
    ————————————–

    Did you face such a problem ? Any clues ?

    –Joey

    By Joey on Jan 22, 2008

  • Possible start android on motorola E2?
    We lead development connected with improvement this linux platforms, but Motorola too reduced her(its) possibility so we entrust greater hopes on android.

    p.s. Excuse me for my english.

    By INEDI on Jan 28, 2008

  • hmm late to the peice, but does this mean it could be installed on the current windows mobile type devices ? (htc tytn or tytn II, etc)

    By Terry on Jan 30, 2008

  • Check out the video demonstrations of Google Android running on the Sharp Zaurus!

    By phraktle on Feb 4, 2008

  • What kind of cell phone support google android??? Wheter google android faster in browsing and download???

    By gOOGLE aNDROID on Apr 1, 2008

  • Does google android safe???

    By gOOGLE aNDROID on Apr 1, 2008

43 Trackback(s)

Post a Comment