Re: Demand paging

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

 



On mar, oct 01, 2002 at 08:10:05 +0100, Mark Zealey wrote:
> I dont think it actually makes the page tables unless the process trys to access
> some memory in that area, then it causes a page fault and linux creates the page
> tablefor that memory area and then a page of memory for the process to use.


Well, the page tables must exist to map the virtual memory to physical
memory. In each entry of the page table there is a flag indicating if
the page is present or not. This way, when a process tries to access a
memory location that is not mapped into physical memory, the system
generates a page fault, and the OS knows that it must allocate a new page.


     Page Table

    |-----------|   0x0000
    |Present    |
    |-----------|   0x1000
    |Not Present|
    |-----------|   0x2000
    |Not Present|
    |-----------|   0x3000
    |Present    |
    |-----------|




Let's say process A wants to access the contents of memory location
0x1002, which is on page 1 (let's assume a page is 4kb long). Page 1 is
not present. So, via a page fault, the operating system allocates
physical memory and assigns that table to that block of 4kb.

I think this combines with the ldt (local descriptor table). In this
table, you specify how long will be the memory segment for data, code
and stack. You could start a process with a virtual space of 1 or 2
MBytes by writing the appropiate values into his ldt and based on this,
you would only need one page table (one page table takes 4Kb for
addressing 4MBytes).

Is this correct?

-- 
$ fortune
There are three things I always forget.  Names, faces -- the third I
can't remember.
		-- Italo Svevo
$ 
--
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