From: Matthias Grimrath 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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