GATE CS 2024 Set 2 | Question 24

MSQ · 1 mark

Which of the following tasks is/are the responsibility/responsibilities of the memory management unit (MMU) in a system with paging-based memory management?

  1. Option A: Allocate a new page table for a newly created process
  2. Option B: Translate a virtual address to a physical address using the page table (correct)
  3. Option C: Raise a trap when a virtual address is not found in the page table (correct)
  4. Option D: Raise a trap when a process tries to write to a page marked with read-only permission in the page table (correct)

Answer

(B), (C), (D)

Explanation

The MMU is the hardware between the CPU and memory that handles every memory reference. Its jobs are the ones done on each access:

  • B: it translates each virtual address to a physical address through the page table, with the TLB caching recent translations.
  • C: if the page table entry is invalid or not present, it cannot translate the address and raises a trap (a page fault) for the OS to handle.
  • D: it checks the protection bits on every access and traps when a process writes to a read-only page.

A is not an MMU task. Creating a process and allocating and filling its page table is done in software by the operating system kernel; the MMU only uses the table the OS has set up, for example through the page-table base register.

Answer: B, C, D