0

I know the high 10 bits used in virtual address of kernel.
thank you

lxgeek
  • 1,732
  • 2
  • 22
  • 33
  • See the accepted answer here: http://stackoverflow.com/questions/10671147/how-do-x86-page-tables-work – John R Jan 21 '14 at 14:47

1 Answers1

1

I think you're kind of confused. Kernel address space is above the 0xC0000000 address. Bits on page directory point to the page table. Something like this on 32 bits architecture with page size of 4KB:

  1. First ten bits in an address point to the Page Directory
  2. Second ten bits in an address point to the Page Table
  3. Last 12 bits in an address point to the Page

Let's see how it's done (roughly) for virtual address 0x2003ff01:

  1. First ten bits: 0x80 are added as offset to the Global Page Directory (pointed by cr3 register in x86 architectures). The address stored there must correspond to the process Page Table.
  2. Second ten bits: 0x3FF correspond to the Page Table. This offset is added to the page table pointer and you get the address of the Page you're looking for.
  3. Add last 12 bits to the pointer of the Page and you get the memory cell you were looking for.

This is more or less how the process is done in Linux. I missed a lot of specifications, just wanted to give a general explanation.

Hope this helps!

Paulo Bu
  • 29,294
  • 6
  • 74
  • 73