01/17/2008

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.

Cheers,
というわけで、CodeSourceryツールチェーンのシリーズ、ラストです。多分。

今回はドライバモジュール。いったんカーネルをビルドしますが、カーネル自体は使えません。ザウルスでちゃんと使うには、ちゃんとパッチしないとダメです。OpenEmbeddedのbitbakeを使ってください。

あんまり、こんなノウハウが必要な人、いないとは思うけど。Angstromでipkgしてもドライバがないけど、どっかでソース拾ってきたけどビルドできるのかしらなどという方がいれば、参考にしてください。いるのか本当に?www
posted by 安藤恐竜 at 18:35 | Comment(5) | TrackBack(0) | 日記
Comments for this entry
With the source available from "http://code.google.com/p/android/downloads/list", do you think it is possible to port Android to any platform? say arm devices like iPAQ h2200 using say Angstrom's bootloader.

I'm trying to build this for myself, if you have the knowledge ... would you give me some hints?


Thanks.
Avatar Ng
Posted by Avatar Ng at 01/23/2008 13:14
Avatar Ng,

Does the iPAQ H2200 have Armv5 or later CPU? If so, it might possible. Android binaries want EABI enabled kernel and older ARM lacks EABI capability.
Posted by androidzaurus at 01/23/2008 18:19
i use freescale iMX31 SBC. is it possible to port Android on this SBC ?
Posted by ruckuus at 01/29/2008 13:15
ruckuus,

iMX31 is one of the earliest target boards that Android run on.

Willcom shows off an Android prototype - Engadget
http://www.engadget.com/2007/12/11/willcom-shows-off-an-android-prototype/
http://www.youtube.com/watch?v=p8sQp3pZC6I
Posted by androidzaurus at 01/30/2008 16:40
Yea, iPAQ h2200 equipped with a XScale(armv5) processor. So I suppose it will fulfilled the requirement rite?
:)
Posted by Avatar Ng at 02/16/2008 02:04
Leave your comment
Name: [Must]

EMail: [Must]

URL: [Must]

Comment: [Must]

Confirmation Code: [Must]


Type in alphabets what you see in this image.
Trackback URI:  http://blog.seesaa.jp/tb/79091419
Trackback entries must contain URL of this entry.

Trackbacks to this entry
×

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