Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

1Learning Outcomes

In this section we discuss:

We leave the description of the system performs address translation to this section.

We discuss the fine-grained details of page tables in another section.

2Address Translation, Conceptually

2.1Case I: Page Is In Memory

Consider a scenario where a process has a 32-bit virtual address space, and physical memory is 16 KiB and paged into four 4 KiB pages. There are four steps to address translation, as shown by Figure 1’s animation. Fow now, conceptually, a page table entry is valid if it has a physical page number (PPN) and invalid if it is labeled “disk”.

Figure 1:Address Translation, Case I: The target page is in memory.

This case is predicated on our page table entry being valid. A valid page table entry means that the virtual page has a corresponding physical page number, and therefore the page is in memory. Next, let’s explore when the page is not in memory.

2.2Case II: Page Fault

We continue our scenario with the same process. Now, suppose that the next memory access triggers a page fault, as shown in Figure 2’s animation.

Figure 2:Address Translation, Case II: The target page is not in memory, triggering a page fault. With demand paging, a page fault means the page is fetched from disk.

2.3Revisiting the Library Analogy

Let’s understand virtual memory using our library analogy of the memory hierarchy.

This analogy breaks down slightly because the page table is a page number lookup, not an address lookup. But we hope the weak analogy helps.

3Practice

Footnotes
  1. Jim Gray’s analogy figure for your reference.