- LPU MCA Semester 1
- CAP366
- Unit 1
CAP366 · Unit 1: Introduction to operating systems
System components and operating system services
11 practice questions · in the MTE and ETE syllabus
Key points
- Services: execution, I/O, files, communication, error detection
- Resource allocation, accounting and protection serve the system
- Microkernel moves services to user space
- Microkernel costs more message passing
OS services help users and also keep the system efficient.
For the user: user interface, program execution, I/O operations, file-system manipulation, communication (shared memory or message passing), error detection. For efficient operation: resource allocation, accounting, protection and security.
Kernel structures
| Design | Idea | Trade-off |
|---|---|---|
| Monolithic | Everything in the kernel | Fast, harder to maintain |
| Layered | Layers call only the layer below | Clean, some overhead |
| Microkernel | Minimal kernel; file system, drivers in user space | Safer/portable, more message passing |
Example: a read in a microkernel goes user program, then file-server process, then driver process, by messages, so it costs more context switches than a monolithic kernel's single system call.
Exam pitfall: compiling programs is not an OS service, and the kernel is not the same as the GUI or utility programs. In a microkernel the file system lives in user space.
Try two questions
Which OS function exists mainly to keep the system itself efficient rather than to help a user program directly?
- Program execution by loading and running a program
- I/O operations on devices on behalf of a program
- File-system manipulation for reading and writing files
- Resource allocation among concurrent jobs
Show the answer
D. Resource allocation, accounting and protection serve system efficiency and fairness, whereas execution, I/O and file services directly help programs.
Why not A: Loading and running programs is a direct service to the user.
Why not B: Performing I/O for a program is a direct user-helpful service.
Why not C: File access is a service the program asks for directly.
A program needs to read the bytes of a file named notes.txt. Which OS service does it request?
- Inter-process communication service
- File-system manipulation service
- Error detection service
- Accounting service
Show the answer
B. Reading, writing, creating and deleting files and directories is the file-system manipulation service.
Why not A: Communication services move data between processes, not read stored files.
Why not C: Error detection reports faults such as device failures; it does not read files.
Why not D: Accounting only records which users consume which resources.