OS & Hardware

Many OSes map the kernel into part of every process's address space (for example the upper range) and forbid user-mode access through page-table protection bits. What is the main advantage of this layout?

  1. AEntering the kernel needs no address-space switch
  2. BApplications can call kernel functions directly without system calls
  3. CEvery process can freely modify and share kernel memory
Show answer and explanation

Answer: A. Entering the kernel needs no address-space switch

Mapping the kernel identically into every process lets system calls and interrupts reach kernel code and data immediately without switching page tables or flushing the TLB. User-mode access is forbidden by the page-table protection bits, so applications cannot call kernel functions directly or modify kernel memory. A breach of this protection would be a serious vulnerability.

  • A. Correct. Entering the kernel needs no address-space switch.
  • B. Protection bits forbid it, so kernel functions cannot be called directly.
  • C. User mode cannot modify kernel memory.
Practice this topic Back to topic

More OS & Hardware questions

  1. With a 4 KB page size, how many virtual address bits represent the position within a page (the offset)?
  2. With 4 KB pages, which pair gives the page number and offset of the 32-bit virtual address 0x00403ABC?
  3. Which set of operating modes is defined by the RISC-V privileged architecture?
  4. When returning from an interrupt or exception handler, why is a dedicated return instruction (such as RISC-V's sret or mret) used instead of an ordinary function return?
  5. In a system requiring real-time behavior, which factor most increases interrupt latency, the time from an interrupt occurring until its handler starts?