Mail Archives: djgpp/2000/10/24/14:56:49
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 -