Mail Archives: djgpp/1999/09/26/08:43:27
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 -