Palm Pilot Development Tools

How to program you hand-held computer using Linux.

One of the great things we can do with Linux and GNU tools is build an environment for cross-platform development. The perfect example for cross-platform development using Linux is the Palm Pilot development tools for Linux. In this article, I will explain the tools and methods you should use in order to program this small but very smart machine from your own Linux machine.

Background

The Palm Pilot is a very smart hand-held computer based the on the Motorola 68000 Dragon Ball CPU. A few models are on the market: PalmIII, PalmIIIx, PalmV and PalmVII. (The older machines are Palm-1000, Palm-5000, Palm-personal and Palm-professional). All of the new models use the PalmOS-3.x as their operating system. The basic functionality of these machines is the same. The differences between the new models are mainly the RAM size, the screen type, the battery and the shape of the machine. Details about the Palm devices can be obtained from http://www.palm.com/.

The File System

The Palm Pilot operating system uses the RAM to store and organize its “files”. Each file on the RAM is actually a Palm Pilot database. Each database has a header indicating the type and the creatorID of the database. The type can be anything: it is a 4-byte value the programmer can assign to his application or data. A type of appl is actually an application. If we assign a different type of database to an application, we will not be able to see it when we press the application button on the Palm Pilot. The creatorID is another 4-byte value; the PalmOS uses this value to identify the database (like a name for a file). The combination of type and creatorID is unique, so we need to apply for a creatorID if we want to give our application to other people. Databases can store resources such as bitmaps, executable code, forms and more. An application, for example, stores its User Interface objects and its code.

The Language

To program the Palm Pilot, we first choose a programming language. Many tools and compilers can be run on our Linux desktop to program our Palm Pilot. Here, we use the gcc ANSI C cross-compiler to demonstrate a simple program. Palm provides its SDK (software development kit) and documentation for free, and it is downloadable from http://www.palm.com/. A handy book to have would be the MC68328 Dragon Ball manual from Motorola (for more information, see the Palm web site).

The Tools

The most important tool we need to install is the gcc cross compiler. The good news about this compiler is that by the time you read this, it should be supported by Palm itself. You should be able to find the gcc, binutils, gdb and prc-tools somewhere at the http://www.palm.com/devzone/ web site. No version of gcc comes with palmOS support out of the box yet; there are some patches to install. The patches come with the prc-tools package, containing the tools needed to combine all resources into a prc (PalmPilot resource database) file. I recommend using the gcc-2.95.2 version and not the earlier 2.7.2, because it fixes many problems. The binutils-2.9.1 should also be patched, as well as gdb-4.18, if you want to be able to debug your application. There is a good chance that by the time this is printed, this group of software will be in one big compressed tar file. The installation instructions for the cross compiler are very simple and may be found on J. Marshall's web page at http://homepages.enterprise.net/jmarshall/palmos/. (This page is about to move to the official Palm site, somewhere under the devzone section.)

Building the GUI

Palm Pilot applications use FORMS to interact with the user. These forms contain bitmaps, buttons, tables, check-boxes and many other user-interface objects. A great tool to build these forms for the Palm Pilot, called pilrc, was written by Wes Cherry. The current version (2.4) can be downloaded from http://www.scumby.com/scumbysoft/pilot/pilrc/. It comes as source code and has very good HTML documentation. Listing 1 is an example of a simple pilrc file which builds a simple form, alert, menu and help string. (Please note that the Bitmap with ID 10 was created directly as a resource; there is no reference to it in this file except the ID.)

Listing 1

The command

pilrc /usr/local/example/hw.rcp

will build the two UI objects in this file: the form and the string. Each of these objects will be in a separate file. We will combine these files with the actual code into a prc file (application database) later, using the build-prc command that comes with the prc-tools package. To view the form without actually writing the application, we can use the pilrcui tool. This tool is bundled with the pilrc package. For more information on the UI objects and the use of pilrc, you should look at the Palm official documentation and the pilrc HTML documentation.

______________________

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix