12/30/2007

setconsole and tty1

setconsole -v 1 command in android shell switches the display from Android GUI to a text console. But the text console on Zaurus couldn't work correctly because android-root/init wants /dev/tty1 which is already taken by Linux console.

A dirty work around. Change the Linux console to /dev/tty2. Edit the last line of /etc/inittab;
1:2345::/sbin/getty 38400 tty1
2:2345:respawn:/sbin/getty 38400 tty2
Then reboot and ./start-android.sh.

console.png

Pressing [Fn] and cursor at the same time switches the display between Android GUI and the text console. In the text console, Android shell commands like getprop, setprop, service call and mem_profiler can be executed.

In emulator environment, these commands can be run by adb shell.
posted by 安藤恐竜 at 23:50 | Comment(0) | TrackBack(0) | 日記

Screenshots of Android Zaurus

I was such an idiot I haven't thought of taking some screenshots, before crying for a digital camera.

ipkg install fbgrab, then take some shots.

Booting up from either Zaurus console or ssh. My script is ./start-android.sh.

startshell.png

Booting up. The famous red cylon.
start.png

Home. View mode can be changed by service call window 18 i32 1 command. Change 1 to 0 for portrait. 2 and 3 can be tried. Make the view upside-down, left-right flipped.
home.png    home-l.png

Browser. Japanese Kanji. Note that the menu is beautifully alpha brended.
brawser2.png

Zoom. And zoom in more.
brawser3.png    brawser4.png

Google Map. Satellite and Traffic.
gmap2.png    gmap3.png

Application.
app.png

OpenGL. Rotating.
opengl2.png    opengl.png

Demo of twitter on Andriod, written by Adamrocker. Unzip the androitter.zip and copy apk to android-root/data/app.
androitter1.png    androitter2.png    androitter3.png    androitter4.png
I'm happy that I can confirm applets buit by Eclipse really run on a hardware. And not only the browser but also applets can display Japanese Kaji.

But... Fonts are too small to read. It could be much better if the applet has zoom function.

Touch pannel doesn't work yet. And I want Japanese input method. I wonder there is Java version uim. If so, wrap it up as Android service, I guess.
I forgot to mention the alarm function. If the kernel configured as ANDROID_POWER = y with patching android.diff, alarm applet works fine. /dev/alarm is the device file of it.

Alarm in API Demos. 15 seconds message comes up every 30 seconds. The alarm message comes up even running another applet.
alarm1.png    alarm2.png    alarm3.png
posted by 安藤恐竜 at 18:52 | Comment(2) | TrackBack(1) | 日記

さらに簡単Android Zaurus

オランダのcortezさんが、Pokyベースで
Android化済みのインストールイメージ
を作ったそうで。cortezさんはC-3100で試してるそーで。

SDカードにコピーしてZaurusに刺し、リセットボタンを押してから、OKを押しつつ電源オン。アップデートするだけでAndroid Zaurus。

rootでログインして、/startで起動。こんにちわこんにちわ。

android-root/initでAndroidを動かしてないので、DNSが引けないかも。android-root/startのスクリプで、zygote, dbus, runtimeの代わりに、init一発にすればDNSが引けるようになる。あと、/etc/network/interfacesにやっぱりusb0 gatewayがあるので、それは削除。

タッチパネルが利かないのは仕様です。
posted by 安藤恐竜 at 12:48 | Comment(2) | TrackBack(0) | 日記

12/28/2007

ビルド済みバイナリでもAndroid Zaurus

Angstromがバイナリ配布しているconsole-imageでも、binderdev.koを入れるだけでAndroidの起動が出来ることがわかったので、binderdev.koを置いときますた。

ただし、アラームが動きません。powerドライバがモジュールでビルドできなかったので。API Demosにあるアラーム系は無理ぽ。

簡易手順

  1. Angstrom-console-imageをゲット
  2. 意を決してインストール
  3. 遊んでみつつ、sshの動作確認
  4. Android SDKを落としてきて母艦に入れる
  5. systemdataのイメージもゲット
  6. ramdisk.imgをcpioで展開し、systemとdataをtarで展開 → Google Android runs on Sharp Zaurus SL-C3000
  7. ごっそりtarで固めて、リナザウにコピーし、android-rootとかのディレクトに展開
  8. start-android.shを作成し、chmod 755 → Android Zaurus on a ready-made Angstrom image
  9. android-root/a.shを作成 → Network is up.
  10. DNSアドレスを設定 → A better way to bring network up.
  11. usb0のゲートウェイ設定を削除 → A better way to bring network up.
  12. binderをインストール → Android Zaurus on a ready-made Angstrom image
  13. # ./start-android.sh
  14. 画面の回転とキーコード → Portrait/Landscape and Keycode


お正月休みにでもいかが?
posted by 安藤恐竜 at 17:50 | Comment(1) | TrackBack(0) | 日記

Android Zaurus on a ready-made Angstrom image

Good news. I tried today to build binderdev.ko as a module and insmod it to ready-made Angstrom-console-image. Android works.

It makes a lot easier for people who wants just a look how it works.
1) Download Angstrom-console-image from Angstrom library.
2) Install it to Zaurus.
3) Download this binder-angstrom.tar.gz.
4) Unzip it and copy binderdev.ko to Zaurus.
$ tar zxvf binder-angstrom.tar.gz
$ cd binder-angstrom
$ scp binderdev.ko root@zaurus:/home/root
$ ssh root@zaurus
# cd /lib/modules/2.6.23/kernel/drivers/
# mkdir binder
# mv /home/root/binderdev.ko .
# depmod -a
# modprobe binderdev
# ls -l /dev/binder
crw-rw---- 1 root root 252, 0 Dec 28 06:10 /dev/binder
# cd /home/root/android-root/dev
# cp /dev/binder .
# chmod 666 binder

Now just jump to Android stuff in my previous entry.

Revised start-android.sh would be;
#!/bin/sh
modprobe binderdev
rm -f /home/root/android-root/tmp/*
umask 000
chroot /home/root/android-root /a.sh

There's a drawback. I couldn't build power.ko as a module. This power driver has built-in alram function which is bound to /dev/alarm.

Result is Alarm applet in API Demos doesn't work at all. Other alarm related applet won't work, I guess.
posted by 安藤恐竜 at 16:16 | Comment(0) | TrackBack(0) | 日記

12/27/2007

カーネル読書会とかAndroid Zaurusメモとか

YLUGが毎度おなじみさすらいのカーネル読書会をustream.tvするというので見てた。いいメソッドだと思う。ちゃんとプレゼン資料も読めるし、声も割りとクリアだし。時々エコーがきつくて2人の掛け合い漫才になっちゃってたけど。運営さん、乙でした。次回も中継していただけるとうれしい。

んで。チャットがニコニコ化しててワロタ。さぁ、いよいよ本編開始というところで、
さー、はじまるざますよ
ふんがー
まともにはじめなさいよ
が完成したところで吹いた。ごめん、みwikiの「いくでがんす」を飛ばしたのはアタイ。(*1)

途中、トラブルでustream.tvがoff airになっちゃったところで、
Nice boat.
Nice boat.
Nice boat.
Rubyistがヲタ属性っぅのがよくわかったwwwRubyかわいいよRubywww(*2)

それにしても。スゴ本さんの釘宮病カミングアウトとか、愛・蔵太さんのニコ厨カミングアウトとか。ニコニコな人が意外に多くて安心した。安心していいのか?メンテ長いな。今日は暇だ。他にすることないのか?

って。あれ?あっちのブログみたいなエントリになっちゃった。裏日記読むなよwww

さて。Android Zaurus。英語エントリが続いたので、軽く日本語でまとめ。
o ネットワーク使える。Google Map見られるようになった。
o 日本語表示OK。AppletからもOK。Browserを拡大表示にして見たら、フォントがキレイすぎて腰抜けた。さすが、Sharpのシステム液晶。
o αブレンディングも綺麗に表示される。さすが、Sharpのシステム液晶。
o キーレイアウトをちょっといじった。
o Portrait/Landscapeの切り替えOK。ただし、Landscape(横長)にすると描画が遅くなる。デフォがPortrait(縦長)になっているらしい。で、ソフトで回転しているため、激遅。
o タッチパネルは動いたり動かなかったり。安定しない。PC上のエミュレータでもマウスクリックが効かなかったりすることがあるので、何か根本的な問題があるかもしれない。



ところで。

ふんがーとかNice Boat.とかのネタがわからない人向けの蛇足。

(*1) さーはじまるざますよ云々は、らき☆すたのオープニング。オリジナルは怪物くんだから、一定以上の年齢には懐かしい部類か。


(*2) Nice boat.は、やはりアニメのスクールディズが、映像表現の問題で急遽放映中止となり、かわりに延々と航行する船の映像が流れ、それを見た海外オタクがとある掲示板で一言「Nice boat.」と書いたことから、大流行。





ついでに。Rubyの話。ついででいいのか?

ZaurusをAndroid化するプロジェクトを始めるまで、My Zaurusは英語ニュース記事をGoogle翻訳を使って機械翻訳して、とあるブログに投稿し続けるという仕事を、1年以上にわたって続けてました。その仕事を黙々と続けていたのは、Zaurus上で動作する自作Rubyスクリプトだったわけで。メモリリークもなく、トラブルもなく、1年以上にわたって安定して動き続けたRubyとZaurusに感動しますた。RubyかわいいよRuby。ZaurusかわいいよZaurus。
posted by 安藤恐竜 at 23:19 | Comment(0) | TrackBack(0) | 日記

12/26/2007

Portrait/Landscape and Keycode

To rotate from portrait view to landscape view, I found this hack in the Android Developers Group.
# service call window 18 i32 1


To make the keyboard work more nicely, I wrote a short applet to check key events. Scan codes of special keys are
    Keyboard 
    OK87
    Cancel62
    Menu88
    Home99
    Mail66
    Call59
    Fn61
    Space57
    Side Key 
    OK63
    Cancel64
    Up66
    Down65


I add following lines to andriod-root/system/usr/keylayout/qwerty.kl. Well, tentatively.
key 108 DPAD_LEFT
key 103 DPAD_RIGHT
key 105 DPAD_UP
key 106 DPAD_DOWN
key 87 DPAD_CENTER
key 62 BACK
key 88 SOFT_LEFT
key 99 HOME
key 68 ENVELOPE
key 59 EXPLORER
key 63 DPAD_CENTER
key 64 BACK
key 66 VOLUME_UP
key 65 VOLUME_DOWN
key 57 SPACE
key 61 FN


This is not perfect at all. The layout is English keyboard and my Android Zaurus has a Japanese keyboard. Also, Fn-markup does't work. May need to build android-root/system/usr/keychars/zaurus.kcm.bin. I don't know how yet, though.

Next thing is touch pannel. Sometimes it works. Next moment, it doesn't. Very unstable.
posted by 安藤恐竜 at 19:03 | Comment(1) | TrackBack(0) | 日記

A better way to bring network up.

Instead of typing in setprop command on Android Zaurus console, put the following line into android-root/etc/default.prop
net.eth0.dns1 = xx.yy.zz.qq

Where xx.yy.zz.qq is IP address of your DNS server, ovbiously.

By the way. Don't forget delete the gateway setting in usb0 interface in /etc/network/interfaces. I still don't get why Angstrom uses this tricky interface as a default gateway.
posted by 安藤恐竜 at 07:20 | Comment(0) | TrackBack(0) | 日記

12/25/2007

Network is up.

My Android Zaurus got network up! setprop/getprop works after android-root/init runs through. Modify android-root/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

/init &
/system/bin/sh


Then ssh to zaurus,
$ ssh root@zaurus
# rm -f android-root/tmp/*
# umask 000
# chroot /home/root/android-root /a.sh


After Android boots up, in the ssh console hit enter key, then issue setprop command.
\u@\h:\w\$ init: HOW ARE YOU GENTLEMEN
init: reading config file
init: device init

\u@\h:\w\$ setprop net.eth0.dns1 xx.yy.zz.qq

DEPRICATED by A better way to bring network up.

Hit [Enter] key of Android Zaurus keyboard, type somemthing in and hit [Enter] again. Google rules!

[Calendar] key (bottom-left key) works as [Menu] and [Cancel] key (next to the circle cursor key) works as cancel.

Have fun.
posted by 安藤恐竜 at 21:18 | Comment(1) | TrackBack(0) | 日記

12/24/2007

can't setprop net.eth0.dns1

Android applets on my Android Zaurus can't resolve DNS because DNS server address should be set with setprop command.
# /system/bin/setprop net.eth0.dns1 xx.yy.zz.qq

But... This command can not be issued in ssh console because Android runs on chrooted system tree.

So far I've tried;
o android-root/a.sh
o android-root/etc/default.prop
o android-root/data/local.prop
o android-root/etc/init.rc

None of these could set net.eth0.dns1 successfully yet. orz

Where should I look into?
posted by 安藤恐竜 at 10:41 | Comment(4) | TrackBack(0) | 日記

12/23/2007

リナザウでAndroidが動いた

下記事のとおり。動きました。ちょっと嬉しい。OpenGLの立方体くるくるもちゃんと動く。くるくる。UIも割りとサクサク動く。欲を言えば、もう少しキビキビ感が欲しい。やはり400MHzでは馬力不足。

まだ、Android appletからネットワークに出られない(Google Mapが見えなくて寂しい)とか、タッチパネルが使えないとか、まだヘロヘロなので、今後ぽちぽちと改善していきましょうかな。

まずはネットワークだなぁ。Androidが動いている間も、sshでアクセスできるので、/dev/eth0は生きているんだけど。chrootな影響なのは間違いなさそうだけど。

下記事は元情報のeu.edgeさんに敬意を表して英語だけど、コマンド全部載せたから日本語版いらないよね?
posted by 安藤恐竜 at 14:08 | Comment(4) | TrackBack(0) | 日記

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) | 日記

広告


この広告は60日以上更新がないブログに表示がされております。

以下のいずれかの方法で非表示にすることが可能です。

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