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:
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:
Output may go to devices like:
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:
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:
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:
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.