home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!ewylie
- From: ewylie@ocf.berkeley.edu (Elizabeth Wylie)
- Newsgroups: comp.sys.mac.programmer
- Subject: Re: Altering the TRAP dispatch table.
- Message-ID: <1548hiINN809@agate.berkeley.edu>
- Date: 28 Jul 92 19:52:18 GMT
- References: <9207271916.AA19926@ucbvax.Berkeley.EDU>
- Organization: U.C. Berkeley Open Computing Facility
- Lines: 32
- NNTP-Posting-Host: tornado.berkeley.edu
-
- In article <9207271916.AA19926@ucbvax.Berkeley.EDU> glalonde@VNET.IBM.COM ("Glen Lalonde") writes:
- >I need to change the location that one of the OS Traps goes go.
- >IM detains how to do this, but under sys 7 the effect seems to be local
- >to that process. Once the application that did the patch exits, the OS Trap
- >went back to its old value. Is there any way to make the patch GLOBAL and
- >PERSISTENT?
- >
- >For now I just figured out the location in memory and patched it via
- >C. I doubt if the trap table always starts at location $400 in memory
- >for all models though.
-
- ^^^^ I really do hope that's temporary! ^^^^
-
- >I want to trap BlockMove to a version optimized for the 030, my SE has
- >a 030 card.
-
- In order for your patch to be active as long as the computer is turned on,
- you'll need to write an INIT (er, extension...). (Is that kinda like
- 'wetlands' and 'marshes' ?)
-
- Anyway, you're lucky. Your patch doesn't need to call the system when it's
- done. You just want to totally yank out the existing one. At startup,
- use SetTrapAddress to point to your routine. This routine should be loaded
- as a locked-system heap code resource. (Not 'CODE', code.)
-
- Be sure to detach the rtesource so you're initextention won't be purged when
- the file is closed. Also remember that BlockMove is register based.
-
- Finally, good luck on beating apple's code. They write _very tight_ assembly
- where it counts. (Elsewhere they tend to do some rather wierd C++).
-
- -E. Wylie
-