Mail Archives: djgpp/1996/09/20/01:28:27
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 -