Os Questions Flashcards
Explain two reasons why two CPUs running the same ISA at the same clock speed could show different performance.##Different microarchitecture designs (e.g.
deeper pipelines
Describe the steps taken by an operating system when handling a hardware interrupt.##1. Save current CPU state
- Switch to kernel mode
What advantages does virtual memory provide to application programs? Give two reasons.##Allows programs larger than physical RAM to execute
and isolates processes for better security and stability.
In a system using multiprogramming
why might the CPU be idle even when there are jobs in the system?##Processes may be waiting for I/O operations to complete; without ready jobs in memory
A batch system always loads the next job from tape onto memory after one job completes. What is the major limitation of this setup?##The CPU remains idle during long tape I/O operations
leading to poor utilization and wasted processing power.
State two advantages of preemptive CPU scheduling compared to non-preemptive scheduling.##1. Improves response time for short interactive processes. 2. Prevents CPU hogging by long processes.
Explain how starvation can occur in a system using priority scheduling.##Low-priority processes may be indefinitely postponed if higher-priority processes keep arriving
preventing their execution.
In the context of critical sections
explain what is meant by bounded waiting.##There must exist a limit on the number of times other processes can enter their critical section before a waiting process gets access.
Give two reasons why deadlock prevention by disabling Hold and Wait condition can be inefficient.##1. Processes may have to request all needed resources at once
leading to low resource utilization. 2. Processes might hold resources they don’t immediately need
How does imposing a resource ordering prevent deadlock?##Processes are forced to request resources in a predefined order
preventing circular wait from forming.
What does the Banker’s Algorithm require in order to operate correctly?##It requires knowing the maximum resource demands of each process beforehand to check if granting a request will leave the system in a safe state.
What is the role of the MMU (Memory Management Unit) during virtual memory address translation?##The MMU maps virtual addresses to physical addresses
ensuring isolation and enabling paging or segmentation.
Describe the action taken by an OS when a process issues a system call.##The process triggers a software interrupt (trap)
the CPU switches to kernel mode
Why is aging an important mechanism in priority scheduling?##Aging gradually increases the priority of waiting processes
ensuring that all processes eventually get CPU time and preventing starvation.
What is the function of a bootstrap loader stored in ROM?##The bootstrap loader initializes system hardware and loads the OS kernel into memory during system startup.
A CPU uses a round-robin scheduler with a time quantum of 10 ms. What will happen if the time quantum is significantly reduced to 1 ms?##Context-switching overhead will increase
reducing effective CPU utilization and causing performance degradation.
Describe what happens during context switching at a high level.##The OS saves the state (registers
program counter) of the current process and loads the state of the next scheduled process.
State one reason why a register-based machine might be faster for certain applications compared to a stack-based machine.##Register machines can access operands directly without the overhead of pushing and popping values from a stack
leading to faster arithmetic and memory operations.
What is the main advantage of using multilevel feedback queue scheduling over fixed multilevel queues?##Processes are dynamically reclassified between queues based on observed behavior
improving responsiveness and fairness.
What is meant by safe state in deadlock avoidance
and why is it important?##A safe state ensures that the system can allocate resources in some order so that all processes can eventually complete