Date: Fri, 31 Aug 2001 19:11:48 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Dykstra Sean" Message-Id: <1190-Fri31Aug2001191148+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: "djgpp AT delorie DOT com" <68C4CF842BD2D411AC1600902740B6DA02CDC54E AT mcoexc02 DOT mlm DOT maxtor DOT com> (Sean_Dykstra AT maxtor DOT com) Subject: Re: Help! - INT x22 problem. References: <68C4CF842BD2D411AC1600902740B6DA02CDC54E AT mcoexc02 DOT mlm DOT maxtor DOT com> Reply-To: djgpp AT delorie DOT com > From: "Dykstra, Sean" > Date: Fri, 31 Aug 2001 09:06:50 -0600 > > I am only hooking the protected mode interrupt. There is some old lock code > below, but I planning on removing it as I now lock the entire app into > memory (I have already removed the lock code for locking the vars...But I > wanted to send you the file unedited from what I am running now). One thing your code does not do is lock the stack. However, each interrupt handler has a local automatic variable Count which is on the stack. So your handlers access unlocked data. Solution: either lock everything, or make those variable static and lock them. > I have > found it to lock up on several machines so far, I will attempt to > characterize them for BIOS, manufacturer, etc.. The interrupt frequency is > about 1 interrupt every 40us - 70us. This is a very high frequency. You might be hitting problems with wrapper code being non-reentrant. > One of the other reasons for > using C code is that I call back into the app (another reason I suspect the > stack might be corrupted). This is yet another reason that might cause a failure: the callback code and data is probably not locked, and could potentially run for a long time. > Can I still do this if I write the handler assembly? Sure, assembly functions can call C functions.