Date: Tue, 3 Oct 2000 14:54:55 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Haim Cohen 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.