delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/04/24/02:39:38

Date: Tue, 24 Apr 2001 09:37:43 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
cc: theowl AT freemail DOT c3 DOT hu, djgpp-workers AT delorie DOT com
Subject: Re: win2000/ntvdm/djgpp (fwd)
In-Reply-To: <10104232231.AA19751@clio.rice.edu>
Message-ID: <Pine.SUN.3.91.1010424093645.7426A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 23 Apr 2001, Charles Sandmann wrote:

> > I have an idea.  Is it true that _running_ when _CurrentPSPSelector is
> > zero is okay, and that only _exiting_ when it is zero causes NTVDM to
> > crash?  If so, we could set the PSP in the exit code.  This would
> > solve both the normal spawn and the case of abnormal termination via
> > Ctrl-C, because the parent will restore its PSP just before it exits.
> 
> Reading through the thread, this was my thought on the way to fix it also.
> I would also possibly set the PSP on the return from exec to help protect
> from the case where we sometimes call _exit and don't go through the
> exit handler.

I'm not sure I'm following.  I was thinking about setting the PSP
inside dpmiexcp.c:_exit, or even inside crt0.S:__exit.  What are the
cases where we bypass those, and what did you mean by the ``exit
handler'' in the last sentence above?

Setting PSP on return from spawn does seem to be an extra safety
precaution, for those rare cases where we spawn a DPMI program that is
not a DJGPP program, or if it was compiled with an older library.  So
perhaps setting the PSP both in the exit code and after returning from
spawn is best.

> To get W2K to see it, do we need to do a dpmi_int with the real mode PSP,
> or a protected mode Int 21 with the PM selector for the PSP?

A good question.  I don't know; anyone?

- Raw text -


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