delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/10/21/18:16:02.1

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Charles Sandmann <sandmann AT clio DOT rice DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: HELP with DPMI under DOS - Conclusion
Date: Tue, 21 Oct 2003 16:32:04 CDT
Organization: Rice University, Houston, TX
Lines: 69
Message-ID: <3f95a5d4.sandmann@clio.rice.edu>
References: <AGMkb.445$947 DOT 280 AT nntpserver DOT swip DOT net> <3f944c94 DOT sandmann AT clio DOT rice DOT edu> <Wnflb.52$uv1 DOT 49 AT nntpserver DOT swip DOT net>
NNTP-Posting-Host: clio.rice.edu
X-Trace: joe.rice.edu 1066773633 16612 128.42.105.3 (21 Oct 2003 22:00:33 GMT)
X-Complaints-To: abuse AT rice DOT edu
NNTP-Posting-Date: Tue, 21 Oct 2003 22:00:33 +0000 (UTC)
X-NewsEditor: ED-1.5.9
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

> I success to allocate 1022Mb with cwsdpmi5 with swap file, and with pmode13.

That's about what I would expect.  The first megabyte is DOS area, and the
DJGPP image itself has code, a (big) stack, etc.

> Under pmode the  _go32_dpmi_remaining_physical_memory() report 4Gb avaiable,
> (I have 1Gb installed).

There are some features which aren't completely implemented (or don't work
properly) in pmode.

> I notice that sbrk uses integer so I suppose that it as the same limit of
> 2Gb of malloc.

Well, lets say it's a *fuzzy* integer.  I don't think these features have
all been tested (or documented), but here goes the explanation...

It takes the current end of the address space and adds the number you
send it in an unsigned way, then sets that to be the new end of memory
value.  For values (and increments) in the first 2GB, everything is 
normal.  If you send it a 3GB request, the integer you sent is actually
negative, but results in a positive original_size+3GB value.  In theory
at least.  If this doesn't work in reality, then asking for 1.5GB twice
should work (they will be contiguous since you are using sbrk()).

Negative sbrk() values are for people who really know what they are
doing, and I don't really want to explain what happens here, but they
also work.  If your DPMI provider fragments memory, sbrk() may not do
what you expect if you send it negative or big fluffy numbers (cwsdpmi
shouldn't cause these problems).

> If I buy more RAM bringing my system memory to 3Gb I can use sbrk?
> (Maybe I will try and maybe I will Charles let know).

I'm pretty sure there is code in cwsdpmi which will limit you to 2GB
physical right now, since I wanted to know (and help...) anyone trying 3GB.

I have run tests using 2GB physical and 1GB virtual just to see what 
broke when I tried big address spaces.  In all cases there is a design
limit in CWSDPMI which will hold you to 3.75GB.  If this is a huge problem
I can change a define and make it closer to (but never exactly reaching) 4GB.

In any case, I would suggest trying sbrk() and your code with virtual 
memory first before buying 3GB (if it works at all, I know I can get
the memory working).

I have never tried pmode on a machine with more than 2GB, so I don't know
if it just works, or has problems.  I have heard that some HIMEM/XMS 
providers have problems (or truncate) at 2GB so you might need to run
in a "raw" mode.

> Filosophic question.
> I'm really interested in performance to get the best from my PC.
> It is the pmod with djgpp with Dos the best I can get?

As close as you can probably measure.  cwsdpmi with 4MB pages is close
unless you are doing lots of interrupts.

> What about a real 32bit enviroment like Dos32 (if it is) ( I see there is a
> "dos32 extention for djgpp"),

pmode will be faster.

> or a simple linux boot disk with single user and no multitasking.

depending on what you are doing, this will either be slower or faster.
If you make many system calls, it might be faster.  If you are compute
bound for long periods touching lots of memory, it would be slower.

- Raw text -


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