OS & Hardware

What is the mechanism by which applications ask the OS to perform tasks such as file I/O?

  1. ASystem call
  2. BContext switch
  3. CDemand paging
Show answer and explanation

Answer: A. System call

Applications run in user mode and cannot operate disks or devices directly. They use system calls: a dedicated instruction switches to privileged mode and invokes the kernel to read or write files, allocate memory, create processes and so on, then returns to user mode. A context switch changes which process runs, and demand paging loads pages only when needed.

  • A. Correct. It is how applications request OS services.
  • B. A context switch changes the running process.
  • C. Demand paging loads pages when they are needed.
Practice this topic Back to topic

More OS & Hardware questions

  1. What happens when the ecall instruction at the end of the RISC-V code above executes?
  2. Which is the usual distinction between interrupts and exceptions?
  3. Which of the following is asynchronous, occurring at unpredictable times unrelated to the instruction being executed?
  4. What is the usual sequence when a CPU accepts an interrupt?
  5. What is the role of an interrupt vector table?