Mail Archives: djgpp/2001/05/24/01:15:15
> I'm trying to maximise the amount of conventional (below 640k) memory
> for a program that I 'shell' from a DJGPP program using the system
> library function. Operating system is MSDOS 6.22. It seems that the
> DJGPP program takes about 92k of conventional memory, estimated by
> taking the difference between a 'mem' command typed at the DOS prompt
> and one shelled from my program. I'm using the CWSDPMI extender. Any
> ideas welcome.
Ways to minimize conventional memory:
1) Stubedit your executable and change the transfer buffer to 4K bytes
(or less, 2.5K used to be the minimum).
2) Stubedit your executable and change the DPMI provider name. Copy
CWSDPMI.EXE to that new name. Read CWSPARAM documentation and you
can cut some memory from what it uses. (You could also do the same
with CWSDSTUB for a single exe image with hacked parameters).
If I remember correctly you should be able to lower the total memory usage
for a DJGPP application to around 64K or so; if you have UMBs available
most of that 64K can go in the UMBs. Really aggressive tuning may get
the size smaller. I remember at one time proving a DJGPP image could run
in something like 70Kb total memory in an early release ...
In particular, if your system has lots of memory or disk CWSDPMI allocates
bitmaps and page tables anticipating you will want to use much of it, but
if you only need 4Mb of DJGPP address space you can trim all that memory
usage. It's also built to handle lots of memory allocation requests and
lots of DPMI nesting - you can also trim memory from the "extra paragraphs"
to make more space. You can manually specify the number of page tables
and disable swapping for more memory.
Have fun.
- Raw text -