NetWalker x Eclair - Bootable Image

Though few will be interested in, here is a binary set of Android 2.0 (Eclair) system for NetWalker (Sharp PC-Z1)
o http://drop.io/eclairwalker091217/
and followed by How-To. A patch set is available on my github but they are for donut. I'll make Eclair version available some time later.

1) Recovery SD
In a terminal on NetWalker, run following commands to create a bootable SD card using recovery system image.
$ wget http://mit.sharp.co.jp/os.tar.bz2
$ sudo umount /media/disk
$ sudo fdisk /dev/mmcblk0
-> claim at least 2GB for Linux
$ sudo mkfs.ext3 /dev/mmcblk0p1
$ sudo mount -t ext3 /dev/mmcblk0p1 /mnt
$ sudo tar jxvpf os.tar.bz2 -C /mnt && sync
$ sudo mv /mnt/etc/rc2.d/S01upfirm /mnt/etc/rc2.d/~S01upfirm

2) Copy Eclair system files and kernel
Continue to install Eclair and kernel. First download eclairwalker.tar.gz from http://drop.io/eclairwalker091217/ with Firefox on NetWalker.
o size 32,115,123
o md5sum df72d1f48e3d15c4ac93df9a20fb5adf
$ mkdir -p /mnt/android/eclair
$ cd /mnt/android
$ tar zxvpf ~/Desktop/eclairwalker.tar.gz
$ sudo mv /mnt/boot/boot.conf /mnt/boot/recovery.boot.conf
$ sudo cp zImage boot.conf /mnt/boot
$ tar zxvpf eclair.tar.gz -C eclair
$ sudo mkdir -p /mnt/lib/modules/
$ sudo tar zxvpf ko.tar.gz -C /mnt/lib/modules/
$ sync
$ sudo poweroff

3) Boot Android
Booting from SD is a bit tricky.
1) Press and hold both mouse buttons next to the power switch.
2) Press the power switch and hold for a few seconds.
3) Keep pressing both mouse buttons until Tux the Penguin shows up.
4) Login as root without password.

You can play with a console. First thing to do is depmod.
# depmod -a

Now is the time to boot Android by a familliar chroot commnad.
# chroot /android/eclair /init &

4) Tips
Key assignment.
FunctionKey Assign
OKF5, Mouse Left
MenuF1, Home Icon
BackESC, Back Space, Mouse Right
EndF4, Star Icon

Don't forget to change screen off timeout in Settings otherwise you end up loosing control in a few seconds. I'll recommend also set end key behavior to "Go Home" with Spare Parts.

To shutdown, press and hold F4 until a shutdown dialog comes up, then hit F5 twice.

5) Known issues
A lot of kown issues like,
No WiFi.
No Sound.
No SD storage.

Just a proof of concept, as usual. Any contributions are always welcome.

posted by 安藤恐竜 at 17:19 | Comment(4) | TrackBack(0) | 日記


Android on NetWalker


I've ported Android on to NetWalker, sort of. Required patch files can be downloaded from my github.

This port is still very preliminary and unstable. Current status is just a proof of concept.

NetWalker has a good boot loader that allows us boot from SD card. You can create your own roof file system by following steps.

1) Download os.tar.bz2 and zImage from http://mit.sharp.co.jp/
2) Unzip os.tar.bz2 to SD card formatted as ext2
3) Copy zImage to boot/ directory on SD card
4) Edit boot.conf in boot/ directory
    - add console=tty1
    - remove quiet
5) Power off
6) While pressing [Left] and [Right], press [Power]
7) Keep pressing [Left] and [Right] until kernel boot message printed.

Now you have a root console. Kernel can be replaced by just changing /boot/zImage. Kernel command options are configurable by /boot/boot.conf. What a heaven.

To boot Android on NetWalker, follow the instructions in README and build kernel and Android system. Then copy zImage to boot/ and Android system to SD card. Now the time to do a familiar chroot to Android system directory.

posted by 安藤恐竜 at 20:09 | Comment(1) | TrackBack(1) | 日記


Sharp NetWalker PC-Z1

I'm really impressed by the news that Sharp comes back to Linux PDA market.

o Sharp NetWalker PC-Z1 MID lands in Japan next month

As far as I know, PC-Z1 will be a very first product which uses ARM Ubuntu for consumer market. And I have no doubt that it will be a good gadget to host Android.

But PC-Z1 reminds me HP200LX a lot more. fbterm + (emacs -nw | screen) with w3m for 10 hours could be a can't-live-without-gadget.

Anyway, I'm lucky living in Japan to have a chance to enjoy NetWalker first place. And welcome back, Sharp!
posted by 安藤恐竜 at 22:02 | Comment(0) | TrackBack(0) | 日記


Android Screen Monitor

Android Screen Monitor is a must-have application for Android developers.

o http://www.adakoda.com/adakoda/android/asm/

ASM transfers continuously screen captures from an attached Android device to your PC. It is very useful when you make a presentation using PC, projector and of course your Android device.

Because ASM leverages adbd functions, you may experience "lost connection" issue once in a while. If it happens, give an "adb kill-server" - "adb start-server" cycle as usual.

A tip for installation. If you don't set PATH to Android SDK, copy the ASM to sdk/tools directory.

Anyway, a big thank you to adakoda san for sharing this amazing software!

posted by 安藤恐竜 at 10:42 | Comment(0) | TrackBack(0) | 日記


Android 1.5 on Zaurus

In Android source code repository, cupcake (Android 1.5) has been merged to master branch. Current implementation of SystemServer.java throws exceptions and Android doesn't boot up properly.

Quick hack. Let the system thinks battery is healthy. Here's my patch.


posted by 安藤恐竜 at 10:32 | Comment(11) | TrackBack(0) | 日記


Bootchart on Android

I tried bootchart to see how Android boots up and how long each process takes.

First, rebuild /init with bootchart enabled.
$ cd mydroid
$ export INIT_BOOTCHART=true
$ make clean
$ make

Copy it to Zaurus and setup environment as written in README.BOOTCHART in system/core/init.
$ scp out/target/product/generic/root/init root@zaurus:~/android-root/
$ ssh root@zaurus
# echo 1 > android-root/data/bootchart
# echo 5 > android-root/data/bootchart-stop

Make android-root/tmp directory and boot Android up.
# mkdir android-root/tmp
# chmod 777 android-root/tmp
# chroot android-root /init

After shutting Android down, copy grab-bootchart.sh to the same directory as the adb tool.
$ cp mydroid/system/core/init/grab-bootchart.sh mydroid/out/host/linux-x86/bin
$ cd mydroid/out/host/linux-x86/bin

In grab-bootchart.sh, adb is executed without path and I don't set PATH to adb, so simply modify the scrpit from "adb pull" to "./adb pull".

Boot Android up on Zaurus again, then run the script on the host PC.
$ export ADBHOST=zaurus
$ ./adb kill-server
$ ./adb start-server
$ sudo ./grab-bootchart.sh

On Ubuntu 8.04, the visualizer can be installed by apt-get.
$ sudo apt-get install bootchart
$ java -jar /usr/share/bootchart/bootchart.jar ./bootchart.tgz

The result, bootchart.png, looks like this.
posted by 安藤恐竜 at 09:43 | Comment(0) | TrackBack(0) | 日記


Porting Open Source Android to Zaurus

Big congratulations to Android team and even bigger thanks to make things happen.

o Android is now Open Source

There is only one final touch left for my project.

I built Android framework from scratch as described in source.android.com and bring the image to my Zaurus. It works as expected with one exception.

I received SEGV everytime I type something on the keyboard. It is resolved by copy keyboard configuration files and change permission.
# cd android-root/system/usr/keylayout
# cp qwerty.kl Spitz_Keyboard.kl
# chmod 666 *
# cd ../keychars
# cp qwerty.kcm.bin Spitz_Keyboard.kcm.bin
# chmod 666 *

By the way, T-Mobile G1 is unleashed with debuggerd enabled. It means you can debug your application running on G1. It is really sweet.
o Developing on Device Hardware - code.google.com

I assume debugging over WLAN also works. If you have G1, this is worth to try, I guess.

From your PC installed Android SDK 1.0,
$ export ADBHOST="G1 IP address connected through WLAN"
$ ./adb kill-server
$ ./adb start-server
$ ./adb devices
$ ./adb shell
If it successfully gives you a console, now Eclipse environment should be able to talk to your phone.

posted by 安藤恐竜 at 17:14 | Comment(3) | TrackBack(0) | 日記


KeycodeChecker.apk for Android 1.0

Finally, Android 1.0 SDK has been released. The kernel is exactly same as Android 0.9. Just poring system image into my Zaurus, Android 1.0 works fine.

I rebuild KeycodeChecker on 1.0 SDK.
o KeycodeChecker-1.0-r1.zip

Just in case, if anyone is looking for keylayout file working on Zaurus, here is the one.
o qwerty.kl.zip

One issue currently I'm working on. Landscape view and portrait view issue. Until SDK m5, Zaurus booted up in portrait view which is hardware buffer aligned. But with Android 0.9 and 1.0, Zaurus boots in landscape view. It has huge impact to performance. I used to run my RotateView.apk to make adjustment, but the APIs RotateView uses have gone. I'm looking for alternative API but still can not find.

posted by 安藤恐竜 at 09:22 | Comment(7) | TrackBack(0) | 日記


V8 on Angstrom Zaurus

Chrome shines! V8 rocks!

I've been using Chrome since release and love more and more. Chrome is maximized on my desktop all the time and I'm crusing the Net with shortcut keys.

Chrome on Android is rumored. And amazingly V8 the Javascript engine is already ported to ARM. I couldn't wait for Android Chrome, so tried to build V8 for Zaurus.

First of all, grab the source code.
svn checkout http://v8.googlecode.com/svn/trunk/ v8
I tried to cross compile by modifing scons scripts, but no luck. Next I tried to port scons itself to Angstrom but so many problems, then forgot about it.

Quick dirty hack. Batch build, I tried.

First dry run scons on PC to generate script file.
$ scons -nQ toolchain=gcc arch=arm library=static os=linux sample=shell > build.sh  2>&1
Copy it and add #!/bin/sh at the fist line, add executable permission and fire it.
# ./build.sh
src/macro-assembler-arm.cc:66:2: error: #error "for thumb inter-working we require architecture v5t or above"
It looks V8 is really ported to ARM. It is promissing. I modified build.sh adding;
-march=armv5te -mtune=xscale
to tell compile generate Armv5t binary. There is a little patch required to compile platform-linux.cc
diff -ur --exclude .o v8/src/platform-linux.cc v8-work/src/platform-linux.cc
--- v8/src/platform-linux.cc 2008-09-03 11:42:30.000000000 +0900
+++ v8y-work/src/platform-linux.cc 2008-09-07 11:02:35.226762251 +0900
@@ -567,8 +567,10 @@
ucontext_t* ucontext = reinterpret_cast(context);
mcontext_t& mcontext = ucontext->uc_mcontext;
#if defined (__arm__) || defined(__thumb__)
- sample.pc = mcontext.gregs[R15];
- sample.sp = mcontext.gregs[R13];
+ // sample.pc = mcontext.gregs[R15];
+ // sample.sp = mcontext.gregs[R13];
+ sample.pc = mcontext.arm_pc;
+ sample.sp = mcontext.arm_sp;
sample.pc = mcontext.gregs[REG_EIP];
sample.sp = mcontext.gregs[REG_ESP];
Another and final touch to build.sh is required to avoid JS2C script. Commnet out JS2C line and copy libraries.cc from PC. I guess this libraries.cc is platform independent, so just scons on PC and pull obj/relrease/libraries.cc to Zaurus.

Finally I got libv8.a and shell program
# file shell
shell: ELF 32-bit LSB executable, ARM, version 1 (SYSV), for GNU/Linux 2.6.14,
dynamically linked (uses shared libs), not stripped

# ./shell
V8 version 0.3.0
> for (var n in function() { return this } () ) print(n)
> quit()
I tried to run benchmark script in source tree but the program dies in out of memory.
~/work/v8/benchmarks# ../shell run.js 

# Fatal error in CALL_HEAP_FUNCTION
# Allocation failed - process out of memory


Conclusion. V8 does run on ARM. V8 on Android will be possible once source code becomes available.


posted by 安藤恐竜 at 17:18 | Comment(1) | TrackBack(0) | 日記


double buffer patch of pxafb for linux-2.6.26

The latest Angstrom development environment gives me a nice linux 2.6.26 kernel but there is a drawback. The frame buffer driver degrades a bit. Overlay function and higher color depth support is gone.

The source code of frame buffer driver in 2.6.23 version can not be compiled against 2.6.26 environment.

Based on the same strategy as 2.6.23 version, I wrote a small patch to handle double buffering and pan function for 2.6.26 version. Following is the patch file which is working fine for me.

o pxafb_doublebuffer.patch.bz2

The touchscreen driver is not working satisfactorily. Once I manage to make it work, I'll upload a pactch on this blog.

posted by 安藤恐竜 at 09:41 | Comment(5) | TrackBack(0) | 日記


Network is up - Android 0.9 SDK beta

I checked system propertis in the emulator.
$ ./emulator &
$ ./adb shell
# getprop
There is a new property [net.dns1] and [net.dns2].

net.dns1 sounds very interesting, so I modified android-root/default.prop, adding;
OK. Network is up. Now I can browse the Internet and see Street View with Map application.

posted by 安藤恐竜 at 11:46 | Comment(2) | TrackBack(0) | 日記


Android 0.9 SDK beta - Up on Zaurus

Android Rocks! Zaurus Rules!

Android 0.9 SDK beta now runs on my Zaurus C-3000.

Booting... Hello, Goodie.

Home Screen. A nice big clock.

Applications. I want more apps.

Tips for porting.
o Get kernel tar ball from http://code.google.com/p/android/downloads/list
o Look into mm/ashmem.c and drivers/android.
o Port ashmem and drivers/android to your platform. My case, linux-2.6.26 which the latest Angstrom uses.
o Double buffering and pan functions for frame buffer driver is now mandatory.

Things not working yet.
o Network. Where should I put net.eth0.dns1?
o Touchscreen. It works very poor.
o Keyboard configuration. Mostly same as good old qwerty.kl but not ported yet.
o Sound. Haven't check it.

Anyway. So far, so good.


posted by 安藤恐竜 at 21:54 | Comment(4) | TrackBack(0) | 日記


Android 0.9 SDK beta

Long awaited Android SDK was finally released as 0.9 beta.

o http://code.google.com/android/index.html

I have tried to boot it up on my Zaurus. No luck yet. /init dies with a segmentation fault. Maybe I need to port some drivers from the latest Android kernel.

o http://code.google.com/p/android/downloads/list

Here is my first impression of the emulator.
  • Copy and Paste. Huge advantage to iPhone, for now.
  • WebView works much better than m5.
  • Street View rocks!
  • Conference call function. Android becomes a cutting edge phone.
  • Science Calculator.
A little tip how to get boot log of the emulator.
$ ./emulator &
$ ./adb shell
# mount -o remount,rw rootfs /
# mkdir /tmp
# /system/bin/dumpstate
# exit
$ ./adb pull /tmp/state state.log
$ more state.log
Since rootfs is mounted as read only, you need to remount it after booted the emulator.

posted by 安藤恐竜 at 10:12 | Comment(29) | TrackBack(0) | 日記


Current kernel image and cumulative patch

Following is an Angstrom image which is working on my Zaurus C3000.
o Angstrom-console-image-glibc-ipk-2007.11RC1-spitz-installkit.tgz

My case, lowmemorykiller is built as a module.
o lowmemorykiller.ko.bz2

I will not answer any questions about these binary files. AT YOUR OWN RISK, PLEASE.

Here is a patch file which can be applied to vanilla 2.6.23 kernel source tree. This is cumulative, including all Angstrom patches, Android patches as well as frame buffer, touch panel and so on.
o diff-linux-2.6.23-vanilla-androidzaurus.patch.bz2

Please note that redistributing Android SDK m5 is prohibited by the licence.
posted by 安藤恐竜 at 16:56 | Comment(1) | TrackBack(0) | 日記


A patch for sound driver

Brilliant Service, who ported Android to Armadillo-500, released a patch of sound driver.
o Enabling audio on Android (Japanese)
o android-sound-patch.tar.gz

I have applied this patch to Angstrom kernel source. It works beautifully on Zaurus, too. Because Android uses /dev/eac as sound device, make a symbolic link;
$ ln -s /dev/dsp /dev/eac
If your Android is booted up by chroot, remeber to make symlink in android-root/dev, too.

Brilliant Service mentioned that this patch was originally written by Atmark Techno who is the developer of Armdallio. Big thanks to Atmark Techno.

posted by 安藤恐竜 at 17:57 | Comment(2) | TrackBack(0) | 日記


Keycode Checker for Andorid

I found myself a bit of spare time last week, so I wrote a tiny utility to check the keycode and scancode on Android.

o KeycodeChecker.zip

As usual, copy the KeycodeChecker.apk in bin folder to data/app in android-root.

After launching KeycodeChecker, every time you type some key in, it show;
- key: keycode which Android uses internally.
- scan: scancode which is passed to Android from hardware driver.
- modify: true or false whether the key is modifier key or not.
- name: key name which is defined in android.view.KeyEvent as static final.

If you type [space key], [enter key] or [backspace key], the list will be refreshed.

posted by 安藤恐竜 at 09:36 | Comment(0) | TrackBack(0) | 日記



Something interesting I found a few days ago.
$ ./emulator &
$ ./adb shell
# cd /data/data/com.google.android.providers.telephony/databases
# sqlite3 telephony.db
sqlite> .schema
CREATE TABLE android_metadata (locale TEXT);
mcc TEXT,mnc TEXT,apn TEXT,user TEXT,server TEXT,password TEXT,
proxy TEXT,port TEXT,mmsproxy TEXT,mmsport TEXT,
mmsc TEXT,current INTEGER);

sqlite> .dump carriers
mcc TEXT,mnc TEXT,apn TEXT,user TEXT,server TEXT,password TEXT,
proxy TEXT,port TEXT,mmsproxy TEXT,mmsport TEXT,
mmsc TEXT,current INTEGER);

INSERT INTO "carriers" VALUES(1,'T-Mobile US','310260',
INSERT INTO "carriers" VALUES(26,'Android','31099',

It seems to me that this telephony.db file contains APN information which will be required to connect Internet through PPP.

Following is a complete list of carriers contained in telephony.db.
  • T-Mobile US
  • T-Mobile UK
  • T-Mobile D
  • T-Mobile A
  • T-Mobile CZ
  • T-Mobile NL
  • Cingular 410
  • Cingular 170 Pacific Bell
  • Cingular 380 ATT
  • Chunghwa
  • Far EasTone
  • KGT-Online
  • India Hutch
  • SFR
  • Vodafone UK
  • IL Orange
  • IL Cellcom
  • IL Pelephone
  • Jawwal Palestine
  • Swisscom GPRS
  • ERA
  • CMCC
  • Android
  • Android

posted by 安藤恐竜 at 15:09 | Comment(0) | TrackBack(0) | 日記


AT Commands

I found an emulator log of AT commands issued by Android to 3G module (well, for now it's a virtual device).

The log file can be created by following procedure.
$ cd /your/android/sdk//tools
$ ./emulator &
(wait for booting emulator up)
$ ./ddms
In the ddms menu, click [Device], then [Dump device state]. AT commands can be found in RADIO LOG section. I only checked Linux version of SDK. If other SDK doesn't have ddms, alternatively the log can be dumped by command line.
$ ./adb shell /system/bin/dumpstate
$ ./adb pull /tmp/state state.txt
Most of the AT commands match 3GPP specification. Some SMS related commands seem to be GSM based. 3GPP specification is available at a following page.

o 3GPP TS 27.007 AT command set for User Equipment (UE)

Initialization and PPP
+COPS=3,0; +COPS=3,1; +COPS=3,2; +COPS?
Outgoing Voice Call
Incoming Call

posted by 安藤恐竜 at 13:26 | Comment(0) | TrackBack(0) | 日記


Touchscreen works!

A reader of this blog, Rebecca, who worked really hard to port Android on to her C760 found out what the touchscreen issue was and sent me a patch for corgi_ts.c! Thank you very much, Rebecca! Following is a part of mail and patch.
I wrote an applet to detect touch events, and found that the Dalvik VM only received "move" events. There was no action of touch pen up detected. So I modified the corgi-ts driver and added codes in function "ts_interrupt_main()".

@@ -215,6 +220,10 @@
/* Enable Falling Edge */
set_irq_type(corgi_ts->irq_gpio, IRQT_FALLING);
corgi_ts->pendown = 0;
+ /* 2008(R) */
+ input_report_key(corgi_ts->input, BTN_TOUCH, corgi_ts->pendown);
+ input_sync(corgi_ts->input);

This patch works on my C3000, too. Now touchscreen works all the time. Fortunately, I don't need much calibrations for now.

It seems Android wants to know not only pressure becomes zero but also pendown becomes zero. Only two lines but very precious lines.

Again, thank you very much, Rebecca! Your contribution is just great!
posted by 安藤恐竜 at 17:40 | Comment(13) | TrackBack(1) | 日記


Kubench - 3D benchmark application

Kubench is a sample application to measure 3D performance of Android. Download the following file and unpack, then copy bin/Kubench.apk to data/app in android-root, as usual.

o Kubench.tar.gz

After launching Kubench from Home, rotating cube will be shown. By pressing any key, frame rate will be displayed on the window title.

My C3000 runs at around 20fps. The emulator running on ThinkPad X61 (Core2Duo 2.2GHz, Windows Vista) gives me around 22fps. My Linux PC (Athlon 3500+, Ubuntu) shows only 4fps somehow. I haven't resolve this Linux issue yet.

Frame rate is calculated by counting frames drawn in every 3 seconds. It would be not correct way to measure 3D performance, strictly saying. But I guess it would be sufficient practically.

I'd like to write some background of Kubench.

A few weeks ago, Google Japan hold a developer meeting called Android Hackathon. I was luckily able to attend it and had a very interesting discussion with people there.

One of the themes was benchmarking. Once Android handsets go on to the market, performance may very by handset. Some application developers, like 3D game software, worry about how performance could be guranteed for each handset. Too many handsets to be tested. It will be another nightmare for application developers.

Benchmarking may be a solution. Like a Windows Experience score on Vista.

Possible benchmarking item would be;
o Floating point calculation
o 2D
o 3D
o Network throughput
o SQLite
o File I/O

At Android Hackathon, I tried to modify Kube in Api Demo to measure 3D framerate, but I couldn't finish on that day. Today is a holiday in Japan and I try again to implement it.

posted by 安藤恐竜 at 18:16 | Comment(9) | TrackBack(0) | 日記




・マイブログの【設定】 > 【広告設定】 より、「60日間更新が無い場合」 の 「広告を表示しない」にチェックを入れて保存する。