delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/01/06:55:02

From: "The Owl" <theowl AT freemail DOT c3 DOT hu>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Date: Tue, 1 May 2001 12:50:52 +0200
MIME-Version: 1.0
Subject: Re: win2000/ntvdm/djgpp (fwd)
CC: sandmann AT clio DOT rice DOT edu, djgpp-workers AT delorie DOT com
Message-ID: <3AEEB12C.10571.80A56B9@localhost>
References: <3AEDD6A5 DOT 5176 DOT 4B76959 AT localhost>
In-reply-to: <Pine.SUN.3.91.1010501115622.29799G@is>
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com

> I was asking about the normal chain of events as it happens on an
> unpatched NTVDM and with any normal DJGPP program.
> 
> You explained that _CurrentPSPSelector is set when the DJGPP program
> starts.  I was under the impression that _CurrentPSPSelector is set at
> that time because some code issues a PM Int 21h with 51h in AH.  I was
> asking what code might that be, since the DJGPP programs don't issue
> Int 21h in PM during startup.

the more precise chain of events:

1. the dpmi app issues a real mode (v86) int 2f/1687 to learn about the
   dpmi mode switch entry point. the interrupt is serviced by dosx in its
   RMINT2FHANDLER function (it has been set as the int 2f handler during
   dosx initialization). the mode switch routine is inside dosx and is
   called DPMI_CLIENT_PMODE_ENTRY.

2. the dpmi app calls DPMI_CLIENT_PMODE_ENTRY to enter protected mode.
   this function first issues a real mode int 21/62 to get the current
   real mode PSP segment, then switches to pmode by using ntvdm's Bop
   interface. once in pmode, dosx allocates various selectors, one of
   them will be the PSP alias selector. then dosx notifies ntvdm about
   the startup of a new dpmi app. ntvdm executes _DpmiInitApp AT 0 which
   will set _CurrentPSPSelector (among other things).

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019