www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/18/19:15:14

Date: Fri, 11 Nov 1994 06:48:34 -0500 (EST)
From: Martin Miller <MRMILLER AT delphi DOT com>
Subject: dpmi and virtual memory and win 3.1
To: djgpp AT sun DOT soe DOT clarkson DOT edu

Greetings all,
 
I recently downloaded and installed djgpp up to 1.12.maint2 and things
seem to be mostly working -- and have compiled and run several simple
test programs.
 
As part of my testing I ran the following program in a DOS box under
Windows 3.1 as well as from the normal system command line (ie NOT 
under Windows):
 
    #include <stdio.h>
    #include <malloc.h>
 
    #define MAXKB (8*1024)
 
    int main()
    {
        int kb = 0;
 
        while( kb < MAXKB && malloc(1024) )
            printf( "  allocated %5d kb\r", ++kb );
 
        return 0;
    }
 
 
As you can see, the program simply trys to allocate 8192 1K blocks, or
8 Mb.  The idea was to verify that virtual memory worked -- because
this is more physical memory than is free on my system after
booting-up.
 
I ran the program with the GO32 environment variable set to "nodpmi",
in addition to not specifying it, which I assume causes dpmi to be used
if it's available.
 
My conflicting results were:
 
Normal DOS:
===========
    default:    fails after allocating approx 4 Mb with the 
                  message "DPMI: Not enough memory"
    nodpmi:     ran sucessfully
 
Win DOS box:
============
    default:    ran sucessfully
    nodpmi:     won't run at all with some message about being in V86
                  mode
 
(the actual amount allocated in the cases that failed was not exactly
the same, although I don't think that's important)
 
I'm using DOS 6.2 and QEMM 7.04 with QDPMI,SYS installed, so dpmi
support should be there even when not using a Windows DOS box, right?. 
Plus, isn't virtual memory suppose to work, regardless of the presence
of dpmi (assuming you have the disk space)?  Is there some way to set
GO32 so that the program would work whether or not it was run from
Windows or not?
 
Any ideas anyone?  What am I missing?
 
----
 
Thanks,
 
Martin                              mrmiller AT delphi DOT com

- Raw text -


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