Path: utzoo!utgpu!watserv1!ria!uwovax!7103_2622 From: 7103_2622@uwovax.uwo.ca (Eric Smith) Newsgroups: comp.sys.atari.st.tech Subject: Re: idle rambling Message-ID: <6848.26dd860f@uwovax.uwo.ca> Date: 31 Aug 90 01:33:03 GMT References: <1990Aug30.225713.24233@math.lsa.umich.edu> Lines: 33 In article <1990Aug30.225713.24233@math.lsa.umich.edu>, hyc@math.lsa.umich.edu (Howard Chu) writes: > Why is it that every time someone comes along to patch one of the TOS > functions, they have to intercept the trap handler? I've been thinking > about writing an AUTO folder program that basically copies all the BIOS, > XBIOS, etc. jump tables to RAM, so you don't have to duplicate all the > effort of intercepting the call, testing the function number, etc. > (i.e., the program has a functional duplicate of the current BIOS/XBIOS > trap handler, but it uses a jump table in RAM. When you want to replace > a function with your own, you just need to change the jump table, not > install a brand new trap handler.) > Good idea. In fact, MiNT provides something like this -- if you call the BIOS, XBIOS, or GEMDOS with function code -1, you get back the address of the appropriate function table. Changing this table lets you patch into system calls. > Why didn't anyone ever do this before? > See above; although MiNT is perhaps overkill if you only want to be able to hook into system calls easily, and don't care about multitasking, IPC, etc. If you do decide to write your AUTO folder program, you might want to consider using the same scheme (i.e. gemdos(-1) gets the address of the GEMDOS function table). The other problem is that no one can be sure that the AUTO folder patch is available on every machine; hence, the constant re-invention of the wheel. -- Eric R. Smith email: Dept. of Mathematics ersmith@uwovax.uwo.ca University of Western Ontario ersmith@uwovax.bitnet London, Ont. Canada N6A 5B7 ph: (519) 661-3638