delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/26/08:43:27

Date: Sun, 26 Sep 1999 08:28:13 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: johnny_chan AT phoenix DOT com
cc: djgpp AT delorie DOT com
Subject: Re: How to get the full address map of physcial RAM in DJGPP
In-Reply-To: <vines.Vm1E+iTburB@ptlsjlab1.phoenix.com>
Message-ID: <Pine.SUN.3.91.990926082305.17688K-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 Thu, 23 Sep 1999 johnny_chan AT phoenix DOT com wrote:

> I am brand new in protected mode programming. Here are some questions.

Please try to press [Enter] from time to time when you type your 
messages.  Those horribly long lines are a royal pain to read.

> As we all known, under 32bit protected mode, the system address bus can 
> support up to 4GB of memory, but physically, only certain amount of RAM 
> (32, 64, 128MB..etc) is existed. How can I get the full address map of 
> the system RAM?

You need to access the page directory and the page tables used by the 
processor to map memory.  The instructions to do that are privileged, so 
you cannot issue them from a ring-3 program (which is how DJGPP programs 
are run by default).  If you do this on plain DOS (as opposed to 
Windows), use CWSDPR0 as your DPMI server.  CWSDPR0 runs your program in 
ring-0, so you can use any privileged instruction you need.

> Also, how do I know if which portion of memory is used for system (ie 
> IO.SYS) and driver (VGA.BIN)?

For the conventional memory, you need to walk the DOS memory chain, it 
gives you information about size of memory blocks and their owners.

For protected mode, it is memory manager and DPMI host specific.

- Raw text -


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