LINUX GAZETTE

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]

"Linux Gazette...making Linux just a little more fun!"


PalmOS Development under Linux

By David "Scooter" Lukens


Abstract

This document was inspired by my efforts to get a functioning development environment up and running on a Linux machine. Trying to put a development environment together under the Cygwin environment infuriated me so I focused on getting everything working under Linux. This will explain what software needs to be installed which includes an emulator, compiler, and SDK. This will also explain what configuration issues need to be addressed.

Introduction

A friend and I one day said, "Wouldn't it be great if we could write our own palm apps?"

It sounded like a great idea, so I started looking into what it would take to get a development environment put together. He is primarily a win32 user, and I am almost soley a *nix user. Since win32 was a common platform available to both of us I began this process by looking into available tools.

For win32 there are two main ways to go for C development. One of these is Metrowerk's CodeWarrior for Palm, which was expensive for our hobby style project. The other option was using the PRC tools that would run under the cygwin environment. If you are not framilliar with the cygwin package, is it available from http://sources.redhat.com/cygwin/ . The cygwin package makes your win32 machine feel a lot more like a *nix machine and provides win32 ports of many common *nix tools (ls, dd, gcc, etc.).

After fighting with the tools on win32 for most of a week and getting nowhere, I decided to scrap the idea of developing on win32. Therefor, Linux, specifically RedHat 6.0 and 6.2, was the next choice and the ultimate solution.

There are several pieces that need to be assembled to get everything working and usable on Linux. Here is a basic list of what is needed:

Getting Started (Installing the Emulator)

The first part of getting everything going is the POSE Palm Emulator. It can be retrieved from http://www.palmos.com/dev/tech/tools/emulator/ along with various skins (graphic representations of the hardware). If you have compiled programs before, than this should be a snap. POSE does require the FLTK library for its menus and all. FLTK is available at http://www.fltk.org. Again, if you have compiled any other programs, then this will be very straight forward.

OK, you've gotten POSE compiled and installed and you think you're ready to go now? Well, not quite. POSE does not contain any ROM images in it. ROM images are the snapshots of PalmOS that reside on the FlashROM in the Palm itself.

We can do two things to get an ROM image. First, there is a Palm app that comes with the emulator that will allow POSE to suck the ROM image right off your PalmOS device. [Pretty cool, huh?] The second way to get a ROM image is to join palm.com's solution provider program at http://www.palmos.com/dev/program/. Once you have joined you have access to the Provider Pavillion at http://www.palmos.com/dev/pavilion/ which contains various ROM images. Some of the images here are testing and debug versions along with the normal images, so be careful which one you grab. Also, the images in this development area are NOT usually meant to be put onto your PalmOS device. There are separate PalmOS upgrades and ROM upgrades available elsewhere on the site.

Well, now you have the emulator up and running. Right-click, File: New and specifiy what ROM file to use, device you are emulating, graphical skin, and ram size. You should see something like this now.

Installing the Compiler and Its Dependents

A few pieces need to be installed for everything to function. These are the PRC tools, a SDK from palm, and the PilRC tool. The PRC tools are a port of the GCC tools we all know and love, but they produce output for the Palm. The SDK is a few libraries and a whole bunch of header files for the Palm API. Finally, the PilRC tool is the resource compiler.

The PRC tools can be found at http://sourceforge.net/projects/prc-tools/. This is a bunch of patches to binutils, gdb, and GCC, and linker tools to support the PalmOS. RPM's are also available at http://www.palmos.com/dev/tech/tools/gcc/dist/prc-tools-2.0-1.Linux-i386.rpm.

Next comes the SDK's. These are available from the palm.com site. The PalmOS 3.5 SDK (the latest as of this writing) is available only to registered developers in palm.com's provider pavillion. Earlier SDK's are available here: http://www.palmos.com/dev/tech/tools/gcc/dist/palmos-1-2-3.1-sdks-1.tar.gz. The 3.5 SDK contains documentation that covers previous SDK's as well. The older SDK's do not contain these docs.

The PRC install will make a directory called /usr/local/palmdev . The sdk's should be untar-ed here. A symbolic link called "sdk" should be made that points to the SDK that you wish to use. For exmaple, this is what my /usr/local/palmdev looks like.

[scooter@scooter scooter]# ls -l /usr/local/palmdev/ 
total 28
drwxr-xr-x    4 root     root         4096 Mar  8  2000 Palm OS 3.5 Support
drwxr-xr-x    3 root     root         4096 Nov  1 10:03 doc 
drwxr-xr-x    2 root     root         4096 Dec 21  1999 include 
drwxr-xr-x    3 root     root         4096 Nov  1 10:02 lib 
lrwxrwxrwx    1 root     root            7 Nov  1 10:07 sdk -> sdk-3.1 
drwxr-xr-x    3 root     root         4096 Feb  9  2000 sdk-1
drwxr-xr-x    3 root     root         4096 Feb  9  2000 sdk-2 
drwxr-xr-x    3 root     root         4096 Feb  9  2000 sdk-3.1 

The last tool that is needed is PilRC which compiles all of the resource files to generate a binary. This has most to do with buttons, menus, and placement of graphics on the screen. It can be found at http://www.ardiri.com/index.cfm?redir=palm&cat=pilrc.

Once all of these tools are put together you have a functional development environment. We are used to using gcc for compiling C programs on Linux so the C compiler for PalmOS is m68k-palmos-gcc. Most of the PRC compiler tools are named m68k-palmos-* .


Copyright © 2001, David "Scooter" Lukens.
Copying license http://www.linuxgazette.com/copying.html
Published in Issue 62 of Linux Gazette, February 2001

[ Prev ][ Table of Contents ][ Front Page ][ Talkback ][ FAQ ][ Next ]