Mail Archives: djgpp-workers/2001/04/24/02:39:38
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 -