Demand Paging: Amna Ahmad Muhammad Mustafa
Demand Paging: Amna Ahmad Muhammad Mustafa
Demand Paging: Amna Ahmad Muhammad Mustafa
Amna Ahmad
Muhammad Mustafa
What we’ll cover today
• pages are loaded only when they are demanded during program
execution.
1. We check an internal table (usually kept with the process control block)
for this process to determine whether the reference was a valid or an
invalid memory access.
2. If the reference was invalid, we terminate the process. If it was valid but
we have not yet brought in that page, we now page it in.
3. We find a free frame (by taking one from the free-frame list, for
example).
4. We schedule a secondary storage operation to read the desired page into
the newly allocated frame.
5. When the storage read is complete, we modify the internal table kept with
the process and the page table to indicate that the page is now in memory.
6. We restart the instruction that was interrupted by the trap. The process
can now access the page as though it had always been in memory
Pure demand paging
01 02
Page table
Secondary memory
This memory holds those This table has the ability
pages that are not present in to mark an entry invalid
main memory through a valid–invalid
bit
Free Frame list
Where,