Re: Real mode int from protected mode and back
- From: "Jason Burgon" <spamtrap@xxxxxxxxxx>
- Date: Mon, 25 Feb 2008 09:24:26 GMT
"gerotica" <spamtrap@xxxxxxxxxx> wrote in message
news:53bfea38-02ab-4b18-8b8a-259d1490c3e2@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
But, with PM mode set in the system, wouldnt some pointer operation
in the file routines crash it? Because the processor is in PM and will
not allow those RM operations..
As I said, your TSR will be called with the processor in real mode (or V86
mode which is pseudo real-mode). This is what will happen:
(1) App is running in PM.
(2) App executes one of your patches.
(3) Your patch sets [E]AX and [E]DX as appropriate, then executes int 61h.
(4) The DPMI host executes its PM int 61h ISR.
(5) Because neither the DPMI host nor the application has hooked PM int 61h,
the default int 61h DPMI ISR sets regs EAX..EDI and Flags, *switches the CPU
to real-mode* and executes an int 61h. That is, it *reflects* the interrupt
to the real-mode int 61h ISR.
(6) Your TSR now gets control and does its thing. Notice here that the CPU
is in *real mode*. Finally your TSR executes an RTI.
(7) The DPMI Host saves the values of EAX..EDX and Flags, *switches back to
PM*, restores the register values into the real CPU registers and executes
an RTI.
(8) The application continues at the next instruction after the int 61h,
with EAX..EDX and Flags set to the values they had when your TSR executed
its RTI instruction.
It's a little more complicated than that (stacks are swapped and other
things are done behind the scenes by the DPMI host), but that's essentially
what takes place.
--
Jay
Jason Burgon - author of Graphic Vision
http://homepage.ntlworld.com/gvision
.
- References:
- Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Tim Roberts
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Tim Roberts
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Jason Burgon
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Jason Burgon
- Re: Real mode int from protected mode and back
- From: gerotica
- Re: Real mode int from protected mode and back
- From: Jason Burgon
- Re: Real mode int from protected mode and back
- From: gerotica
- Real mode int from protected mode and back
- Prev by Date: Get the FAQs
- Next by Date: Re: 16 bit dos debug options?
- Previous by thread: Re: Real mode int from protected mode and back
- Next by thread: Re: Real mode int from protected mode and back
- Index(es):
Relevant Pages
|