Building device driver for Angstrom

This post will be the last article of a serise about CodeSourcery's tool chain.

This time, device driver. Say, some gadget you have but Angstrom doesn't support it, and you find a source code somewhere else. Will that really happen?

Anyway, same as previous article, downlaod the toolchain tar ball. Make sure choice is ARM EABIGNU/Linux and IA32 GNU/Linux.
Download the ARM 2007q3 Release

Correction on Jan 18, 2008: A choice should be a pair of ARM GNU/Linux and IA32 GNU/Linux. We need -arm-none-linux-gnueabi-, not -arm-none-eabi-. Sorry for any inconvenience.

Then unpack it somewhere convenient for you.
$ cd /opt
$ sudo tar jxvf arm-2007q3-51-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2
$ sudo ln -s arm-2007q3 arm-cc
$ export PATH=/opt/arm-cc/bin:$PATH
$ export CC=arm-none-linux-gnueabi-gcc
Then download kernel source code from Google's Android distribution. You may also want .config file. I uploaded Angstrom's defconfig files as a sample.

Download, configure and build the kernel.
$ wget http://android.googlecode.com/files/linux-2.6.23-android-m3-rc20.tar.gz
$ tar zxvf linux-2.6.23-android-m3-rc20.tar.gz
$ mv kernel linux-2.6.23-android-m3-rc20
$ cd linux-2.6.23-android-m3-rc20
$ wget http://androidzaurus.up.seesaa.net/image/defconfig-angstrom.tar.gz
$ tar zxvf defconfig-angstrom.tar.gz
$ cp defconfig/defconfig-spitz .config
$ CROSS_COMPILE=arm-none-linux-gnueabi- make
make may ask you bunch of questions but simply [Enter] to choose default. Because the kernel itself will be useless anyway unless patch it properly. What we want here is a module driver. If you need to build the kernel, you better try OpenEmbedded bitbake for sure.

After build finishes, go back to configuration and build a module driver. Let's say binderdev, this time.
$ CROSS_COMPILE=arm-none-linux-gnueabi- make menuconfig

   Device Drivers ---> [Enter]
   Character devices ---> [Enter]
   OpenBinder IPC Driver [Space] and make sure <M> at the top of Open Binder.
   Then [Tab] to <Exit> and [Enter]
   And, [Tab] to <Exit> and [Enter]
   And, [Tab] to <Exit> and [Enter]
   Say <Yes> to save configuration.

$ CROSS_COMPILE=arm-none-linux-gnueabi- make modules
$ file drivers/binder/binderdev.ko
drivers/binder/binderdev.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
It looks like OK.

Very few would be interrested I guess, hope that these tips save someone's sweat.



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

Android Font

Android has True Type fonts in system/fonts.
$ ls -lh system/fonts/
-rw-r--r-- 1 root root 145.0k Dec 11 21:12 DroidSans-Bold.ttf
-rw-r--r-- 1 root root 106.2k Dec 11 21:12 DroidSans.ttf
-rw-r--r-- 1 root root 3.0M Dec 11 21:12 DroidSansFallback.ttf
-rw-r--r-- 1 root root 74.3k Dec 11 21:12 DroidSansMono.ttf
-rw-r--r-- 1 root root 164.9k Dec 11 21:12 DroidSerif-Bold.ttf
-rw-r--r-- 1 root root 130.8k Dec 11 21:12 DroidSerif-BoldItalic.ttf
-rw-r--r-- 1 root root 91.8k Dec 11 21:12 DroidSerif-Italic.ttf
-rw-r--r-- 1 root root 156.2k Dec 11 21:12 DroidSerif-Regular.ttf
I tried to install some of them to my Windows XP PC.

Just copy them to SD card, then drag & drop into c:\Windows\Fonts.

droid-serif.png  droid-sans-mono.png  droid-sans-fallback.PNG

So, the biggest font file, DroidSansFallback.ttf, has Japanese font in it. I guess other language fonts such as Simple Chinese and Big5 also supported by this single font file as well as other European Language fonts.

It's like a zipping the World into 3M bytes. I'm not fammiliar with embedded font things, but I guess Android has one of the most sophisticated font systems.

This is only an experiment. Copying out the font files may bring up copyright issue, so I deleted them from my PC.
posted by 安藤恐竜 at 13:01 | Comment(0) | TrackBack(0) | 日記




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