Mail Archives: djgpp/2004/04/12/22:01:02
Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de> wrote in message news:<c5dvoq$dgq$2 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>...
> Joel <jbs30000 AT aol DOT com> 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.
- Raw text -