CH1 MCQs Flashcards
(43 cards)
Which of the following is NOT a function of an operating system?
A) Managing hardware resources
B) Controlling peripheral devices
C) Running only one process at a time
D) Providing an interface for users
C) Running only one process at a time
The core of an operating system that runs at all times is called:
A) GUI
B) Kernel
C) Shell
D) Scheduler
B) Kernel
Which type of OS is optimized for usability and battery life?
A) Mainframe OS
B) Server OS
C) Mobile OS
D) Real-time OS
C) Mobile OS
What does multiprogramming enable in an operating system?
A) Running multiple programs simultaneously
B) Running programs in parallel across multiple CPUs
C) Running only one program at a time
D) Making use of only a single user per system
A) Running multiple programs simultaneously
The primary function of an interrupt is to:
A) Pause all running programs
B) Alert the CPU to handle an event
C) Slow down processing speed
D) Restart the operating system
B) Alert the CPU to handle an event
A trap is:
A) A user-generated interrupt
B) A software-generated interrupt
C) A hardware-generated interrupt
D) An OS error message
B) A software-generated interrupt
A trap (or exception) is a software-generated interrupt, often caused by errors like division by zero or invalid memory access.
A bootstrap program:
A) Runs applications
B) Loads the OS into memory at startup
C) Manages I/O devices
D) Controls memory allocation
B) Loads the OS into memory at startup
Which of the following is NOT a system resource managed by the OS?
A) CPU
B) Hard Disk
C) Application software
D) Memory
C) Application software
why?
Application software (such as web browsers, games, and word processors) is not a system resource but rather a program that runs on top of the OS.
The OS provides an environment for applications to run but does not manage the software itself as a system resource.
User Mode vs. Kernel Mode exists to:
A) Allow user applications to directly access hardware
B) Prevent user applications from accessing critical OS components
C) Speed up execution time
D) Make OSes simpler
B) Prevent user applications from accessing critical OS components
Which OS does NOT require user interaction?
A) Desktop OS
B) Mobile OS
C) Embedded OS
D) Network OS
C) Embedded OS
The CPU executes instructions while I/O operations happen concurrently. This
is called:
A) Multithreading
B) Asynchronous processing
C) Concurrent execution
D) Multiprocessing
C) Concurrent execution
When an I/O device signals completion, it sends a(n):
A) Poll request
B) Trap
C) Interrupt
D) DMA request
C) Interrupt
Why Are the Other Options Incorrect?
A) Polling involves the CPU repeatedly checking the status of an I/O device, which is inefficient and wastes processing power.
B) Traps are not used for I/O completion signals.
C) A DMA request is sent by an I/O device to the DMA controller, not directly to the CPU, making it different from an interrupt.
[Direct Memory Access (DMA) allows data transfer between I/O devices and memory without involving the CPU.]
Direct Memory Access (DMA) allows:
A) The CPU to control I/O operations
B) Data transfer between memory and I/O devices without CPU intervention
C) Faster cache access
D) Process scheduling
B) Data transfer between memory and I/O devices without CPU
A vectored interrupt:
A) Occurs only in multi-core CPUs
B) Uses a table to quickly locate the correct interrupt handler
C) Cannot be masked (disabled)
D) Is a form of manual user input
B) Uses a table to quickly locate the correct interrupt handler
Why?
When an interrupt occurs, the CPU uses the interrupt vector number to find the correct address of the interrupt handler from the interrupt vector table.
Why Are the Other Options Incorrect?
A) Incorrect because vectored interrupts exist in both single-core and multi-core CPUs.
C) Incorrect because vectored interrupts can be masked (disabled or ignored) using interrupt masking techniques.
D) Incorrect because a vectored interrupt is a hardware or software signal that triggers an automatic response, not a form of manual user input.
User input (like pressing a key) can trigger an interrupt, but the interrupt mechanism itself is not manual.
The timer in an OS is used to:
A) Provide accurate timestamps for logs
B) Prevent a process from running indefinitely
C) Manage virtual memory
D) Speed up processing time
B) Prevent a process from running indefinitely.
Why?
A timer in an operating system (OS) is a crucial component that helps manage CPU time and ensures that processes do not run indefinitely, leading to system unresponsiveness. It is primarily used in multitasking and time-sharing systems.
How does the timer prevent indefinite execution?
The OS sets a timer interrupt for each running process. When the timer expires, the CPU generates an interrupt. The OS then forces a context switch, allowing another process to execute. This mechanism prevents any single process from monopolizing CPU time and ensures fair resource allocation.
This method is commonly used in preemptive scheduling algorithms, such as Round Robin scheduling, where each process gets a fixed time slice (quantum) before being interrupted and moved to the ready queue.
Why Are the Other Options Incorrect?
A) while timers can be used for logging, this is not their primary role in OS process management. Timestamping is usually handled by the system clock, not the timer used for process scheduling.
C) Virtual memory is managed through paging, segmentation, and memory swapping, not the OS timer. The timer does not directly control memory management.
D) The timer does not make processing faster; instead, it ensures fair CPU allocation.
It may even introduce minor overhead due to frequent context switching.
Polling vs. Interrupts: Which one is more efficient?
A) Polling, because it continuously checks for input
B) Interrupts, because they allow the CPU to do other tasks until needed
C) They are equally efficient
D) None of the above
B) Interrupts, because they allow the CPU to do other tasks until needed
The trap instruction is typically used to:
A) Handle hardware failures
B) Execute privileged instructions in user mode
C) Request an OS service (system call)
D) Halt the CPU
C) Request an OS service (system call)
Why?
A trap instruction is a software-generated interrupt that allows user programs to request services from the operating system (OS), such as file handling, process management, or memory allocation. It triggers a switch from user mode to kernel mode, enabling the OS to execute privileged operations safely.
Why not the other options?
A) Hardware failures are handled by hardware interrupts, not traps.
B) Not possible; must use a trap to switch to kernel mode first.
D) Halting is done using specific CPU instructions, not traps.
When an interrupt occurs, the CPU:
A) Ignores it until the current process finishes
B) Immediately jumps to the Interrupt Service Routine (ISR)
C) Terminates the interrupted process
D) Restarts the system
B) Immediately jumps to the Interrupt Service Routine (ISR)
The mode bit in a CPU is used to:
A) Differentiate user mode from kernel mode
B) Enable multiprocessing
C) Speed up interrupts
D) Execute privileged instructions in user mode
A) Differentiate user mode from kernel mode
Why?
The mode bit helps the CPU differentiate user mode (restricted access) from kernel mode (full system access), ensuring security by preventing user programs from executing privileged instructions directly.
Why Are the Other Options Incorrect?
B) The mode bit does not control multiprocessing (multiple CPUs/cores); this is handled by the OS scheduler and hardware mechanisms.
C) Interrupts are handled using interrupt vectors and interrupt controllers, not the mode bit.
D) Privileged instructions can only be executed in kernel mode. A program in user mode must use a system call (via a trap) to request privileged operations.
Interrupt-driven I/O is beneficial because:
A) It allows the CPU to continue processing other tasks
B) It prevents device conflicts
C) It stops errors from occurring
D) It eliminates the need for memory management
A) It allows the CPU to continue processing other tasks
Why?
Interrupt-driven I/O allows the CPU to perform other tasks while waiting for I/O operations to complete. This improves CPU efficiency and system responsiveness, making it a preferred method over polling.
Why Are the Other Options Incorrect?
B) Interrupt-driven I/O does not directly prevent device conflicts; device conflicts are managed by the OS and hardware controllers.
C) Interrupts help handle errors efficiently but do not prevent errors entirely. Error handling mechanisms like exception handling and error codes address this.
D) Memory management is still required to allocate buffers and handle data transfer between the I/O device and RAM.
Volatile storage is:
A) Storage that retains data after power loss
B) Memory that loses its contents when power is removed
C) Permanent storage for OS files
D) Slower than HDDs
B) Memory that loses its contents when power is removed
A process is:
A) A passive entity (program file)
B) A program in execution
C) Always a background task
D) A user interface component
B) A program in execution
Virtual Memory allows:
A) The CPU to run at a higher speed
B) Execution of programs larger than available physical memory
C) Direct access to CPU registers
D) The OS to ignore memory constraints
B) Execution of programs larger than available physical memory
Why?
Virtual Memory is a memory management technique that allows a computer to run programs larger than the available physical RAM by using a portion of the hard disk (or SSD) as an extension of RAM. This is done through paging or segmentation, where inactive memory pages are swapped between RAM and disk storage.
Why Are the Other Options Incorrect?
A) Virtual memory does not speed up the CPU.
In fact, accessing data from disk slows down performance compared to RAM.
C) Virtual memory deals with RAM and storage, not CPU registers (which store immediate processing data).
D) The OS still manages memory carefully.
If too much virtual memory is used, performance degrades significantly (due to excessive disk swapping, called thrashing)
In paging, memory is divided into:
A) Frames and pages
B) Blocks and sectors
C) Segments and partitions
D) Threads and processes
A) Frames and pages
Why?
Paging is a memory management technique used by operating systems to avoid fragmentation and efficiently manage memory allocation. It divides physical memory (RAM) into fixed-size blocks called frames and divides logical (virtual) memory into pages of the same size.
How Paging Works:
The OS divides the physical memory into fixed-sized frames.
The program’s virtual memory is divided into pages of the same size as frames.
When a program runs, its pages are loaded into available frames in physical memory.
A page table keeps track of where each virtual page is stored in RAM.