Developing

From OpenZaurus

Contents

Setting Up a Development Environment

These instructions tell how to set up OpenEmbedded (the recommended option). If you want to use a pre-cooked sdk, you can download one from here.

  1. Ensure you have the OE:RequiredSoftware installed.
  2. Set up your OE build environment by following the instructions in OE:GettingStarted. You can follow an example at Developing/OESetup or a rather nifty screencast.
  3. Now you should be ready for development!
    $ bitbake nano         # build a single package
    $ bitbake gpe-image    # build an entire image
    
    OE:UsefulTargets lists other targets you can build. Generally you need a base image (bootstrap-image, opie-image or gpe-image) and, if building for a target that requires an installer image (such as C3000), an additional pivotboot-image. from OE:GettingStarted

See the BitBake User Manual and OpenEmbedded HowTo for more.

The 2.95.3 Toolchain

BitBake will normally build the ARM toolchain with a recent gcc for you. However, if you want to compile the 2.4.18 kernel (i.e. for Collie or Poodle), you will need to provide a 2.95 toolchain. The 2.6 kernels don't require this legacy.

Nota bene: those Zaurii which use/need a 2.4.18 kernel (and therefore need GCC 2.95.3 to build this) still use the automatically built version of GCC (i.e. GCC 3.xx or perhaps 4.xx) to build everything other than the kernel.

The canonical description of how to do this is at OE:ZaurusKernels. This is just a synopsis.

$ mkdir -p /usr/local/arm
$ cd /usr/local/arm
$ wget ftp://ftp.handhelds.org/projects/toolchain/archive/cross-2.95.3.tar.bz2
$ tar jxf cross-2.95.3.tar.bz2
$ cd 2.95.3/bin
$ mv arm-linux-gcc arm-linux-gcc-2.95
$ mv arm-linux-ld arm-linux-ld-2.11.2

Add this line to build/conf/local.conf:

   ASSUME_PROVIDED += "virtual/arm-linux-gcc-2.95"

Add this line to env-setup:

   export PATH=/usr/local/arm/2.95.3/bin:$PATH

Now you can bitbake virtual/kernel.

Solving Problems

If you get "undefined reference to key_maps" and a whole bunch of other symbols, it's probably a problem with loadkeys. First, run loadkeys manually to look for errors. It may be a permissions problem that "chmod 777 /dev/tty /dev/tty0" would fix. (see [1])

   $ LC_ALL=C loadkeys -m ./drivers/char/collie_keymap.map

Make sure that the drivers/char/collie_keymap.c contains data. If there's any doubt (i.e. if you were bitten by the previous error), manually remove that file and try again.

You can make the 2.4 kernel manually using:

   $ cd tmp/work/collie-linux/collie-kernel-24-8-2.4.18-rmk7-pxa3-embedix-r23/
   $ make CC=arm-linux-gcc-2.95 LD=arm-linux-ld-2.11.2

Native (on-device) development

Generally OZ devices are glacially slow at compiling packages but it is possible.

Howto (probably) compile emacs from cvs on oz/gpe 3.5.4.1rc4)

Also, the requirements for on-device toolchains can be found in the forums. This information should be copied here.

Place this information in this HowTo: http://wiki.openzaurus.org/HowTos/Native_Development

Debugging

Run OZ under qemu: http://www.o-hand.com/~richard/qemu.html