Re: Detecting total RAM size via BIOS

From: Matt Taylor (para_at_tampabay.rr.com)
Date: 04/27/04


Date: Tue, 27 Apr 2004 18:31:59 +0000 (UTC)


"Jeremy Harrison" <jeremy@lava.net> wrote in message
news:108r120h4idu7c3@corp.supernews.com...
> In follow-up to the post below, I hope someone might be able to help me
> with my problem. I am trying to write a routine that will return the size
> of RAM on the host computer. I need it to run from a command prompt, and
> I need it to work on each OS from Windows 95 through XP. As an analog,
> WinMSD returns the wished for information (along with a lot of other
stuff)
> on machines that have WinMSD (2000/XP). I want to roll a "specialized"
> application that will only return the total RAM size. I write my
> routines in PC Assembly; my suspicion is that I can get RAM information
> by peeking in at some port. I just haven't been able to determine which
> one...

Such was true of DOS, but it is not true of Windows. Windows provides that
information through the GlobalMemoryStatus/GlobalMemoryStatusEx APIs. (See:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/memory/base/globalmemorystatus.asp )

You will find this is the case for a lot of information. If it isn't
available through Win32 APIs, it may still be available through NT APIs
which AFAIK are not supported on Win95/98/ME. If it isn't available through
NT APIs, it isn't available period unless you write a driver. Drivers run in
kernel mode, so they can access structures and memory that user mode can't.

-Matt


Quantcast