Sailor Family

Home

Sailor At Work

Firefox
Java
Rubik Cube
Toto/4D

Html
Perl
Chinese

Web Tools
Emacs/Cygwin









Drop me a note
Email Web Sailor
Welcome to Web Sailor's Home
Home > Emacs/Cygwin > Using Emacs for Palm Pilot Programming

Palm OS SDK

Palm OS SDK is needed for Palm Pilot application programming. The SDK can be downloaded from Palm Computing. The Palm OS SDK contains only library and include files for building application, it does not contain any programming tools.



Palm Pilot Programming Tools

The Palm Pilot programming tools has been integrated into Cygwin. This means you need to have Cygwin installed in your machine. Refer to this page for Cygwin installation. The installtion of the Palm Pilot programming tools is similar to the way you install additional Cygwin package. The installation steps are :

  • Invoke the Cygwin setup.exe
  • Select "Install from Internet"
  • Select the text file type to be "DOS"
  • In "User URL", enter the URL as http://prc-tools.sourceforge.net/install
  • Click next.
  • Make sure prc-tools and pilrc packages under Devel category are selected
  • Click next to install




Mounting the PalmDev Directory

Since the PRC-tools requires the PalmDev directory to be available at POSIX path, you will need to run this command in a Cygwin Bash shell.

         mount -tf "C:\PalmDev" /PalmDev
         


Run palmdev-prep

To make the prc-tools able to look for the correct version of SDK, you will need to run the following command.

         palmdev-prep
         


Compile Palm Pilot Applications

The following commands are examples for compiling a Palm Pilot application. The -palmos4 option specifies the applcation is to be compiled using Palm OS SDK version 4. If the Palm OS SDK that you have installed is a different version, you will need to specify the correct version. For example, -palmos3.5.

  • m68k-palmos-gcc -Wall -palmos4 *.c -o app
  • pilrc ApplicationRsc.rcp
  • build-prc Sokoban.prc "Sokoban" Wssk app *.bin --backup

If you wish debug the application using debugger, you will need to compile the application using -g option.

  • m68k-palmos-gcc -g -Wall -palmos4 *.c -o app
  • pilrc ApplicationRsc.rcp
  • build-prc Sokoban.prc "Sokoban" Wssk app *.bin --backup


Debug a Palm Pilot Application in Emacs

The followings are the procedures to debug a Palm Pilot Application.

  • Compile the application with -g option as mentioned in the previous section
  • Place the application into the Palm Emulator Autoload directory
  • Run the Palm Emulator
  • In Emacs, invoke "M-x gdb"
  • In Emacs, enter "m68k-palmos-gdb" as the debugger command
  • In Emacs debugger window enter "file app" to load the application symbols
  • In Emacs debugger window enter "break StartApplication"
  • In Emacs debugger window enter "target pilot localhost:2000"
  • In Palm Emulator, invoke the application you want to debug.

You should be able to see the Palm application breaks at a function StartApplication. You can now start debugging.



Langkawi Sunset