www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/09/20/01:28:27

From: Matthias Grimrath <y0001032 AT ws DOT rz DOT tu-bs DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Physical Memory Addresses
Date: Thu, 19 Sep 1996 15:51:09 +0200
Organization: TU-Braunschweig, Rechenzentrum
Lines: 25
Distribution: world
Message-ID: <32414FCD.380F@ws.rz.tu-bs.de>
References: <9609180832 DOT AA26846 AT leopard DOT proteon DOT com>
NNTP-Posting-Host: rz0cosv0.rz.tu-bs.de
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Neil Jarvis wrote:
> ...
> NOTE: You must run your program with protecton level 0, i.e. use
>       CWSDPR0.EXE or PMODETSR.EXE as your DPMI servers. This disables
>       virtual memory, and prevents malloced data from being swapped to
>       disk.

Using CWSDPR0 or PMODETSR doesn't guarantee you are running at level 0.
If there is already a DPMI host present (for example Win95), you 
run at ring 3 with everything virtualized.

> 
> MORE NOTES: the _my_cr3() routine will cause a general protection
>       violation if the code is not executed at protection level 0 This
>       means that you cannot run this code from within GDB - e.g. no
>       debugging.....
> ...

Reading cr3 assumes that paging is enabled. That is true in most cases,
but not necessarily under PMODE. I suggest _my_cr3() to check if paging
is enabled; if so, go on like before, else just return the linear
address. (which also is the physical)


Regards

- Raw text -


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