Operating Systems · Unit 1 · 4 hrs
Operating System Overview
Exam-focused notes for Operating System Overview (Operating Systems, CSC264): what the TU syllabus asks and how it has actually been tested, with 3 solved past questions from this unit.
Operating System Overview in short
This chapter introduces the operating system as the software layer between the user and the computer hardware, traces how operating systems evolved alongside computer hardware generations, classifies the operating systems in use today, and explains the system call mechanism through which user programs actually ask the kernel to do work on their behalf.
What this unit covers
- Definition
- Two views of operating system
- Evolution of operating system
- Types of OS
- System Call
- Handling System Calls
- System Programs
- Operating System Structures
- The Shell
- Open Source Operating Systems
Operating System Structures
2076 · 5 marks
What are two modes of OS? Discuss different OS structures briefly. [5]
Show solved answerHide answer
Two Modes of OS and OS Structures
Two Modes of OS (Kernel Modes)
Modern operating systems operate in two distinct processor modes to protect the system from faulty or malicious programs:
1. User Mode
- In this mode, the executing program does not have direct access to hardware or memory.
- Application programs (user programs) run in user mode.
- If a user program needs to access hardware or perform privileged operations, it must request the OS through a system call.
- Prevents user programs from accidentally or intentionally damaging the system.
2. Kernel Mode (Supervisor/Privileged Mode)
- In this mode, the OS (kernel) has full access to all hardware and can execute any CPU instruction.
- The kernel runs in this mode to perform critical tasks like memory management, process scheduling, and I/O operations.
- Switching from user mode to kernel mode happens via system calls or interrupts.
The dual-mode operation protects the OS from user programs and protects users from each other.
OS Structures
Different approaches have been used to organize and structure an operating system:
1. Monolithic Structure (Simple / No Structure)
- The entire OS runs as a single large program in kernel mode.
- All OS services (file system, memory management, device drivers, etc.) are packed together.
- Advantage: Fast and efficient due to no overhead of communication between components.
- Disadvantage: Difficult to maintain, debug, and extend. A bug in one part can crash the entire system.
- Example: Early UNIX, MS-DOS.
2. Layered Structure
- The OS is divided into a number of layers (levels), each built on top of the lower one.
- The bottom layer (Layer 0) is the hardware; the topmost layer is the user interface.
- Each layer only uses functions and services of the layer below it.
- Advantage: Easy to debug and maintain (one layer at a time).
- Disadvantage: Defining the layers properly is difficult; performance overhead due to multiple layer traversals.
- Example: THE operating system by Dijkstra.
3. Microkernel Structure
- Only the most essential functions (like inter-process communication, basic scheduling, and memory management) are kept in the kernel.
- All other services (file system, device drivers, etc.) run in user space as separate processes.
- Advantage: More reliable and secure; a failure in one service does not crash the kernel.
- Disadvantage: Performance overhead due to frequent message passing between user-space services and the kernel.
- Example: MINIX, QNX.
4. Virtual Machine Structure
- The OS creates an illusion of multiple independent machines on a single physical machine.
- Each virtual machine gets its own (virtual) copy of the hardware.
- Advantage: Multiple different OS environments can run simultaneously on the same hardware.
- Disadvantage: Complex to implement; some overhead in virtualization.
- Example: VMware, IBM VM/370.
5. Client-Server Structure (Modular Structure)
- A variation of the microkernel approach where OS services are divided into server processes.
- Client processes request services from server processes through message passing.
- Advantage: Highly modular and flexible; suitable for distributed systems.
- Disadvantage: Communication overhead between client and server processes.
Summary Table:
| Structure | Key Idea | Example |
|---|---|---|
| Monolithic | Single large kernel | MS-DOS, UNIX |
| Layered | Hierarchical layers | THE OS |
| Microkernel | Minimal kernel + user-space services | MINIX, QNX |
| Virtual Machine | Multiple virtual OS instances | VMware |
| Client-Server | Services as separate server processes | Distributed OS |
Handling System Calls
2078 · 5 marks
What is system call? Discuss process of handling system calls briefly. [5]
Make Unit 1 stick
Practice CSC264 with flashcards & quizzes