Yes, I've hooked this stuff under PalmOS 2.0. All vectoring is set up
in RAM (or at least it was). Presumably, it makes for good insurance
for OS patches.
There is a big numeric gap between the 'normal' system traps and the
library trap numbers, which is why the table does not just continue
(there would be a big chunk of empty slots in the table).
If you trace into the system trap you will see that there are actually a
number of trap # ranges implemented. As far as I know, there is no
documented way for appl's to patch these other ranges, but it is
certainly possible.
When I said 'possibly easier' I did not mean 'simple code'. I meant
easier than dealing with some issues of an entire replacement library.
With a replacement you have to stub all functions and deal with loading.
Bigger code and more chances for unexpected bugs and behavior.
An alternative might be to muck around with the dispatch tables. I
looked at this once and gave up. The tables themselves are relative and
generally exist in a code segment. For built in libs that would mean
ROM. You could replace the table pointer (instead of a whole new lib)
and have basically have all functions that you are not interested in jmp
relative based on the original table pointer, but there are potential
problems. Like a replacement library, you'll break if more entries are
added, and etc.
Of course, none of these schemes are certain to work in all versions of
the OS - you might not have stubs for new functions, the internal table
pointers might move, and so on. But when you hack the OS...
Best Regards,
-jjf
-----Original Message-----
From: Adam Wozniak [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 10, 2000 1:16 PM
To: Palm Developer Forum
Subject: Re: how to trap system library functions?
"Fitzpatrick, Joe" wrote:
> You have to directly modify the dispatch table.
Correct me if I'm wrong, but I don't believe you've ever tried this.
The dispatch table ends at sysTrapLastTrapNumber. There are no entries
for libraries, which is why SysGetTrapAddress() and SysSetTrapAddress()
don't work for library functions.
To catch things out beyond sysTrapLastTrapNumber (i.e. the library traps
0xA800 and beyond),
you would wind up rewriting the trap exception vector handler. This is
a proposition I would
describe as hairy at best. Not to mention the performance hit.
--
Adam Wozniak
Senior Software Design Engineer
Surveyor Corporation
4501 Orcutt Rd.
San Luis Obispo, CA 93401
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html