CH1 MCQs Flashcards

(43 cards)

1
Q

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

A

C) Running only one process at a time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The core of an operating system that runs at all times is called:
A) GUI
B) Kernel
C) Shell
D) Scheduler

A

B) Kernel

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which type of OS is optimized for usability and battery life?
A) Mainframe OS
B) Server OS
C) Mobile OS
D) Real-time OS

A

C) Mobile OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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

A) Running multiple programs simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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

A

B) Alert the CPU to handle an event

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A trap is:
A) A user-generated interrupt
B) A software-generated interrupt
C) A hardware-generated interrupt
D) An OS error message

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A bootstrap program:
A) Runs applications
B) Loads the OS into memory at startup
C) Manages I/O devices
D) Controls memory allocation

A

B) Loads the OS into memory at startup

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which of the following is NOT a system resource managed by the OS?
A) CPU
B) Hard Disk
C) Application software
D) Memory

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

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

A

B) Prevent user applications from accessing critical OS components

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which OS does NOT require user interaction?
A) Desktop OS
B) Mobile OS
C) Embedded OS
D) Network OS

A

C) Embedded OS

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The CPU executes instructions while I/O operations happen concurrently. This
is called:
A) Multithreading
B) Asynchronous processing
C) Concurrent execution
D) Multiprocessing

A

C) Concurrent execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When an I/O device signals completion, it sends a(n):
A) Poll request
B) Trap
C) Interrupt
D) DMA request

A

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.]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

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

A

B) Data transfer between memory and I/O devices without CPU

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

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

A

B) Interrupts, because they allow the CPU to do other tasks until needed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

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

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

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

A

B) Immediately jumps to the Interrupt Service Routine (ISR)

19
Q

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

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.

20
Q

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

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.

21
Q

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

A

B) Memory that loses its contents when power is removed

22
Q

A process is:
A) A passive entity (program file)
B) A program in execution
C) Always a background task
D) A user interface component

A

B) A program in execution

23
Q

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

A

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)

24
Q

In paging, memory is divided into:
A) Frames and pages
B) Blocks and sectors
C) Segments and partitions
D) Threads and processes

A

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.

25
Memory allocation strategies include: A) Best-fit, worst-fit, first-fit B) Round-robin, FCFS, priority C) Thrashing, caching, swapping D) Multithreading, multiprocessing
A) Best-fit, worst-fit, first-fit Why? Memory allocation strategies determine how memory blocks are allocated to processes in contiguous memory management. The three main strategies are: First-Fit: The OS allocates the first available memory block that is large enough for the process. Fast but may cause fragmentation. Best-Fit: The OS chooses the smallest available memory block that can fit the process. Minimizes wasted space but can slow allocation time. Worst-Fit: The OS assigns the largest available block, leaving a large unused portion for future allocations. Can help reduce fragmentation in some cases but may lead to inefficient memory usage. These strategies are used in dynamic memory allocation for handling free space management. Why Are The Other Options Incorrect? C) These are memory management techniques, not allocation strategies. Thrashing: happens when excessive paging slows down the system. Caching: improves speed by storing frequently accessed data. Swapping: moves processes in and out of memory.
26
The purpose of process scheduling is: A) Managing memory hierarchy B) Allocating CPU time efficiently C) Handling interrupts D) Avoiding kernel crashes
B) Allocating CPU time efficiently
27
Swapping is used in OS memory management to: A) Transfer entire processes in and out of memory B) Allocate extra registers to a process C) Improve CPU speed D) Allow parallel processing
A) Transfer entire processes in and out of memory Why? Swapping is a memory management technique where the OS moves entire processes between RAM and disk (swap space) to manage memory efficiently. This allows multiple processes to run even when RAM is limited, enabling multitasking. However, excessive swapping can lead to performance issues (thrashing) due to high disk I/O. Why not the other options? B) CPU-related, not memory. C) Swapping does not make the CPU faster. D) Handled by multiple CPUs, not swapping.
28
A thread is: A) A smaller unit of a process B) A separate program C) An OS function D) A temporary memory location
A) A smaller unit of a process
29
Which scheduling algorithm gives each process an equal time slice? A) First-Come-First-Serve (FCFS) B) Round-Robin (RR) C) Shortest Job First (SJF) D) Priority Scheduling
B) Round-Robin (RR)
30
Deadlock occurs when: A) A process is waiting for a resource held by another process, creating a cycle B) The OS crashes due to excessive memory usage C) The CPU stops responding D) A process exceeds its execution time limit
A) A process is waiting for a resource held by another process, creating a cycle
31
The OS component responsible for memory management is called: A) Process Manager B) File System Manager C) Memory Manager D) Scheduler
C) Memory Manager
32
A multi-core CPU improves performance by: A) Running a single task faster B) Running multiple processes simultaneously C) Increasing cache size D) Reducing memory consumption
B) Running multiple processes simultaneously
33
Thrashing occurs when: A) The CPU is overloaded with processes B) Too many processes cause excessive paging C) An OS process crashes unexpectedly D) The system cache is full
B) Too many processes cause excessive paging
34
What is a system call? A) A process requesting data from a user B) A request made by a program to the OS for a service C) A user opening a file manually D) A signal from hardware to the CPU
B) A request made by a program to the OS for a service
35
A virtual machine (VM) is: A) An emulated computer system running inside another OS B) A physical computer running multiple OSes C) A system with multiple CPUs D) A program that directly controls hardware
A) An emulated computer system running inside another OS Why? A Virtual Machine (VM) is a software-based emulation of a physical computer that runs inside another operating system (host OS). The VM behaves like an independent system, with its own CPU, memory, storage, and OS, but it actually shares the physical resources of the host system. How Virtual Machines Work: A hypervisor (Virtual Machine Monitor - VMM) is used to create and manage VMs. The host OS runs the hypervisor, which allocates resources (CPU, RAM, disk) to each VM. The guest OS inside the VM operates as if it were running on real hardware. Multiple VMs can run on the same physical machine without interfering with each other.
36
Which is an example of an embedded system? A) A personal computer B) A mobile phone C) A car's anti-lock braking system D) A laptop
C) A car's anti-lock braking system
37
A distributed system is: A) A single computer running multiple tasks B) A group of computers connected without sharing resources C) A network of independent computers acting as a single system D) A multi-core processor performing distributed processing
C) A network of independent computers acting as a single system
38
Time-sharing OS is designed for: A) Single-user applications B) Running only background tasks C) Multi-user interaction D) IoT devices only
C) Multi-user interaction Why? A Time-Sharing Operating System (OS) is designed to allow multiple users to interact with a computer system simultaneously by rapidly switching between tasks. Each user gets a time slice (quantum) of CPU time, making it seem like multiple programs are running at the same time.
39
A deadlock prevention method is: A) Running fewer processes B) Giving each process the same priority C) Resource allocation ordering D) Increasing CPU speed
C) Resource allocation ordering
40
An advantage of symmetric multiprocessing (SMP) is: A) Load balancing among CPUs B) Reducing memory allocation errors C) Preventing deadlocks automatically D) Allowing only one process to run at a time
A) Load balancing among CPUs Why Are the Other Options Incorrect? B) SMP does not inherently prevent memory allocation errors. Memory management is handled by the OS and memory management unit (MMU). C) SMP does not prevent deadlocks. Deadlocks occur due to resource contention and must be managed by deadlock prevention/detection strategies. D) SMP allows multiple processes to run in parallel. The main advantage of SMP is multi-processing, not single-task execution.
41
The main function of a hypervisor is to: A) Manage virtual machines B) Encrypt file systems C) Schedule background processes D) Monitor system security
A) Manage virtual machines
42
Which OS has the highest security risks? A) Closed-source OS with automatic updates B) Enterprise-level OS with firewall protection C) Proprietary OS with strong encryption D) Open-source OS without updates
D) Open-source OS without updates
43
The term “thrashing” in OS relates to: A) Excessive paging activity B) High CPU temperature C) Too many files open at once D) Corrupt system memory
A) Excessive paging activity