How to extend PalmOS?
How do I extend the Palm OS?
On pre-OS 5+ devices:
The Palm OS has a system trap mechanism that works much like interrupts on MS-DOS systems. These are system services that process all the OS events, such as "user entered a Graffiti character", "system timer ticked", "power-off", etc. They also made a way so that an application can change how these system traps operate by changing the vector for the traps to point to user code that can modify or replace the default system behavoior. These extensions are generally knows as "hacks".
For instance, one could code up a hack to replace the standard Keyboard dialog with a new input method, or insert a procedure into the event-handling code in order to perform special actions at the entry of a certain Graffiti character, or even patch the text field routines to allow hyperlinking between applications. The potential uses are even wider than the system software itself.
Unfortunately, there are no official standards for installing hacks. Where in memory does one put the routine? How does one install it into the trap? How do you deal with multiple patches on the same trap, especially if they install and remove themselves in different orders? How do you gracefully recover from a system reset?
There are a bunch of ways to do all these things, but if every developer does it their own way it is inevitable that some hacks will conflict with others in an ugly way. Enter HackMaster. This is a program that any developer can use to manage a system hack. The user must buy HackMaster for the trivial sum of $5.00 which includes a couple of useful hacks. Most Palm users that download anything at all wind up with HackMaster on their machines.
You can write your own system hacks to interface with HackMaster using the HackMaster API. Then HackMaster will take care of all the nasty details of installing your hack, making sure it works after a reset and all the other things that can get in the way.
On post-OS 5+ devices
From Palm OS 5.0 hacks are not supported. Instead the Notification Manager has been greatly extended. Much of what would have been done with a hack before can now be done in a system-approved way. Refer to the Palm SDK 5.0 documentation.