Re: Demand paging

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

 



At 11:46 PM 10/1/2002 +0200, Pere wrote:
On mar, oct 01, 2002 at 06:14:30 -0300, Rik van Riel wrote:
> Yes, but it leaves out one important detail.   Page tables are
> multiple levels.
>
> This means a process has present / non-present pointers to page
> tables, in a higher level page table called page directory.
>
> kind regards,

Aha! I missed out that the page directory has a present/not present flag
too. This way, when a process tries to access a directory entry that is
has its "not present" flag active, it generates a page fault, and the OS
allocates a new page table for that entry, then generates more page
faults, each of them makes the os to allocate a new page in physical
memory.

Then, you can start a process with a page directory (4kb), and one page
table (4kb), and the OS will generate the page tables as needed via page
faults.


I'd like to get confirmation on what you do start with.  Is it a single 4kb area of page directory entries with all nulls there?  Or 1024 filled (4 byte) entries with valid info like the 4 bytes you describe below?  Where is this initialization performed in the source code that does this?


In fact, (i'm talking on i386) the page directory entry and the page
table entry are the same:


   ----------------------------------------
   | Address   |         D|A|PCD|PWT|U|W|P|  
   ----------------------------------------
   31          12        6 5 4   3   2 1 0

I don't know if I get it right now.

Thanks people, you're very kind.

-- 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