Unit 1: Introduction
Introduction to Operating System
An Operating System (OS) is system software that acts as an interface between the user and computer hardware.
Simple meaning: The operating system tells the computer how to work and how to respond to user commands.
Examples of Operating Systems:
- Windows
- Linux
- macOS
- Android
- iOS
Without an operating system:
- Computer hardware cannot be used
- Programs cannot run
Operating System Structure
The structure of an operating system defines how its components are organized and interact.
One of the most common structures is the Layered Structure.
Layered Structure of Operating System
In the layered approach, the OS is divided into multiple layers, where:
- Each layer performs a specific function
- Each layer uses services of the layer below it
Simple meaning: Think of OS like a multi-storey building:
- Ground floor → Hardware
- Top floor → User
Layered Structure Diagram (Text Form)
Explanation of Each Layer
| Layer | Function |
|---|---|
| User Layer | Users interact with system |
| Application Layer | Runs user programs |
| System Call Layer | Interface between OS & programs |
| Kernel | Core of OS (process, memory, file control) |
| Hardware | CPU, memory, I/O devices |
Advantages of Layered Structure
- Easy to design and debug
- Clear separation of functions
- Better security
Disadvantages
- Performance may reduce
- Strict layer dependency
System Components of Operating System
The operating system consists of several key components that work together.
Process Management
Controls execution of programs.
Functions:
- Creating and deleting processes
- Scheduling processes
- Process synchronization
- Deadlock handling
Memory Management
Manages main memory (RAM).
Functions:
- Allocates memory to programs
- Deallocates memory after use
- Keeps track of used and free memory
File System Management
Manages files and directories.
Functions:
- Create, delete, read, write files
- Organize files in folders
- Protect file data
I/O Device Management
Manages input/output devices.
Examples:
- Keyboard
- Printer
- Disk
Functions:
- Device drivers
- Buffering
- Spooling
Secondary Storage Management
Manages hard disk and storage devices.
Functions:
- Free space management
- Disk scheduling
- Disk allocation
Protection and Security
Protects system from unauthorized access.
Functions:
- User authentication
- Access control
- Data security
Command Interpreter (Shell)
Interface that accepts user commands.
Examples:
- Command Prompt
- Linux Shell
Functions of Operating System
The operating system performs many important functions.
Process Control
- Starts and stops programs
- Manages CPU time
Memory Control
- Allocates and frees memory
- Prevents memory misuse
File Management
- Organizes files
- Controls file access
Device Management
- Controls I/O devices
- Handles device communication
Security and Protection
- Protects data and programs
- Prevents unauthorized access
Error Detection
- Detects hardware and software errors
- Takes corrective action
Resource Allocation
- Shares CPU, memory, and devices
- Ensures fair usage
User Interface
- Provides GUI or CLI
- Allows user interaction
Summary Table
| Aspect | Description |
|---|---|
| OS | Interface between user and hardware |
| Layered Structure | OS divided into layers |
| System Components | Process, memory, file, device management |
| OS Functions | Resource management, security, error handling |
Conclusion
An operating system is the backbone of a computer system.
Its layered structure, system components, and core functions ensure:
- Efficient resource utilization
- Smooth program execution
- Secure and user-friendly operation
Understanding these basics is essential for OS exams, interviews, and system-level knowledge.
Classification of Operating Systems
Operating systems are classified based on how they process jobs, handle users, and manage hardware resources.
Types of Operating Systems
Batch Operating System
A batch operating system processes jobs in batches without user interaction.
Simple explanation
Users submit jobs (programs + data) together.
The OS executes them one after another automatically.
Characteristics
- No user interaction during execution
- Jobs are grouped in batches
- Long turnaround time
Example
-
Early IBM mainframe systems
Advantages
- Efficient CPU utilization
- Good for large data processing
Disadvantages
- No immediate feedback
- Difficult to debug errors
Interactive Operating System
Allows direct interaction between user and computer.
Simple explanation
User gives commands and gets immediate response.
Characteristics
- User interaction via keyboard/mouse
- Fast response time
Examples
- Windows
- Linux
- macOS
Advantages
- Easy to use
- Quick feedback
Disadvantages
-
Requires more system resources
Time-Sharing Operating System
Allows multiple users to share CPU time.
Simple explanation
Each user gets a small time slice of CPU, making the system appear fast.
Characteristics
- Multitasking
- Quick response
- CPU scheduling
Example
-
UNIX
Advantages
- Efficient CPU usage
- Supports many users
Disadvantages
-
Performance decreases with too many users
Real-Time Operating System (RTOS)
An OS that responds within a fixed time limit.
Simple explanation
Correctness depends on time as well as result.
Types of RTOS
| Type | Description |
|---|---|
| Hard RTOS | Missing deadline = system failure |
| Soft RTOS | Missing deadline reduces performance |
Examples
- Air traffic control
- Medical systems
- Embedded systems
Advantages
- High reliability
- Predictable response
Disadvantages
- Complex design
- Expensive
Multiprocessor Operating System
Supports multiple CPUs working together.
Simple explanation
More than one processor executes tasks simultaneously.
Characteristics
- Parallel processing
- Shared memory
Examples
-
Modern servers
Advantages
-
High performance
-
Reliability
Disadvantages
-
Complex synchronization
Multiuser Operating System
Allows multiple users to use the system at the same time.
Simple explanation
Many users log in simultaneously and work independently.
Examples
- UNIX
- Linux servers
Advantages
- Resource sharing
- Cost effective
Disadvantages
-
Security concerns
Multiprocess Operating System
Allows multiple processes to run at the same time.
Simple explanation
Several programs execute simultaneously.
Characteristics
- Process scheduling
- Context switching
Example
- Windows
- Linux
Advantages
-
Better CPU utilization
Disadvantages
-
Complex process management
Multithreaded Operating System
Allows multiple threads within a process.
Different parts of the same program run concurrently.
Example
- Web browsers
- Media players
Advantages
- Faster execution
- Better responsiveness
Disadvantages
-
Synchronization issues
Operating System Services
Operating system services help users and programs use hardware efficiently.
Major OS Services
| Service | Description |
|---|---|
| Program execution | Runs programs |
| I/O operations | Handles input/output |
| File system | Manages files |
| Communication | Inter-process communication |
| Error detection | Detects errors |
| Resource allocation | Allocates CPU, memory |
| Protection & security | Controls access |
Reentrant Kernels
A reentrant kernel allows multiple processes to execute kernel code simultaneously.
Kernel functions can be safely used by many processes at the same time.
Characteristics
- No shared writable data
- Uses local variables
Advantages
- Supports multiprocessing
- Faster system response
Example
-
Modern UNIX kernels
Kernel Architectures
Monolithic Kernel
All OS services run inside the kernel.
Characteristics
- Large kernel
- High performance
Examples
- Linux
- UNIX
Advantages
-
Fast system calls
Disadvantages
- Difficult to maintain
- Crash affects whole system
Microkernel
Only essential services run in kernel mode.
Characteristics
- Small kernel
- Other services run in user mode
Examples
- Minix
- QNX
Advantages
- Better security
- Easy maintenance
Disadvantages
-
Slower due to message passing
Comparison: Monolithic vs Microkernel
| Feature | Monolithic | Microkernel |
|---|---|---|
| Kernel size | Large | Small |
| Performance | High | Moderate |
| Security | Less | High |
| Stability | Low | High |
| Maintenance | Difficult | Easy |
Summary
| Topic | Key Point |
|---|---|
| Batch OS | Processes jobs in batches |
| Interactive OS | User interaction |
| Time-Sharing OS | CPU time sharing |
| RTOS | Deadline-based response |
| Multiprocessor OS | Multiple CPUs |
| Multiuser OS | Multiple users |
| Multithreaded OS | Multiple threads |
| OS Services | Program, file, I/O management |
| Kernel Types | Monolithic, Microkernel |