delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/12/11/22:10:35

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
Message-Id: <10112120307.AA24007@clio.rice.edu>
Subject: Re: go32-v2 memory chompage [was: Re: v2.03 refresh ...]
To: eliz AT is DOT elta DOT co DOT il
Date: Tue, 11 Dec 2001 21:07:01 -0600 (CST)
Cc: djgpp-workers AT delorie DOT com, acottrel AT ihug DOT com DOT au
In-Reply-To: <2950-Tue11Dec2001200640+0200-eliz@is.elta.co.il> from "Eli Zaretskii" at Dec 11, 2001 08:06:41 PM
X-Mailer: ELM [version 2.5 PL2]
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

> How about if we pass something special in _stubinfo->basename?  Like
> "<v2load>", for example?  ....

Triggered memories of differences.  Sure enough, I set the stubinfo size
to a truncated value (0x44) when v2load'ing.  We could use this to
decide, since the real stub has never used a stubinfo this short (at
least not since pre-beta 2.00 development...  This requires no changes 
to v2load or go32-v2, small change to dpmiexcp.

If testing is OK will commit for both v2_03_1 and CVS. 

  void __maybe_fix_w2k_ntvdm_bug(void)
  {
    if (_osmajor == 5 && _get_dos_version(1) == 0x532) /* Windows NT, 2000 or XP
    {
+    if(_stubinfo->size < STUBINFO_END) /* V2load'ed image, stubinfo PSP bad */
+
+     /* Protected mode call to SetPSP - uses BX from GetPSP (0x51) */
+     asm volatile("movb $0x51, %%ah                        \n\
+                   int  $0x21                              \n\
+                   movb $0x50, %%ah                        \n\
+                   int  $0x21                              "
+                   : : : "ax", "bx" );             /* output, input, regs */
+    else
+
      /* Protected mode call to SetPSP - may destroy RM PSP if not extended */
      asm volatile("movw %0, %%bx                           \n\

- Raw text -


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