Paging

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Mr_X

Paging

Post by Mr_X »

Does anybody have code/tutorials on setting up Paging?  I know how it works but I can't find any information on how to set it up.
carbonBased

RE:Paging

Post by carbonBased »

All you've gotta do is setup your page tables/directories in advance, load CR3, and set PG in CR0.

Check out the sources for GazOS, I believe it enables paging, and I believe that's what I learned (learnt?) from.

Personally, I'd recommend enabling paging while preserving the location of all the memory pages (ie, no remapping... just map all the pages where they'd be with paging disabled) at first... just for testing purposes.  Makes it easier... then fiddle around with it.  Just my $0.02

Jeff
Mr_X

RE:Paging

Post by Mr_X »

Thank you.
I load CR3 with what? The address of PDE?
carbonBased

RE:Paging

Post by carbonBased »

Oops... I totally skipped right over that part... :)

Bits 11->31 of CR3 contain the (4KB Aligned!!!) physical address of the page directory.

Bits 0->11 are all reserved if you're on an 386.  486+ processors define PWT (Bit 3) and PCD (bit 4)

PWT = Page Write-Through
PCD = Page Cache Disable

Hope that helps.

Jeff
pete

RE:Paging

Post by pete »

Take a look at Intel's Developer Manuals (http://developer.intel.com). I believe Volume 3 of the Pentium manuals digs deepest in covering paging and related features.
Post Reply