1. How to Use This Page
1. Solve every exercise on your own first. Attempt each question before reading the solution. 2. Compare your method, not just the final answer. The process matters in the board exam. 3. Pay attention to the explanations — they clarify why an answer is correct, which helps with similar questions. 4. Revisit the "Common Mistakes" section before every test to avoid repeat errors. 5. Use the Exam Checklist on the night before the exam for a quick final review.
2. Key Concepts (Quick Recap)
What is an Operating System?
An operating system (OS) is system software that manages hardware and software resources and provides common services for computer programs. It acts as an intermediary between the user and the computer hardware.
User → Application Software → Operating System → Hardware
Types of Operating Systems
| Type | Description | Example |
|---|
| Batch Processing | Jobs collected and processed as a group without user interaction | Early IBM mainframes |
| Time-Sharing | Multiple users share CPU time; each gets a small time slice | Unix, Linux |
| Real-Time | Guaranteed response within strict time constraints | RTLinux, VxWorks |
| Distributed | Manages a group of independent computers appearing as a single system | Amoeba, LOCUS |
| Network | Provides services to computers connected over a network | Windows Server |
| Mobile | Designed for handheld devices with touch, battery, connectivity features | Android, iOS |
| Embedded | Runs on embedded systems with limited resources | Microwave oven controllers |
Functions of an Operating System
| Function | Description |
|---|
| Process Management | Creating, scheduling, and terminating processes; allocating CPU |
| Memory Management | Allocating and deallocating memory; virtual memory; swapping |
| File Management | Creating, deleting, organising files and directories; access control |
| Device Management | Managing input/output devices; device drivers |
| Security | Protecting data and resources from unauthorised access |
| User Interface | Providing GUI or CLI for user interaction |
Process Management
A process is a program in execution. It includes the program code, current activity (program counter), and resources (memory, files).
Process States:
+-------+
| New | (Being created)
+-------+
|
v
+-------+
+----| Ready |<----+
| +-------+ |
| | |
| v |
| +-------+ |
+--->|Running|-----+
| +-------+ |
| | |
| v |
| +-------+ |
+----|Waiting|-----+
+-------+
|
v
+-----------+
|Terminated |
+-----------+
| State | Description |
|---|
| New | Process is being created |
| Ready | Process is waiting to be assigned to a processor |
| Running | Process is being executed by the CPU |
| Waiting/Blocked | Process is waiting for I/O or another event |
| Terminated | Process has finished execution |
Memory Management
| Technique | Description |
|---|
| Contiguous Allocation | Each process gets a single contiguous block of memory |
| Paging | Memory divided into fixed-size pages; non-contiguous allocation |
| Segmentation | Memory divided into logical segments (code, data, stack) |
| Virtual Memory | Uses disk space as an extension of RAM |
| Swapping | Moving processes between RAM and disk |
Virtual Memory:
- Uses a portion of the hard disk (swap space) as extra RAM.
- Allows programs larger than physical RAM to execute.
- Uses paging: pages are swapped between RAM and disk as needed.
File Management
The OS organises files in a hierarchical directory structure (tree structure).
| Function | Description |
|---|
| Creating | Making new files and directories |
| Deleting | Removing files and directories |
| Organising | Arranging files in directories/folders |
| Access control | Setting permissions (read, write, execute) |
| Backup | Creating copies for data safety |
Scheduling Algorithms (Overview)
| Algorithm | Description |
|---|
| FCFS (First Come First Served) | Processes executed in order of arrival |
| SJF (Shortest Job First) | Shortest process executed first |
| Round Robin | Each process gets a fixed time slice (quantum) |
| Priority Scheduling | Process with highest priority executed first |
3. I. Choose the Best Answer (MCQs)
1. An operating system is:
Answer
(a) Application software (b) System software (c) Utility software (d) Firmware
Answer(b) System software An operating system is system software that manages hardware resources and provides services to application software. Application software (like MS Word) runs on top of the OS.
2. Which type of OS processes jobs one after another without user interaction?
Answer
(a) Time-sharing (b) Real-time (c) Batch processing (d) Distributed
Answer(c) Batch processing In batch processing, jobs are collected into batches and processed sequentially without user interaction. Users submit jobs and receive output later.
3. Virtual memory uses:
Answer
(a) ROM (b) Cache (c) Hard disk space (d) Registers
Answer(c) Hard disk space Virtual memory uses a portion of the hard disk (swap space) as an extension of RAM, allowing programs to use more memory than is physically available.
4. Which process state means the process is waiting for I/O?
Answer
(a) New (b) Ready (c) Running (d) Waiting/Blocked
Answer(d) Waiting/Blocked A process enters the waiting/blocked state when it needs I/O or some other event. It moves back to the ready state when the event completes.
5. Round Robin scheduling uses:
Answer
(a) Priority (b) Time quantum (c) Job length (d) Arrival time only
Answer(b) Time quantum Round Robin assigns a fixed time slice (quantum) to each process. When the quantum expires, the process is preempted and the next process gets the CPU.
6. Which of the following is a function of the operating system?
Answer
(a) Compiling programs (b) Browsing the web (c) Memory management (d) Creating presentations
Answer(c) Memory management Memory management (allocating and deallocating memory) is a core OS function. Compiling is done by a compiler, web browsing by a browser, and presentations by application software.
4. II. Fill in the Blanks
1. An operating system acts as an intermediary between the user and the computer hardware. 2. In batch processing OS, jobs are collected and processed as a group without user interaction. 3. A time-sharing OS allows multiple users to share the CPU simultaneously. 4. A real-time OS guarantees response within strict time deadlines. 5. Virtual memory uses hard disk space as an extension of RAM. 6. The five process states are New, Ready, Running, Waiting/Blocked, and Terminated. 7. When a process is executing on the CPU, it is in the Running state. 8. Swapping is the technique of moving processes between main memory and secondary storage. 9. Paging is a memory management technique that divides memory into fixed-size blocks called pages. 10. The kernel is the core part of the operating system that manages system resources. 11. FCFS (First Come First Served) is the simplest CPU scheduling algorithm. 12. File management is the OS function responsible for creating, deleting, and organising files. 13. An operating system that manages multiple independent computers is called a distributed operating system.
5. III. True or False (with corrections)
1. An operating system is application software.
False. An operating system is system software that manages hardware resources and provides services to application software. Application software (like MS Office, browsers) runs on top of the OS.
2. In a time-sharing OS, each user gets a small time slice of the CPU.
True. Time-sharing OS uses a technique called time-slicing where the CPU switches rapidly between users, giving each a small time quantum, creating the illusion of simultaneous use.
3. Virtual memory is a part of RAM.
False. Virtual memory uses a portion of the hard disk (not RAM) as an extension of RAM. It allows programs to use more memory than the physical RAM available.
4. A process in the ready state is currently being executed by the CPU.
False. A process in the running state is currently being executed. A process in the ready state is waiting to be assigned to the CPU.
5. Batch processing OS allows direct user interaction with the computer.
False. In batch processing, jobs are submitted as a group and processed without user interaction. Users cannot interact with the system during processing. Time-sharing OS allows direct user interaction.
6. The kernel is the core part of the operating system.
True. The kernel is the most essential part of the OS. It manages CPU, memory, devices, and system calls. All other OS components depend on the kernel.
6. IV. Match the Following
| Column A | Column B |
|---|
| 1. Batch processing | a. Strict time deadlines |
| 2. Time-sharing | b. Multiple independent computers |
| 3. Real-time | c. Jobs processed as a group |
| 4. Distributed | d. Multiple users share CPU |
| 5. Process management | e. Creating and scheduling processes |
| 6. Memory management | f. Allocating RAM and virtual memory |
| 7. File management | g. Organising files in directories |
| 8. Virtual memory | h. Hard disk as extension of RAM |
Answer1-c, 2-d, 3-a, 4-b, 5-e, 6-f, 7-g, 8-h
7. V. Answer Briefly (2-mark questions)
Q1. What is an operating system? Give two examples.
Answer
An operating system is system software that manages computer hardware and software resources and provides common services for application programs. It acts as an intermediary between the user and the hardware.
Examples: (1) Windows 10/11, (2) Linux (Ubuntu, Fedora), (3) macOS, (4) Android.
Q2. Differentiate between batch processing and time-sharing OS.
Answer
| Feature | Batch Processing | Time-Sharing |
|---|
| User interaction | No interaction | Direct interaction |
| Processing | Jobs processed as a group | Multiple users share CPU |
| Response time | Not important | Fast response required |
| Example | Early IBM mainframes | Unix, Linux |
| Suitable for | Payroll, report generation | Multi-user environments |
Q3. What is virtual memory? Why is it needed?
Answer
Virtual memory is a memory management technique where the operating system uses a portion of the hard disk as an extension of RAM. It creates the illusion that the computer has more RAM than it actually does.
Why it is needed:
- Allows programs larger than physical RAM to execute.
- Enables multiple programs to run simultaneously.
- Provides memory isolation between processes.
- Reduces the need for expensive RAM upgrades.
Q4. List the five process states and briefly describe each.
Answer
| State | Description |
|---|
| New | Process is being created and initialised |
| Ready | Process is loaded in memory and waiting for CPU assignment |
| Running | Process is currently being executed by the CPU |
| Waiting/Blocked | Process is waiting for I/O or an event to complete |
| Terminated | Process has finished execution and is being removed |
Q5. What is the kernel? Name its two types.
Answer
The kernel is the core component of an operating system that manages system resources (CPU, memory, devices) and provides essential services to other parts of the OS and applications.
Two types: 1. Monolithic kernel — All OS services run in kernel space (e.g., Linux). Faster but less secure. 2. Microkernel — Only essential services run in kernel space; others run in user space (e.g., MINIX). More secure but slower.
8. VI. Answer in Detail (5-mark questions)
Q1. Explain the types of operating systems with examples and characteristics.
Answer
1. Batch Processing OS: Jobs are collected into batches and processed one after another without user interaction. The user submits the job and collects the output later.
Characteristics:
- No direct user interaction during processing
- Jobs processed in the order submitted (FCFS)
- Efficient for repetitive, large-volume tasks
- Example: Early IBM OS/360, payroll processing systems
2. Time-Sharing OS: Multiple users share the same computer simultaneously. Each user gets a small time slice (quantum) of CPU time. The CPU switches rapidly between users, creating the illusion of dedicated access.
Characteristics:
- Multiple users can interact simultaneously
- Each user gets a time slice of the CPU
- Quick response time
- Example: Unix, Linux, Windows (multi-user mode)
3. Real-Time OS: Designed for applications where response must be guaranteed within strict time deadlines. Used in mission-critical systems where delays can cause failure.
Characteristics:
- Guaranteed response time
- Used in critical applications
- Two types: Hard real-time (strict deadlines) and Soft real-time (tolerates minor delays)
- Example: RTLinux, VxWorks (used in air traffic control, medical equipment)
4. Distributed OS: Manages a group of independent computers that appear to the user as a single system. Resources are shared across the network.
Characteristics:
- Multiple computers work together
- Resources shared across the network
- Fault tolerance (system works even if one computer fails)
- Example: Amoeba, LOCUS
5. Network OS: Provides services to computers connected over a network. It manages network resources, file sharing, and communication.
Characteristics:
- Supports file sharing and printer sharing
- Manages network security and access
- Example: Windows Server, Novell NetWare
6. Mobile OS: Designed specifically for handheld devices (smartphones, tablets) with touch interfaces, battery management, and connectivity features.
Characteristics:
- Touch-based interface
- Battery management
- Connectivity (Wi-Fi, Bluetooth, cellular)
- Example: Android, iOS
7. Embedded OS: Runs on embedded systems with limited resources (limited memory, processing power). Designed for specific, dedicated tasks.
Characteristics:
- Small footprint (minimal resources)
- Real-time response
- Dedicated functionality
- Example: Microwave controllers, car navigation systems
Q2. Explain the functions of an operating system in detail.
Answer
1. Process Management: The OS manages all processes — creating, scheduling, and terminating them. It allocates the CPU to processes using scheduling algorithms and manages process states (new, ready, running, waiting, terminated).
Key responsibilities:
- Creating and deleting processes
- Scheduling processes (FCFS, SJF, Round Robin, Priority)
- Inter-process communication and synchronisation
- Deadlock handling
2. Memory Management: The OS manages the computer's main memory (RAM), allocating space to processes and deallocating it when they finish.
Key responsibilities:
- Keeping track of which part of memory is being used and by which process
- Allocating memory to processes when they need it
- Deallocating memory when processes terminate
- Managing virtual memory (using disk as RAM extension)
- Techniques: Contiguous allocation, paging, segmentation, swapping
3. File Management: The OS organises data into files and directories, providing a hierarchical structure for easy access.
Key responsibilities:
- Creating and deleting files and directories
- Organising files in a directory structure (tree)
- Access control (read, write, execute permissions)
- File backup and recovery
- Mapping files to physical storage locations
4. Device Management: The OS manages all input/output devices through device drivers.
Key responsibilities:
- Detecting and configuring devices
- Providing device drivers for communication
- Allocating devices to processes
- Managing device queues and buffers
5. Security: The OS protects data and resources from unauthorised access.
Key responsibilities:
- User authentication (login, passwords)
- Access control (permissions)
- Protecting one process from another
- Encryption and data protection
6. User Interface: The OS provides an interface for users to interact with the computer.
Two types:
- Command Line Interface (CLI): Users type commands (e.g., Linux terminal)
- Graphical User Interface (GUI): Users interact through windows, icons, menus (e.g., Windows Desktop)
Q3. Explain process management and the various process states with a diagram.
Answer
A process is a program in execution. It includes the program code, current activity, and allocated resources. The OS manages processes through their entire lifecycle.
Process Control Block (PCB): Each process has a PCB that stores:
- Process ID (PID)
- Process state
- Program counter
- CPU registers
- Memory limits
- I/O status
Process State Diagram:
+------+ +-------+ +---------+
| New |-------->| Ready |-------->|Running |
+------+ +-------+ +---------+
^ | |
| | |
| +-------+ | |
+----|Waiting|<---+ |
| +-------+ |
| | |
| v |
| +-----------+ |
+---|Terminated |<----+
+-----------+
State Transitions:
| Transition | Description |
|---|
| New → Ready | Process is admitted to the ready queue |
| Ready → Running | Scheduler assigns CPU to the process |
| Running → Waiting | Process needs I/O or an event |
| Waiting → Ready | I/O or event completes |
| Running → Ready | Time quantum expires (preemption) |
| Running → Terminated | Process finishes execution |
Scheduling Algorithms:
| Algorithm | How It Works |
|---|
| FCFS | Processes executed in order of arrival. Simple but may cause long waiting times for short jobs (convoy effect). |
| SJF | Shortest job executed first. Minimises average waiting time but requires knowing job duration in advance. |
| Round Robin | Each process gets a fixed time quantum. Fair for all processes. If not completed in the quantum, it goes to the back of the queue. |
| Priority | Process with highest priority executed first. Can cause starvation for low-priority processes. |
9. Common Mistakes to Avoid
1. Calling the OS application software — The OS is system software, not application software. It manages the hardware and provides a platform for applications.
2. Confusing process and program — A program is a passive set of instructions (on disk). A process is a program in execution (in memory, with resources allocated). A program becomes a process when it is loaded into memory and starts executing.
3. Thinking virtual memory is part of RAM — Virtual memory uses hard disk space (swap space), not RAM. It is an extension of RAM using secondary storage.
4. Confusing time-sharing with batch processing — Time-sharing allows multiple users to interact simultaneously; batch processing runs jobs without user interaction. They are opposite approaches.
5. Forgetting the waiting state — The five process states are New, Ready, Running, Waiting, and Terminated. Students often forget the Waiting/Blocked state.
6. Confusing kernel and OS — The kernel is the core part of the OS, not the entire OS. The OS includes the kernel plus other components (shell, utilities, libraries).
7. Listing specific applications as OS functions — Functions like "browsing the web" or "creating documents" are done by application software, not the OS. OS functions are process management, memory management, file management, etc.
8. Confusing scheduling algorithms — FCFS is by arrival order, SJF is by job length, Round Robin uses time quantum, and Priority uses priority levels. Know the distinction.
10. Exam Checklist
- [ ] I can define an operating system and list its main functions
- [ ] I can name and explain 5+ types of OS (batch, time-sharing, real-time, distributed, network, mobile, embedded)
- [ ] I can explain process management and list all 5 process states
- [ ] I can draw and explain the process state transition diagram
- [ ] I can explain memory management techniques (paging, virtual memory, swapping)
- [ ] I can explain file management and directory structures
- [ ] I can differentiate between batch processing and time-sharing OS
- [ ] I can explain virtual memory and why it is needed
- [ ] I can list scheduling algorithms (FCFS, SJF, Round Robin, Priority)
- [ ] I can explain what the kernel is and its role
- [ ] I can differentiate between a program and a process
- [ ] I can explain device management and security functions of the OS