Home / Development

Development

Writing and packaging software for a MIPS Linux handheld.

Desk with Agenda VR3 and laptop for software development.

Set up a cross-compiler

Build MIPS binaries on a desktop Linux machine.

Use the native toolkit

A lightweight GUI library tuned for the small screen.

Package your work

The community package distribution made installing and updating software easier.

Build a romdisk

Combine packages into a full system image.

Share it

Announce releases on the mailing list and the software repository.

Cross-compiling today

Modern toolchains make cross-compiling much easier: Linux distributions package cross-compilers for common architectures, and build systems such as Buildroot or the Yocto Project can assemble complete embedded images. Start with Shell scripting and Embedded Linux.

Match the target ABI and runtime

Cross-compiling for a MIPS handheld is mostly about matching the target precisely. A binary can be a valid MIPS ELF file and still refuse to start if the endianness, ABI, C library, or program interpreter path do not match the firmware on the device.

Keep one clean sysroot copied from the target image or built alongside it. Point the compiler, linker and pkg-config at that sysroot, and avoid mixing in headers or libraries from the host machine. That mistake often compiles cleanly and only shows up later as a start-up failure or an unexplained crash.

Before you copy a build across, inspect it on the desktop: - file confirms the CPU family and endianness. - readelf -l shows which loader the binary expects. - readelf -d lists the shared libraries it will try to open.

Compile for the oldest CPU features you know the device supports. Extra optimisation flags are not helpful if they introduce instructions the handheld cannot execute. Using a staged install into DESTDIR also helps, because you can see exactly which files a package wants to ship before anything reaches the device.

For release packages, strip the installed binary to save space, but keep an unstripped copy on the host so you can still read symbols in a backtrace or compare builds properly. If the program is tiny, a static build can simplify first tests. For regular packages, dynamic linking is usually the better long-term choice because library fixes stay in one place and package sizes remain smaller.

Test on the device before you package it

Desktop builds only prove that the code compiles. The useful bugs on a PDA are usually real-hardware bugs: low-memory behaviour, input quirks, display depth assumptions, slow flash storage, and missing writable paths. Copy early builds to the device and start them from an interactive shell before you add a menu entry or package script.

A simple test cycle saves time: - copy the binary and any private data files into a temporary directory; - run it from the shell and note the exit status; - watch stderr and kernel messages for missing devices, bad paths or permissions errors; - reboot once and check that the program still starts cleanly.

A serial console is worth keeping ready. If a GUI program locks up the screen or grabs input, a serial login is often the quickest way to kill it, undo a bad start-up change, or inspect log output. If you need a refresher on shell-based checks, Command line covers the basics, and Troubleshooting is a good next stop when a program fails without saying much.

Most first-run failures are simple: the execute bit is missing, a library was not packaged, a path was hard-coded for the build machine, or the application tried to write into a read-only part of the filesystem. Test as an ordinary user if that is how the software will be launched. Root-only testing can hide real bugs until the package is already in use.

Design for the small screen and the small root filesystem

The best VR3 software respects three limits at once: screen size, available RAM and writable storage. Features that feel harmless on a desktop can make a handheld awkward to use or surprisingly heavy to package.

Keep the interface shallow. Long menus, wordy dialogues and multi-pane layouts waste pixels. Prefer one clear task per screen, short labels and predictable key handling. Start-up time matters too. Delay loading large tables or optional resources until the user actually asks for them. Existing Applications are useful as examples of software that keeps a modest footprint.

On the filesystem side, separate code from state. Install binaries, icons and shared data into the package image, but write caches, lock files and user settings only to writable locations. Assume /tmp may be cleared, and assume the base image may be rebuilt. That makes upgrades safer and makes it much easier to move a stable package into a custom Romdisks build later.

A few habits help on small systems: - split documentation, examples or large assets into optional packages if they are not needed at runtime; - avoid spawning helper processes for jobs a library call can do directly; - keep configuration in plain text where possible so a broken setting can be repaired by hand.

When an application seems finished, test it both as an installed package and inside a fresh image. Start-up order, library search paths and default permissions can differ slightly between the two.