linux - How does OS locate contents on disk that have not been loaded into memory when page fault exception is raised? -
When a page fault exception is raised, because the content is trying to access the CPU, then not loaded in memory
Short Scale: Address of invalid PTE will mapped to offset within bits of secondary storage (swap file).
Long version: In order to understand what happens there, make a very quick recapitulation on the activities of virtual-to-physical translation. I will discuss the answer on the x86 platform.
In the CR3 processor register, there are 20 bit allocated to indicate the beginning of the page directory, the top 10 bits of the virtual address are used to access the page directory entry (PDE) address, which is used for page table entries ( PTE), the next 10 bits in the address encode which refers to the actual physical page in Pte. The last 12 bits are offset within the page.
When the operating system displays a page from memory, PTE is marked as invalid, and the PTE address bits are offset in the page file (basic question).
This becomes a bit more complicated with the memory map file, because they use prototype Pte.
If you are interested in more information, then I firmly recommend Mark Rusynovich "Windows Internal" book.
Comments
Post a Comment