In RISC-V, how can the kernel safely transition from kernel space to user space?
OS Processes Online Quiz Questions
Use this free practice quiz with 20 questions to review OS Processes, test your knowledge, and prepare for your next test or exam.
Select all statements that accurately describe traps as defined here.
- A
A trap can be triggered by executing an instruction in user space.
- B
A trap can be used to request a kernel-only service, such as writing to a file.
- C
A trap is triggered by an external event, such as input arriving from a peripheral.
- D
A trap can cause the kernel to handle an error in a user process, such as an illegal instruction.
- E
A trap is a transition from kernel space to user space.
Kernel-space code can access any process’s memory, while a user process should have access only to its own memory and must request the kernel to perform operations such as I/O.
- A
True
- B
False
What is the name of the data structure the kernel uses for each process in its process list?
A scheduler balances fairness, turnaround time, and —giving processes a chance to react quickly to relevant outside events.
Compare cooperative and preemptive multitasking. Explain how yield lets the kernel regain control in a cooperative system, how hardware interrupts do so in a preemptive system, and one limitation of relying on yield.
Assuming a single CPU core, which description best explains how time multiplexing shares execution among processes while preserving the illusion of continuous execution?
- A
It executes instructions from every process simultaneously and assigns each process separate physical registers.
- B
It runs each process to completion before starting another, so no switching is necessary.
- C
It runs one process at a time, periodically switches the active process, and saves and restores the program counter to help preserve the illusion of continuous execution.
- D
It gives each process unrestricted access to the kernel’s memory so the processes can take turns.
An executable is an inert file, but running the same executable more than once can create concurrent processes that share instructions and constant data while having separate heaps and stacks.
- A
True
- B
False
After restoring a process’s saved register values during a context switch, which register identifies the instruction where execution resumes?
In RISC-V, the kernel runs in , while user-space processes run in the less-privileged .
How does the kernel safely transition from kernel space to user space in the described RISC-V model?
- A
The kernel runs user code at supervisor privilege and relies on the program not to use privileged instructions.
- B
The kernel explicitly lowers privilege before jumping to user code; in RISC-V, it can use a privileged control status register or
sret. - C
A user process executes
ecallto lower the CPU's privilege before the kernel jumps to user code. - D
The CPU switches to user mode only after a timer interrupt occurs.
In the definitions used here, a trap is triggered by instruction execution, while an interrupt responds to a non-instruction signal.
- A
True
- B
False
What is the term for sharing a single CPU core by running one process at a time and periodically switching which process is active?
What best describes the role of a process control block (PCB)?
- A
It contains only the process's executable path and launching user.
- B
It stores the instructions and constant data shared by every process created from the same executable.
- C
It stores information needed to run and manage the process, including identifying information, saved registers, and scheduling status.
- D
It contains only the current process's stack and heap.
A user-space process has unrestricted access to all computer memory and can perform I/O without asking the kernel.
- A
True
- B
False
Which scheduling objective means giving processes a chance to react quickly when events such as mouse movement or a network packet arrival occur?
Which statement correctly defines a trap in the terminology used here?
- A
A trap is a transition from user space to kernel space triggered by executing an instruction.
- B
A trap is a transition triggered only by an external I/O event.
- C
A trap is a switch from one ready process to another without entering kernel space.
- D
A trap is a transition from kernel space to user space that raises privilege.
Which statement correctly distinguishes an executable from a process?
- A
An executable is a running instance of a program, while a process is the inert file stored on disk.
- B
Running an executable repeatedly creates processes that share the same heap and stack.
- C
A process is a file that can be copied or attached to an email, while an executable exists only during program execution.
- D
An executable is an inert file; running it creates a process, and separate processes can share instructions while having different heaps and stacks.
Which set lists the three competing objectives that a process scheduling policy must balance?
- A
Fairness, turnaround time, and responsiveness
- B
Memory protection, file size, and CPU clock speed
- C
Instruction count, disk capacity, and process age
- D
Kernel access, user access, and network bandwidth
At the start of a context switch, what does the OS do to the currently running process?
- A
Restore the selected process’s registers, then save its current state in the PCB.
- B
Change the current process to terminated, then select a blocked process.
- C
Save the current process’s registers, including the program counter, in its PCB, then change its status from running to ready.
- D
Select another process and resume it without restoring its saved register values.
Related study packs and tools
- Study guide
02 — Information and Representation
A progressive guide to how computers encode numbers, text, images, and sound as binary data, including the trade-offs and limits of digital representation.
- Quiz
2 Digital Logic
A 14-question medium-difficulty quiz on Boolean algebra, logic gates, truth tables, and combinational circuits.
- Flashcards
03 — Python Programming Fundamentals
A focused set of flashcards covering Python variables, data types, expressions, control flow, functions, input, output, and common programming practices.
- Study guide
3 CPU Architecture
Learn how registers, the ALU, datapath connections, and control logic work together to fetch and execute CPU instructions.
- Study guide
05 — Data Structures: Concepts, Operations, and Trade-Offs
A structured guide to the main data structures, their operations, efficiency trade-offs, representations, and practical selection criteria.
- Study guide
6 Computer Memory
Learn how computer memory stores and addresses information, how RAM and ROM differ, and how caches and the memory hierarchy balance speed, capacity, and cost.
- Study guide
07 Trees and Binary Search Trees
A progressive guide to tree structure, binary-tree traversals, binary search tree operations, deletion, balancing, and the way tree height determines time and space costs.
- Flashcards
08 — Discrete Mathematics for Computer Science
A focused review of propositional logic, quantifiers, sets, relations, functions, and foundational proof methods in discrete mathematics for computer science.
- Study guide
8 Software Documentation
Learn how to choose, structure, document, and maintain software documentation for users, developers, integrators, and operators.
- Study guide
9 Sorting Algorithms
A structured guide to comparison-based sorting algorithms, their complexity, stability, memory use, and practical selection criteria.
- Study guide
10 — Data, Systems, and Applications
A progression through how data is organized, searched, exposed through software interfaces, and managed through abstraction layers in modern computer systems.
- Quiz
12 — Foundations Capstone
A medium-difficulty quiz on integrating problem definition, representation, algorithms, complexity analysis, testing, correctness, ethical evaluation, and documentation in a computer science capstone.