delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/04/16:41:32

Date: Mon, 4 Oct 1999 19:20:45 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Prashant TR <prashant_news AT yahoo DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Finding physical memory size
In-Reply-To: <19991004153356.8405.rocketmail@web1406.mail.yahoo.com>
Message-ID: <Pine.SUN.3.91.991004191338.26509A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 4 Oct 1999, Prashant TR wrote:

>   Is there any means by which I can find out my total
> physical memory size other than through DPMI ?

Not in general, at least I don't know how.  BIOS can help, but only if 
the total amount of memory is less than 64MB.  XMS calls can help, but by 
the time your DJGPP program runs, the DPMI host might have taken all or 
part of the extended memory to itself, so you won't see the true number.

Why do you need this?  Perhaps your real problem could be solved by other 
means?

> I find
> that some DPMI hosts like WINDPMI lie when I ask for
> this information ? Ok. At least, how do I know that
> I'm running CWSDPMI (from my program) ?

You could walk the DOS memory chain and look for CWSDPMI's copyright 
string.

>  I mapped the entire extended memory (my RAM size -
> 1M) to some variable "x". I'm using nearptr. But I get
> a SIGSEGV when I try to access the address
> x[__djgpp_base_address].

Please post a short complete test program that shows how do you do this.  
It is possible that you didn't do everything to allow access to all 
memory.

> I know it's in use by the
> program code, but is there a work around to this ?

Work-around for what?  If you did everything correctly, you should be 
able to access the program's code without a SIGSEGV.

- Raw text -


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