Mail Archives: djgpp-workers/2001/08/10/01:02:04
This is my patch vs cvs:
*** dosexec.ori Wed Aug 1 20:33:04 2001
--- dosexec.c Thu Aug 9 23:34:58 2001
***************
*** 173,177 ****
const char *progname;
unsigned proglen;
! int i;
unsigned long fcb1_la, fcb2_la, fname_la;
int arg_len;
--- 173,177 ----
const char *progname;
unsigned proglen;
! int i, s1, s2;
unsigned long fcb1_la, fcb2_la, fname_la;
int arg_len;
***************
*** 379,382 ****
--- 379,383 ----
r.x.es = parm_la / 16;
r.x.bx = parm_la & 15;
+ s1 = __dpmi_allocate_ldt_descriptors(1);
__dpmi_int(0x21, &r);
#if 0
***************
*** 385,388 ****
--- 386,393 ----
tbuf_selector = 0;
#endif
+ s2 = __dpmi_allocate_ldt_descriptors(1);
+ fprintf(stderr,"Dosexec selectors=%x:%x\n",s1,s2);
+ for(i=s2;i>=s1;i-=8)
+ __dpmi_free_ldt_descriptor(i);
/* Work around the W2K NTVDM bug; see dpmiexcp.c for detailed
explanations. */
I built make (and only make) with this change. On my Windows 2000 system
here is a snapshot of rebuild of libc:
Dosexec selectors=27f:2af
gcc ... -c d0200.S
Dosexec selectors=27f:2af
Load error: no DOS memory
Dosexec selectors=27f:2af
make.exe[2]: *** [d0200.o] Error 1
Dosexec selectors=227:257
make.exe[1]: *** [all_subs] Error 2
Dosexec selectors=1cf:1ff
make.exe: *** [all] Error 2
So, my problem with selectors went away with the above patch, but now I
die due to no DOS memory :-P (it does run longer). Now what is strange
is before I added the diagnostic print I think I still leaked, but I
can't be 100% sure my make build was correct. So, does NTVDM leak dos memory
too?
- Raw text -