i386 paging question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  Hello all,

  I'm trying to understand how i386 paging works and how Linux uses it.  
To that end I'm trying to follow by hand how an address works its way through
the paging system to come up with a physical address.

  Now, for example purposes I've chosen the address 0xC0100000, which is the
_text symbol in the kernel (since I know that will have real data behind it).
>From what I can tell, this address works out to be in directory entry 0x300,
table entry 0x100, offset 0x0.  

  So I look at system_pg_dir + 0x300*4.  The value there is:

(gdb) x/t &swapper_pg_dir+0x300 (gdb knows to multiply 0x300 by 4) 
0xc0404c00 <swapper_pg_dir+3072>:       00000000000000000000000111100011

  Here's where I'm going wrong.  From what I can tell, this means that the
address of the page table for this block of memory resides at 0x0.  So you
take 0x0 and then add the table entry from the address *4, and you get:

(gdb) x/t 0x0+0x400
0x400:  Cannot access memory at address 0x400

  So obviously I am misunderstanding how the page table base address located
in the page directory entry is interpreted.  Can someone please set me straight
on this?  I already knew that the page table base address couldn't be right,
because as far as I know the first portion of memory is more or less 
unusable.

  Thanks,
  Steve.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux