www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/10/03/09:01:52

Date: Tue, 3 Oct 2000 14:54:55 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Haim Cohen <haim DOT cohen AT ntel DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: get the amount of physical memory
In-Reply-To: <8rc97t$ec7@news.or.intel.com>
Message-ID: <Pine.SUN.3.91.1001003142803.12455B-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 3 Oct 2000, Haim Cohen wrote:

> Is someone know how to get the size of the available memory in the system by
> C/C++ standard routines or assembly commands ?
> I mean the physical available memory, the size that the BIOS detects on
> system boot.

On what OS?  Some of the platforms supported by DJGPP won't let you know 
that, no matter how hard do you try.

Also, do you need to know the total size of physical memory, or the 
amount that is free at the moment of the call, and for what purpose?

(There's a reason for these questions: finding the amount of memory under 
most modern OSes is tricky, and can easily produce misleading results.
Take a look at chapter 15 of the DJGPP FAQ list, for the details.)

The DJGPP library provides the `_go32_dpmi_remaining_physical_memory '
function for this purpose.  Another possibility is to call the function 
`_go32_dpmi_get_free_memory_information'.

As for the amount of memory recorded in the system's CMOS memory, code to 
access that was posted here several times in the past (it is advisable to 
search http://www.delorie.com/djgpp/mail-archives/ before posting 
questions).  One message that includes that code can be found at this URL:

  http://www.delorie.com/djgpp/mail-archives/browse.cgi?p=djgpp/1997/01/11/03:26:50

Note that, if your machine has more than 64MB of RAM installed, the code 
posted in the above URL will return RAM % 64MB.

- Raw text -


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