<aside>
💡
Summary of Section 8.1: Principles of Virtual Memory
</aside>
Demand Paging
- Virtual Memory (VM) allows programs to use a logical address space larger than physical memory.
- Demand Paging loads only the required pages into memory on demand.
- Present Bit (p):
- p = 1 → Page is in memory.
- p = 0 → Page is on disk (not in memory).
- Page Fault:
- Occurs when a process accesses a non-resident page.
- The OS loads the missing page from disk into memory.
🔹 Advantage: Reduces memory usage by only loading necessary pages.
Page Replacement
- When physical memory is full, a resident page must be replaced when a page fault occurs.
- Modified Bit (m):
- m = 1 → Page has been modified; must be written back to disk.
- m = 0 → Page is unchanged; no need to write back to disk.
🔹 Goal: Minimize disk I/O by avoiding unnecessary writes.
Paging of Tables
- Challenge: Large virtual memory requires large page tables, which consume space.
- Solution: Page the page table:
- Multi-level Paging: Splits page tables into smaller pages.
- Paged Segment Tables: Segments are divided into pages to reduce memory overhead.
🔹 Benefit: Saves memory by storing only necessary parts of page tables.
Exercises and Applications
- Address Translation:
- Convert virtual addresses to physical addresses.