www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/24/14:56:49

From: "Michael N. Filippov" <michael AT idisys DOT iae DOT nsk DOT su>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Announce: CWSDPMI r5 public beta
Date: 24 Oct 2000 09:16:40 GMT
Lines: 57
Message-ID: <8t3k1o$177m$1@news.itfs.nsk.su>
References: <Pine DOT LNX DOT 4 DOT 10 DOT 10010231436380 DOT 1624-100000 AT baby DOT siemens DOT ebp DOT ii3 DOT b-rail DOT be> <8t1i2c$30hu$1 AT news DOT itfs DOT nsk DOT su> <39f41e9e DOT sandmann AT clio DOT rice DOT edu>
NNTP-Posting-Host: idisys.iae.nsk.su
X-Trace: news.itfs.nsk.su 972379000 40182 193.124.169.11 (24 Oct 2000 09:16:40 GMT)
X-Complaints-To: usenet AT news DOT itfs DOT nsk DOT su
NNTP-Posting-Date: 24 Oct 2000 09:16:40 GMT
User-Agent: tin/pre-1.4-19990517 ("Psychonaut") (UNIX) (Linux/2.4.0-test1 (i586))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Charles Sandmann <sandmann AT clio DOT rice DOT edu> wrote:
>> Why not just add parameter "reserved DOS memory", then if (for example)
>> 240 of 640 is taken by DOS/TSRs and "reserved DOS memory" == 100 KB
>> CWSDPMI would allow to work with 250-300 MB instead of this hardcoded 128.
>> It would be a more flexible variant for nested programs too.

> There is already such a parameter which is defined when using DOS memory as
> DPMI memory.  It's currently set for about 64Kb.  Eventually I may just 
> support that value with pagetables, too.  But for now I want to make minimum
> changes and get it released.

// File VALLOC.C
...
#define SAVEPARA CWSpar.savepar	/* If we use DOS memory for paging, amt to save */
...
static int alloc_pagetables(int mintable, int wanttable)
{
...
  geninterrupt(0x21);	/* lol == size of largest free memory block */
...
  if (lol < mintable*PAGE2PARA + extrapara)	/* 1 PD, 1 PT (real), 1 PT (user) */
    goto mem_exit;
...
  if (lol > wanttable*PAGE2PARA) {	/* 8 will probably result in 5 user pt */
    if (mem_avail > MINAPPMEM)			/* 256K extended */
      lol = wanttable*PAGE2PARA;
    else {
      if (lol > wanttable*PAGE2PARA+SAVEPARA)
        lol -= SAVEPARA;			/* Reserve extra DOS memory */
      mem_avail += (lol >> 8) - wanttable;
    }
  }
...
}

As i understand this condition ( if (lol < wanttable*PAGE2PARA) ) is false
for big amount of memory (if largerst free memory block is bigger than 
wanted pagetable). What if always reserve SAVEPARA os DOS memory for 
applications:

-  if (lol < mintable*PAGE2PARA + extrapara)     /* 1 PD, 1 PT (real), 1 PT (us
+  if (lol < mintable*PAGE2PARA + extrapara + SAVEPARA)
    goto mem_exit;

and then lol -= extrapara + SAVEPARA; and no additional test for 
/* Reserve extra DOS memory */; lol += extrapara;

So SAVEPARA would always be reserved for applications (with no hardcoded 
CWSDPMI 128Mb limit) and it wouldn have very simple meaning: reserved DOS
memory. Right now this SAVEPAR doesnt make sense for computers with big 
memory amount or if many drivers are installed because pagetable takes 
all DOS memory.
Where am I wrong ?

Sincerely,
Michael

- Raw text -


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