To: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Replacing arbitrary interrupt handlers Reply-To: dmb AT ai DOT mit DOT edu Date: Mon, 22 Feb 93 13:42:30 -0500 From: David Baggett A while back I asked how to intercept the timer interrupt from within a DJGCC program, and several people pointed me to the source to gcrt0.o. (Thanks!) I've successfully inserted my own timer interrupt that chains properly in my program, but I still have a few questions. (BTW, I'm using v108 and not v109 since the timer code doesn't work with v109.) 1. In my timer interrupt I just update a global counter. I run my interrupt at 5 times the normal rate and then chain to the old vector every 5th time to keep things kosher for DOS. However, it seems that if I busy wait on the timer variable it doesn't get updated! E.g., the code for (;;) { if (ticks > 100) break; } never ends. I know the variable is getting updated properly because if I do for (;;) { vsync(); /* wait for vertical blank */ if (ticks > 100) break; } it does terminate. (vsync() just polls the VGA card to see if the vblank bit is set). Does anyone have any clue why this might be happening? (It seems awfully bizarre to me.) 2. The code that steals the timer interrupt seems to be specific to go32. Is there any way I can steal other vectors? I need to grab the "terminate addresss" vector (called by DOS when the program terminates) and the mouse movement interrupt in particular. I'd like to be able to do this without hacking go32. Is it possible? (BTW, I don't care how disgusting the process is, as long as I can get something working. :) Thanks! Dave Baggett dmb AT ai DOT mit DOT edu