From: Charles Sandmann Subject: Re: RM functions with DJGPP To: jhunter AT kendaco DOT telebyte DOT com (Joel Hunter) Date: Thu, 18 May 1995 07:56:10 -0500 (CDT) Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Joel Hunter wrote: > I realize that starting with 2.0, DJGPP-compiled programs will operate > only under a DPMI environment, and as such many hardware-interrupt issues > will be more easily resolved. However, sometimes your need for speed is so > great that you want NO mode-switching when the interrupt occurs. In these > cases, you need a real-mode handler for when the interrupt occurs in > real-mode. Will we be able to do this in version 2? (Even if it has to be > pure assembly I think it would still be very useful.) Here you are at the mercy of the DPMI provider you are using. If you hook both RM and PM interrupts, you should hook the PM interrupt first (since it modifieds the RM interrupt to reflect). If the PM interrupt does an IRET and does not chain, then you would not need the extra mode switches, if the DPMI provider allows this (I think it would work under CWSDPMI). > Also, I understand that under DPMI all interrupts are automagically passed > to the protected-mode hander, regardless of what mode you are currently in > -- will there be a way to bypass this, so an interrupt that occurs in > real-mode will NOT switch to protected-mode and call your PM handler? Yes, reflection is automatic according to the DPMI spec. If you set the RM interrupt after the PM interrupt, you could probably avoid this extra swap on *SOME* DPMI providers. The only way to know for sure is to test it.