Path: utzoo!attcan!uunet!mcvax!kth!draken!tut!santra!kampi!jmunkki From: jmunkki@kampi.hut.fi (Juri Munkki) Newsgroups: comp.sys.mac.programmer Subject: Re: Re: Legal Tail Patches Message-ID: <20032@santra.UUCP> Date: 1 Mar 89 13:58:39 GMT References: <1285@ccnysci.UUCP> <10050076@accuvax.nwu.edu> <19886@santra.UUCP> <26341@apple.Apple.COM> <19971@santra.UUCP> <785@internal.Apple.COM> Sender: news@santra.UUCP Reply-To: jmunkki@kampi.UUCP (Juri Munkki) Organization: Helsinki University of Technology, Finland Lines: 43 In article <785@internal.Apple.COM> lsr@Apple.COM (Larry Rosenstein) writes: >In article <19971@santra.UUCP> jmunkki@kampi.hut.fi (Juri Munkki) writes: >> 3. Change GetTrapAddress so that it first checks if the trap does >>come-from patching. If it does, return the address that is contained in >>the jump table. If the routine only has the apple patch, the ROM address >>will be returned. > >No good. A program may do a GetTrapAddress, and JSR directly to that as a >way to save time (although I doubt that you save much time at all). >GetTrapAddress must therefore return the same address you would jump to by >executing the trap. > >Your approach tries to keep the come-from patch as the "last" patch for >the particular trap (ie, the code that gets control first). I don't think >you can change the way Get/SetTrapAddress works and still maintain >compatibility. > Oh, but it does work! The code that doesn't get called is only the come-from patch. This code only patches ROM code anyway. If an application gets the trap address and calls it, it is in RAM and won't be affected by the come-from patch. SectRect is one of the come-from patches. It doesn't have any bugs of its own. A buggy routien would have to have two levels of patching. One for the come-from patch and one for the real patch. Since come-from patched traps seem to be simple and short (like SectRect), they do not usually contain any bugs. This way some complex traps would take a little more time (one jsr/rts), but overall you wouldn't loose anything. I'm starting to get the feeling that Apple is afraid to touch the system software in case they introduce new incompatibilities. The only way out is to write a new partly source-compatible OS. Long ROM routines should be broken into several subroutines so that patches replace only one subroutine. If the new apple OS is good and Apple adds some new coprocessors (graphics and signal) as standard hardware on some of their new machines, I might drop the line about NeXT in my signature...I'm not all that enthusiastic about Unix...it seems even harder to patch/change than Mac OS. _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ | Juri Munkki jmunkki@hut.fi jmunkki@fingate.bitnet I Want Ne | | Helsinki University of Technology Computing Centre My Own XT | ^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^