Date: Tue, 27 Feb 1996 12:36:26 -0500 From: Andrew Szymkowiak Message-Id: <199602271736.MAA06762@rosserv.gsfc.nasa.gov> To: djgpp AT delorie DOT com Subject: pctime13 troubles/questions When people ask here about interrupts and timer code, they are pointed to pctime13.zip. I am trying to use this code with version 2, and have run into a few problems. The executable in the zip ("test70.exe") works fine. When I edit "test70.c" to include "gccint70.h" (it comes including "tcint70,h", the turbo-c version) and compile with: gcc -g -o test test70.c gccint70.c The executable GPF's pointing into "_int86". This was using the v2 release, with CWSDPMI as the server. Has anyone else seen this, and knows what to change? I cannot tell if this code was ever checked with version 2; perhaps it is version 1 specific (though I don't know why). I also have a few comments about using this as a pedagogical example: (1) The subroutine never does anything about locking memory, nor does the test main set the magic crt0 flags. It might be good to include an example of one of the above. (2) Someone might want to point out that these routines will not allow really high interrupt rates, since the real mode routine has to perform two mode switches ( I think). If all one wants to do at interrupt time is count up the tick counter, wouldn't they be better off to allocate the tick counter out of DOS memory, and have the real mode routine increment it directly, and the pm mode routine increment it using far pointers? (I will attempt to find time to experiment with this, but do not feel proficient enough to contribute this yet, since I think one might have to hand assemble the code for the real mode interrupt (since the compiler/assembler makes pm code), copy the bytes into low memory, and hack the interrupt vector to point to it) -Andy S.