Date: Sun, 26 Sep 1999 08:28:13 +0200 (IST) From: Eli Zaretskii 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: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.