X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: jbs30000 AT aol DOT com (Joel) Newsgroups: comp.os.msdos.djgpp Subject: Re: Interrupt handler question Date: 12 Apr 2004 18:53:52 -0700 Organization: http://groups.google.com Lines: 33 Message-ID: <84e4e2a9.0404121753.64c8c751@posting.google.com> References: <84e4e2a9 DOT 0404102155 DOT 6533748 AT posting DOT google DOT com> <84e4e2a9 DOT 0404111901 DOT 1c450a96 AT posting DOT google DOT com> NNTP-Posting-Host: 172.165.126.65 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1081821233 10138 127.0.0.1 (13 Apr 2004 01:53:53 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Tue, 13 Apr 2004 01:53:53 +0000 (UTC) To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Hans-Bernhard Broeker wrote in message news:... > Joel wrote: > > > Now, I hook a real mode interrupt and my routine is called. Now say, > > at a certain point, I want the old handler called. I could try this: > > _go32_set_real_mode_interrupt_vector(Interrupt Number, &OldInt); > > Set the dpmi reg struct as needed > > _dpmi_int(Interrupt Number, &r); > > Depends on where you do this from. Doing this from inside the > "NewInt" handler function itself is almost certainly a no-no. > Interrupts, or more particularly their handling routines, aren't > generally reentrant. > > Generally speaking there's a limit as to what you can do in this area > using C code. You'll have to revert to assembly sooner or later, at > least for the "outer layers", i.e. the routines actually registered as > interrupt handlers. C code can be called from there if you're > careful. Well, I'm not familiar with making asm protected mode interrupt handlers. Real mode asm interrupt handlers, yes, asm, no. The code at http://www.delorie.com/djgpp/doc/dpmi/ch4.6.html helps, but there's a lot missing. I suppose, if I had to use asm, what I'd want to do is make and use both .s and .cpp files (I use RHIDE and compile and link from there). I want to be able to hook an interrupt, check to see why it's being called, and if it's called for certain reasons, handle it myself, and let the orgional handler handle it for other reasons. If I need asm to do this, I guess I'll try poking around the web some more for more examples of asm djgpp interrupt handlers to study. Thanks.