Topics
- 1. Definition of Operating System
- 2. Primary Objectives of an Operating System
- 3. Functions of an Operating System
- 4. Services of an Operating System
-
An Operating System is a system software that manages computer hardware and software resources and provides common services for computer programs.
-
An Operating System acts as an interface between the user, application software, and computer hardware.
-
An Operating System is a system software that controls and manages all resources of a computer and utilizes them effectively.
-
An Operating System is also called a resource manager or resource allocator because it manages resources such as CPU time, memory space, file storage, and input/output devices.
Examples of Operating Systems
-
Microsoft Windows
-
Windows 10
-
Windows 8
-
Windows 7
-
Windows Vista
-
Windows XP
-
-
MS-DOS
-
Linux
-
Apple macOS
-
Android
1. Convenience
The main objective of an operating system is to make the computer system convenient and easy to use.
It hides the complex details of hardware resources from users and programmers and provides a simple interface to interact with the system.
2. Efficiency
An operating system ensures that computer system resources are used efficiently.
It manages resources like CPU, memory, and storage to achieve better performance.
3. Ability to Evolve
An operating system should be designed so that it can evolve over time.
It should allow updates, improvements, testing, and security enhancements without affecting system performance.
An Operating System performs many important functions to manage computer resources and ensure smooth operation of the system.
1. Process Management
Process management deals with the management of CPU and processes.
Main activities of the operating system in process management:
-
The operating system allocates CPU to different processes.
-
When the CPU becomes free, the OS selects a process from the job queue and assigns the CPU to that process.
-
When the execution of a process is completed, the OS frees the CPU and selects another process for execution.
-
The selection of processes is done using CPU scheduling algorithms.
Examples of scheduling algorithms:
-
First Come First Serve Scheduling (FCFS)
-
Shortest Job First Scheduling (SJF)
-
Round Robin Scheduling (RR)
-
Priority Scheduling
2. File Management
A file is a logical collection of related information stored in secondary storage such as a hard disk.
The operating system manages files, folders, and directories.
Main activities in file management:
-
Creating and deleting files
-
Creating and deleting directories
-
Organizing files into folders
-
Maintaining file information
The OS stores information about files using the File Allocation Table (FAT).
FAT stores information such as:
-
File name
-
File type (text, binary)
-
File size
-
Access mode (sequential, indexed, direct, relative)
The OS also ensures that files are opened with proper access rights such as:
-
Read (R)
-
Write (W)
-
Read/Write (R/W)
3. Memory Management
Memory management deals with the management of main memory.
Memory is a large array of words or bytes, each having its own address.
Main memory is directly accessed by the CPU, and a program must be loaded into main memory before execution.
Activities of the operating system in memory management:
-
Keeps track of which part of memory is in use and which is free
-
Allocates memory to processes when needed
-
Deallocates memory when a process finishes
-
Reallocates the freed memory to other processes
4. Input / Output (I/O) Management
The operating system manages all input and output devices efficiently.
Process of I/O management:
-
The OS receives input from input devices such as the keyboard.
-
It stores the data in main memory.
-
The CPU processes the data.
-
The result is sent to output devices such as a monitor or printer.
The OS manages devices using device drivers.
A device driver is a small software program that allows the operating system to communicate with hardware devices.
The OS also:
-
Keeps track of all devices using I/O controllers
-
Decides which process gets a device, when, and for how long
-
Allocates and deallocates devices efficiently
5. Security Management
Security management protects the system from unauthorized access and threats.
Functions include:
-
Protection from computer viruses
-
Use of virus scanning utilities
-
Setting up a firewall to block suspicious network activity
-
Protecting files and programs with user login and passwords
6. Control Over System Performance
The operating system monitors the overall performance of the system.
It:
-
Records the delay between service requests and system response
-
Detects performance problems
-
Helps improve system efficiency
7. Job Accounting
Job accounting keeps track of the resources used by different users and jobs.
It records:
-
CPU usage
-
Memory usage
-
Time used by different processes
This information helps in system analysis and billing in multi-user systems.
8. Error Detection Aids
The operating system helps in detecting and handling errors.
It checks for errors in:
-
CPU
-
Memory
-
Input/Output devices
It also generates:
-
Error messages
-
Dumps
-
System traces
These help in debugging and fixing system problems.
9. Coordination Between Software and Users
The operating system coordinates between:
-
Users
-
Application software
-
System software such as compilers, interpreters, and assemblers
It ensures that all programs work smoothly and efficiently with the computer system.
An Operating System (OS) provides various services to users and application programs.
These services make it easier to execute programs and use computer resources efficiently.
The operating system provides an environment in which programs can execute conveniently and efficiently.
Main Services Provided by an Operating System
-
User Interface
-
Program Execution
-
File System Manipulation
-
I/O Operations
-
Communication
-
Resource Allocation
-
Error Detection
-
Accounting
-
Protection and Security
1. User Interface
The operating system provides a User Interface (UI) through which users can interact with the computer.
There are three main types of user interfaces:
a) Command Line Interface (CLI)
In a Command-line interface, users interact with the computer by typing text commands.
Example: MS-DOS
Users must remember and type commands to perform tasks.
b) Batch Interface
In a Batch Interface, a set of commands is stored in a file and executed automatically.
This method allows multiple commands to be executed together without user interaction.
c) Graphical User Interface (GUI)
In a Graphical user interface, users interact with the system using icons, windows, and menus.
Example: Microsoft Windows
This interface is easy to use and widely used in modern operating systems.
2. Program Execution
Before a program can run, it must be loaded into memory.
The operating system:
-
Loads the program into main memory
-
Starts the program execution
-
Manages program execution
-
Allows the program to end normally or abnormally (if an error occurs)
3. File System Manipulation
Programs often need to read data from files or write data to files.
The operating system provides permission for file operations such as:
-
Creating files
-
Deleting files
-
Reading files
-
Writing files
-
Managing directories and folders
This service is handled by the file system.
4. Input / Output (I/O) Operations
A running program may require input or output operations.
Input may come from devices like:
-
Keyboard
-
Mouse
Output may go to devices like:
-
Monitor
-
Printer
For protection and efficiency, users cannot directly access hardware devices.
The operating system provides a simple interface so programs can perform I/O using read and write operations.
5. Communication
Different processes may need to communicate with each other for data transfer.
Processes can communicate:
-
Within the same computer
-
Between different computers connected through a network
The operating system supports communication using methods such as:
-
Shared Memory
-
Message Passing
6. Resource Allocation
When multiple processes run at the same time, the operating system must allocate resources to each process.
Resources include:
-
CPU
-
Main memory
-
Files
-
I/O devices
For efficient CPU usage, the OS uses CPU scheduling algorithms such as:
-
First Come First Serve Scheduling
-
Round Robin Scheduling
-
Shortest Job First Scheduling
7. Error Detection
Errors can occur in:
-
CPU
-
Memory
-
I/O devices
-
User programs
The operating system detects these errors and takes corrective action to ensure proper system operation.
8. Accounting
The operating system keeps track of:
-
Which user is using the system
-
How much CPU time is used
-
How much memory and storage are used
This information can be used for:
-
System analysis
-
Billing purposes
-
Improving system performance
9. Protection and Security
Protection and security control access to system resources.
Security features include:
-
User login and password authentication
-
Preventing unauthorized access
-
Protecting processes from interfering with each other
-
Protecting files and system resources
These mechanisms help maintain the safety and integrity of the computer system.