chapter 18 - paging: introduction Flashcards
what is paging in virtual memory
Divides virtual and physical memory into fixed-size units
What does the page table do?
It maps each virtual page number (VPN) to a physical frame number (PFN)
Why is paging better than segmentation?
No external fragmentation
Simpler memory allocation
No assumptions about memory layout
How does the OS track which page frames are free?
It maintains a free list or bitmap of available frames
What are the two parts of a virtual address in paging?
VPN (Virtual Page Number) - frist 2 bits
Offset (position within the page)
What is the formula for calculating the physical address?
Use VPN to look up PFN in page table
Combine PFN and offset
What is the purpose of the Page Table Base Register (PTBR)?
Holds the starting address of the process’s page table in memory
What is the valid bit in a PTE?
Indicates whether the page is valid (in memory). If 0 → segmentation fault
What is the present bit in a PTE
Indicates if the page is currently in physical memory (vs. swapped out to disk)
What is the dirty bit in a PTE?
Tells whether the page has been modified since being loaded into memory
What does the reference/access bit track?
Whether the page was recently accessed → used in page replacement algorithms
What are the protection bits in a PTE?
Define allowed operations: read (r), write (w), execute (x) → protect