🎓 BookMCQ
← Back to 2. Operating System Structure

📝 Operating System Services (30 MCQs)

Essential Services Provided by the Operating System

Operating system services provide the interfaces and facilities that applications and users require to interact with computer hardware. They belong to the kernel and associated system software and include program execution, input/output operations, file manipulation, communication, error detection, resource allocation, accounting, and protection. These services coordinate hardware resources while presenting consistent facilities that reduce the need for applications to manage devices independently.

Why Applications Depend on Standard Operating System Facilities

Applications cannot safely or efficiently control every processor, storage device, and peripheral directly. Different hardware models require different control procedures, while concurrent applications must share resources without interfering with one another. Operating system services address these requirements through standard interfaces, controlled hardware access, resource management, and protection mechanisms, allowing software to remain relatively independent of particular hardware implementations.

How Kernel Services Handle Application Requests

An application requests an operation through a library interface or system call. The kernel validates the request, checks permissions, and transfers it to the appropriate subsystem. A file request reaches the file system, while a device request may involve a driver. The service returns a result or error code, allowing the application to continue execution or handle the failure.

Using File and Communication Services in One Application

Consider an application that reads a 4 KiB configuration file and sends its contents through a network connection. The file service retrieves the required data, while communication services transfer it through the networking subsystem. The operating system coordinates both operations, manages buffers, and checks access rights without requiring the application to control the storage and network hardware directly.

Resource Allocation, Reliability, and Service Performance

Operating system services improve resource utilisation, simplify application development, and establish consistent protection boundaries. Error detection helps identify hardware and software failures, while accounting records resource consumption. However, service requests introduce kernel-transition and processing overhead. Resource contention, inefficient I/O, and excessive communication can also increase latency, particularly in heavily loaded multiuser servers and real-time environments.

Misconceptions About Kernel Services and Application Facilities

'Every operating system service executes in kernel mode' is incorrect because many supporting utilities execute in user space. 'File manipulation means controlling physical disk sectors directly' is incorrect because applications normally use file-system interfaces. 'Resource allocation always guarantees equal sharing' is incorrect because scheduling and allocation policies may prioritise workloads differently.

Exam Focus: Identifying and Classifying Operating System Services

Be able to distinguish program execution, I/O, file manipulation, communication, error detection, resource allocation, accounting, and protection. Given an application operation, identify the relevant operating system service and its interaction with kernel components. Examination questions may also compare services with system calls and distinguish user-facing facilities from the privileged mechanisms that implement them.

Key Terms of Operating System Services

  • Program execution - Loading and running programs.
  • I/O operation - Requesting input or output.
  • Communication - Exchanging data between processes.
  • Accounting - Recording resource consumption.
  • Protection - Controlling authorised resource access.
  • Error detection - Identifying system faults.
10
Easy
10
Medium
10
Hard

📝 All Operating System Services MCQs

Q1. A systems administrator enters a command to list files, and the operating system interprets the command and starts the requested utility. Which service directly provides this interaction?

A.Program execution
B.Command-interpreter interface ✅
C.Accounting
D.Error detection
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: The command interpreter accepts commands and requests the appropriate system actions. Program execution runs the selected utility afterward; accounting records usage, while error detection handles faults rather than interpreting commands.

Q2. A web server creates a child process with fork(), then replaces the child's program image with a worker executable. Which statement describes the sequence correctly?

A.fork() creates the child; exec() replaces its address space and does not create another process ✅
B.exec() creates the child; fork() loads the worker executable
C.Both calls create separate child processes
D.fork() replaces the program image, while exec() only changes the process priority
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: fork() duplicates the calling process to create a child, and exec() loads a new program image into that process. The tempting reversal in option B assigns each call the other's role.

Q3. A user application requests data from a hardware device. Which design best preserves protection while still providing the I/O service?

A.Allow the application to execute device-controller instructions directly
B.Let the application modify kernel memory before each transfer
C.Have the application make a system call that the kernel validates and performs ✅
D.Require every device operation to reboot the computer
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: A system call transfers control to trusted kernel code, which validates the request and accesses the device. Direct controller instructions from user mode bypass protection; rebooting is unnecessary for ordinary I/O.

Q4. A storage driver reports a failed write, while a memory manager detects an invalid access. Which operating-system service is responsible for noticing and responding to such conditions?

A.Accounting
B.Error detection and handling ✅
C.File naming
D.Command interpretation
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Error detection monitors failures in CPU, memory, I/O devices, and programs, then initiates suitable handling. Accounting measures resource use, while file naming and command interpretation serve unrelated user-facing purposes after identifying the source.

Q5. A document editor asks the operating system to create a file, write data, rename it, and change its permissions. Which service family handles these requests?

A.File-system manipulation ✅
B.CPU dispatching only
C.Deadlock detection only
D.Clock synchronization
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: File-system manipulation includes creating, deleting, reading, writing, renaming, and changing file attributes or permissions properly. CPU dispatching selects a process to run; it does not perform directory or file operations.

Q6. Two processes on one computer exchange large data blocks repeatedly. Which communication method can reduce repeated kernel-mediated message copying when both processes are trusted to coordinate access?

A.Polling a device register
B.Creating a separate disk file for every block
C.Shared memory with synchronization ✅
D.Disabling virtual memory
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Shared memory lets processes access a common mapped region, avoiding repeated message copies after setup. The tempting disk-file approach adds storage I/O, while synchronization is still required to prevent conflicting updates.

Q7. A shared server stores user files with owner, group, and other access permissions. Which operating-system mechanism most directly decides whether a process may read a particular file?

A.CPU burst prediction
B.Access-control checking ✅
C.Round-robin time slicing
D.Disk-head scheduling
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: Access-control checking compares the requesting process's identity and requested operation with the file's permissions. Scheduling determines CPU or disk service order, but it does not authorize access to protected data.

Q8. An administrator wants a report showing how much CPU time and storage each account consumed during the month. Which operating-system service supplies the measurements needed for this report?

A.Program loading
B.Error recovery
C.Resource accounting ✅
D.Message passing
💡 Difficulty: easy | ✅ Correct: C

📖 Explanation: Resource accounting records usage such as CPU time, memory, storage, and I/O activity for monitoring or billing. Error recovery handles faults, while program loading and message passing provide different services.

Q9. A device transfers a large block directly between its controller and main memory. The CPU is notified when the transfer finishes. Which mechanism is being used?

A.Direct memory access (DMA) ✅
B.Busy-wait polling for every byte
C.A separate process for every memory word
D.A file-system hard link
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: DMA allows a controller to transfer a block between a device and memory with limited CPU intervention, usually interrupting on completion. Polling every byte wastes CPU time and is not the described transfer.

Q10. A batch system runs P1 with arrival 0 and burst 5, then P2 with arrival 2 and burst 3, using non-preemptive FCFS. What are P2's waiting time and turnaround time?

A.Waiting 0; turnaround 3
B.Waiting 3; turnaround 6 ✅
C.Waiting 5; turnaround 8
D.Waiting 2; turnaround 5
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: P1 occupies the CPU from 0 to 5, so P2 starts at 5 and completes at 8. Its waiting time is 5−2=35-2=3, and turnaround is 8−2=68-2=6; option D omits the queued interval.

Q11. A print server uses Round Robin with quantum 2. P1 arrives at 0 with burst 5; P2 arrives at 1 with burst 2. The queue initially contains P1. Which completion time results for P1?

A.5
B.6
C.7 ✅
D.9
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: The schedule is P1 0–2, P2 2–4, P1 4–6, then P1 6–7. P1 completes at 7; option B forgets that the remaining P1 burst must be requeued after its second quantum.

Q12. A bounded buffer has capacity 8. Producers and consumers coordinate using counting semaphores named empty and full, plus a mutex. Which initial values are correct?

A.empty = 0, full = 8, mutex = 1
B.empty = 8, full = 8, mutex = 0
C.empty = 1, full = 0, mutex = 8
D.empty = 8, full = 0, mutex = 1 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: Initially all eight slots are empty and no items are available, so empty is 8 and full is 0. Mutex starts at 1 for exclusive access; option A reverses the buffer counts.

Q13. A machine uses 32-bit logical addresses, 4 KiB pages, and 4-byte page-table entries. A student says the table has 2122^{12} entries because the offset is 12 bits. What is the correct assessment?

A.The table has 2202^{20} entries and occupies 4 MiB ✅
B.The table has 2122^{12} entries and occupies 16 KiB
C.The table has 2322^{32} entries and occupies 16 GiB
D.The table has 2202^{20} entries and occupies 1 MiB
💡 Difficulty: medium | ✅ Correct: A

📖 Explanation: The 12-bit offset leaves 20 page-number bits, so there are 2202^{20} entries. At 4 bytes each, the table is 4 MiB; the student's error is using offset bits as the entry count.

Q14. A demand-paged application has memory access time 100 ns, page-fault probability p=0.001p=0.001, and average page-fault service time 8 ms, including restart. What is its approximate effective access time?

A.108 ns
B.8,000,100 ns
C.8,100 ns ✅
D.8,000,000 ns
💡 Difficulty: medium | ✅ Correct: C

📖 Explanation: Using EAT=(1−p)100+p(8,000,000)EAT=(1-p)100+p(8{,}000{,}000), the result is 99.9+8,000=8,099.999.9+8{,}000=8{,}099.9 ns, approximately 8,100 ns. Option D ignores the ordinary access on nonfaulting references. The tempting alternative, 8,000,000 ns, forgets probability weighting and successful accesses.

Q15. A file system uses indexed allocation with one index block containing 1,024 four-byte pointers. Data blocks are 4 KiB. Ignoring metadata overhead, what is the maximum file size addressable by that index block?

A.1 MiB
B.4 MiB ✅
C.16 MiB
D.4 GiB
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: The index block holds 1,024 pointers, each selecting one 4 KiB data block. Thus the maximum is 1,024×41{,}024\times4 KiB = 4 MiB; option A incorrectly treats the pointer count as bytes.

Q16. A service uses a strict-priority scheduler. A low-priority maintenance process remains ready while high-priority requests arrive continuously. What is the principal risk, and what common remedy addresses it?

A.Deadlock; disable all interrupts
B.Starvation; age waiting processes by raising their priorities ✅
C.Internal fragmentation; increase page size
D.Thrashing; shorten file names
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: Strict priority can indefinitely postpone a low-priority process when higher-priority work keeps arriving. Aging gradually raises the waiting process's priority over time; disabling interrupts does not provide fair CPU allocation.

Q17. A resource-allocation graph contains a directed cycle, and every resource type in that cycle has exactly one instance. What follows from this condition?

A.Deadlock is present because the cycle is sufficient under this condition ✅
B.Deadlock is impossible until a process is terminated
C.The cycle proves only that starvation will occur
D.A cycle is necessary but never sufficient for deadlock
💡 Difficulty: easy | ✅ Correct: A

📖 Explanation: With one instance of each resource type, a directed cycle is sufficient to establish deadlock. Option D is tempting because it fits some multi-instance cases, but it is incorrect here.

Q18. A system's CPU utilization is measured at different degrees of multiprogramming: (1,35%), (2,58%), (3,76%), (4,84%), (5,81%), (6,70%). At which degree is utilization highest?

A.2
B.3
C.5
D.4 ✅
💡 Difficulty: medium | ✅ Correct: D

📖 Explanation: The listed utilization rises to 84% at degree 4, then falls to 81% and 70%. Therefore degree 4 is the peak; option C selects a later point after utilization has already declined.

Q19. A page-replacement test records frames and page faults as follows: (1,14), (2,11), (3,8), (4,8), (5,6). How many fewer faults occur with four frames than with two?

A.3 ✅
B.5
C.6
D.8
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The table gives 11 faults with two frames and 8 with four, so the reduction is 11−8=311-8=3. Option B subtracts the five-frame result instead of the requested four-frame result; it uses the wrong comparison.

Q20. A disk request stream is served by C-LOOK. The head starts at 40, moves upward, and the sorted requests are 10, 25, 45, 60, and 90. After reaching 90, it jumps to 10 and continues upward. What is total head movement?

A.100 cylinders
B.120 cylinders
C.135 cylinders
D.145 cylinders ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: Movement is 5+15+30+80+15=1455+15+30+80+15=145 cylinders: 40 to 45 to 60 to 90, jump from 90 to 10, then 25. Option C undercounts the circular jump from the highest request back to the lowest.

Q21. A student claims a process that enters the kernel for a system call must always incur a context switch because the CPU changes privilege modes. Which correction is most accurate?

A.Every mode switch changes the running process
B.A mode switch changes privilege level; a context switch changes the running process ✅
C.A context switch only changes privilege level, not process identity
D.System calls always terminate the caller
💡 Difficulty: medium | ✅ Correct: B

📖 Explanation: A system call can enter kernel mode and return to the same process without scheduling another process. Option A confuses a privilege transition with a process change, which is the defining feature of a context switch.

Q22. A system has Allocation P0=(1,0,1), P1=(1,1,0), P2=(1,0,1); Max P0=(2,1,1), P1=(1,2,1), P2=(3,0,2); Available=(1,1,0). A student tests P1 using Max instead of Need. What is the correct Need for P1?

A.(1,2,1)
B.(0,1,1) ✅
C.(0,1,0)
D.(1,1,0)
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: Need is calculated as Max minus Allocation. For P1, (1,2,1)−(1,1,0)=(0,1,1)(1,2,1)-(1,1,0)=(0,1,1). Option A repeats Max without subtracting the resources already allocated; Need measures only the additional resources still required in this process.

Q23. A database process switches from P1 to P2. The CPU has a virtually indexed cache, and the TLB is tagged with address-space identifiers. Which statement about address translation is correct?

A.The TLB must be flushed after every switch, regardless of tags
B.The page-table base register is used as the virtual page number
C.Address-space identifiers can preserve translations across the switch when the entries remain valid ✅
D.A context switch converts every virtual address into a physical address permanently
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: With address-space identifiers, TLB entries can remain distinguishable by process, so a switch need not flush all translations. Option A describes a conservative design without tags, not this tagged-TLB system.

Q24. A process holds a printer lock while waiting for a scanner, and another process holds the scanner while waiting for the printer. CPU scheduling alternates between them. Which statement best explains the situation?

A.Deadlock can persist despite fair CPU scheduling because each process waits for a resource held by the other ✅
B.Round Robin scheduling automatically releases both locks
C.The processes are merely ready and cannot be deadlocked
D.Increasing the time quantum breaks the circular wait condition
💡 Difficulty: hard | ✅ Correct: A

📖 Explanation: The processes form a circular wait while each retains a resource, so CPU fairness cannot release the locks. Option D changes scheduling intervals, not the resource dependency that sustains deadlock.

Q25. A process uses a three-level page table. A logical address is split into fields of 8, 7, 5, and 12 bits, from most significant to least significant. What is the page offset size?

A.5 bits
B.7 bits
C.8 bits
D.12 bits ✅
💡 Difficulty: hard | ✅ Correct: D

📖 Explanation: The least significant 12 bits identify the byte within a page, so the offset is 12 bits and the page size is 2122^{12} bytes. Option C confuses the first index field with the offset.

Q26. A scheduler gives a process a 4 ms quantum, but the process blocks for disk I/O after 1 ms. The disk completes the request while another process runs. Which event makes the blocked process eligible for CPU scheduling again?

A.Expiration of its unused 3 ms quantum
B.Completion of the I/O operation, moving it from waiting to ready ✅
C.A new fork() call by the blocked process
D.The disk controller directly changing its state to running
💡 Difficulty: easy | ✅ Correct: B

📖 Explanation: When the I/O completes, the kernel records the event and moves the process from waiting to ready. The unused quantum does not determine readiness; CPU dispatch occurs later when the scheduler selects it.

Q27. Resource R1 has two instances and R2 has one. P0 holds one R1 and requests R2; P1 holds R2 and requests one R1. The second R1 instance is unallocated, and the resource-allocation graph contains a cycle. What follows?

A.Deadlock is certain because every cycle proves deadlock
B.P1 can receive the free R1, finish, and release R2, so the cycle does not prove deadlock ✅
C.P0 must release its R1 before P1 can ever proceed
D.The system is unsafe because R1 has multiple instances
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: With multiple instances, a cycle is not sufficient to prove deadlock. P1 can receive the unallocated R1, finish, and release R2; option A incorrectly applies the single-instance rule for all resource types.

Q28. A file service uses an inode-style structure and must locate a file's data blocks without storing the file name in the inode. Which design is consistent with this approach?

A.Store the file name as the only inode field
B.Store ownership, permissions, size, timestamps, and block pointers in the inode; keep the name in a directory entry ✅
C.Store every directory name inside each data block
D.Use the process ID as the file's physical block address
💡 Difficulty: hard | ✅ Correct: B

📖 Explanation: An inode stores metadata and pointers to data blocks, while a directory maps a name to an inode number. Option A confuses directory naming with inode metadata and cannot locate data blocks.

Q29. A process requests a page that is absent from RAM. The operating system finds the page on disk, selects a victim frame, writes the victim if dirty, loads the needed page, and restarts the instruction. What event triggered this service sequence?

A.A TLB hit
B.A timer interrupt
C.A page fault ✅
D.A mode switch alone
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: A reference to a nonresident page raises a page fault, causing the kernel to fetch it and possibly replace a frame. A TLB miss alone may be resolved from the page table without disk I/O.

Q30. Available=(1,1,1); Need P0=(1,0,1), P1=(0,1,0), P2=(1,1,2); Allocation P1=(1,0,1). After P1 completes, a student still uses the original Available vector and concludes only P0 can run. What is the correct conclusion?

A.Only P0 can run because Available never changes after completion
B.Only P2 can run because P1's allocation is discarded
C.Both P0 and P2 can run because updated Available is (2,1,2) ✅
D.Neither can run because P1 has terminated
💡 Difficulty: hard | ✅ Correct: C

📖 Explanation: When P1 finishes, its allocation returns to the pool: Available becomes (1,1,1)+(1,0,1)=(2,1,2)(1,1,1)+(1,0,1)=(2,1,2). Both P0 and P2 meet their Need; option A wrongly keeps the old vector. Each can now proceed.

🔗 Related Topics (MCQs)