"Michael Zapeda" <[EMAIL PROTECTED]> wrote:

> I was just wondering if someone could explain to me, the process of
> "patching a trap"? I hear references to patching traps in this forum a lot,
> some being the solutions to posts. So how does one do this? I'd appreciate
> the help. Thanks!

First off, "trap" is the term used to describe an OS entry point, 
because these entry points are implemented using the Motorola 68K TRAP 
instruction. There's a trap table, which is basically just a list of 
the addresses of the various Palm OS functions.

Why would you even want to patch a trap? To substitute or enhance the 
behavior of one of the Palm OS functions. You write your substitute or 
enhanced version of the Palm OS function, then in the trap table you 
replace the address of the original Palm OS function with the address 
of your own function. You should probably save the original address 
somewhere in your own code, so that you can call the original function, 
and so that you can restore the system to its original behavior if so 
desired. See the Palm OS Reference documentation on SysSetTrapAddress 
for more details.

The best way to patch a trap is to write your code as a HackMaster 
hack, and let HackMaster do the patching for you.

--
Roger Chaplin
<[EMAIL PROTECTED]>

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to