delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/15/01:06:43

From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: dos memory fun
Date: Thu, 11 Jan 2001 0:12:04
Organization: Rice University, Houston TX
Lines: 43
Message-ID: <3a5cfa54.sandmann@clio.rice.edu>
References: <b2676.2133$W_3 DOT 266121 AT news DOT uswest DOT net>
NNTP-Posting-Host: clio.rice.edu
X-Trace: joe.rice.edu 979537377 21730 128.42.105.3 (15 Jan 2001 05:42:57 GMT)
X-Complaints-To: abuse AT rice DOT edu
NNTP-Posting-Date: 15 Jan 2001 05:42:57 GMT
X-NewsEditor: ED-1.5.8
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> Program is targeted to run in a DOS only environment, using the standard
> CWSDPMI.

Do you have control of the DOS environment?  Can you specify the contents
of the config.sys?  Can you use UMBs?  Do you know how much DPMI memory is
needed by your DJGPP application before it launches the other program?  Will
the other program run with CWSDPMI providing DPMI services?

> Anyway, I need to launch a program, and once i've launched that, I'm done.
> problem is, i run into
> "CauseWay error 12 : Not enough memory to load application" which is a DOS
> error.
> 
> Now, this error is a result of there being only about 430K left below 640K
> while my program is running.  The program I need to call requires around
> 600K free.  Runs fine without my program running, but errors when called
> from inside my program.

This seems to indicate that the transfer buffer plus CWSDPMI are taking
210K of memory.   This would seem to indicate the machine has over 128Mb
of memory and CWSDPMI is taking too much for pagetables.  You can reduce
this using CWSPARAM.  You can reduce the transfer buffer size.  But to get
it all to fit you will need to use UMBs.  The base CWSDPMI code size is 40Kb,
a minimal transfer buffer would be 4Kb, and disabling virtual memory via
CWSPARAM, and setting the maximum number of pagetables could allow you as
little as an additional 16Kb of memory.  This is still around 60Kb of memory,
which is more than the 20Kb or so you indicate would be the maximum used,
so you will have to put CWSDPMI itself high (I think the stub will do this)
and the memory it allocates (CWSDPMI will do this).  If memory is very tight
you can also trim the extra internal paragraphs of heap for CWSDPMI.

> Running this situation in a DOS box under Win95 works fine, but that won't
> work for the end result.
> 
> Now, am I just screwed or is there memory management tricks I can use to
> make this work?
> I'm very un-familiar with memory management from a programming standpoint,
> but a few tips (if this is even possible) should point me in the right
> direction.

It won't work without UMBs.  You will need HIMEM.SYS, EMM386.EXE, and the
appropriate DOS=HIGH,UMB to get even close.  You will probably still need to
specify CWSPARAM custom values to cut the memory.

- Raw text -


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