Page 1 of 1

How to test Paging?

Posted: Mon Jul 21, 2008 11:49 pm
by leledumbo
I've set cr3 to point to my pagedirectory and set 31th bit of cr0 to enable paging. Nothing wrong, everything runs smoothly. But, how do I know if it works?

Re: How to test Paging?

Posted: Tue Jul 22, 2008 12:00 am
by thooot
Try setting two virtual address to point to the same physical page. Then write to the page using one address and check if the other one can read it.

Re: How to test Paging?

Posted: Tue Jul 22, 2008 12:40 am
by leledumbo
Just to clarify, is this correct?

Code: Select all

type
  PageTable: PLongWord; // pointer to unsigned 32-bit Integer
var
  PageDirectory: array [0..255] of PageTable;
... // assume that PageDirectory has been initialized
var
  p,q: PageTable;
begin
  p:=PageDirectory[5];
  q:=PageDirectory[5];
  p^:=255;
  WriteLn(q^);
end;