- An operating system provides services to both the user and the programs.
- OS provides an environment for running programs.
- OS provides users with the necessary services to run the programs conveniently.
Here are some of the common services provided by an operating system-
- Program execution
- Input-output operation
- File system manipulation
- Error detection and handling
- Resource Management
1. Program execution:
Operating systems handle various type of activities, from user programs to system programs like printer spooler, name servers, file server, etc. All these activities are encapsulated as a process. A process includes the whole execution context like code to be executed, data to be handled, registers, OS resources used.
Here are the main activities of OS in terms of program management –
- Provides a mechanism for handling deadlocks.
- Manages the execution of the program.
- Run the program.
- Loads a program into memory.
- Provides a process communication mechanism.
- Provides a mechanism for synchronizing processes.
2. Input-output operation:
An I / O subsystem consists of Input / Output devices and their respective driver software. Drivers hide the specification of that particular hardware device from users.
An operating system manages the communication between the user and the device driver.
- I / O operation means the read or write operation with a specific Input / Output file or device.
- The operating system provides access to the required Input / Output device when needed.
3. File system manipulation:
A file represents a group of related data. Computers can store files on disk (secondary storage) for the long-term. Examples of these storage media include magnetic field, magnetic tape, and optical drives such as CD, DVD. Each of these media has its own properties like speed, capacity, data transfer rate, and data access process.
A file system is generally organized in directories for easy navigation and use. These directories can contain files and other directions.
Here are the main activities of an operating system when it comes to managing files –
- The program must read a file or write a file.
- The operating system provides an interface to create the file system backup.
- The operating system provides an interface for the user to create / delete files.
- The operating system provides an interface for the user to create / delete directories.
- The operating system allows the program to run on file.
- Permission varies from read-only, read-write, denied, etc.
4. Communication :
In the case of distributed systems that are a collection of processors that do not share memory, devices, or a clock, the operating system manages communications between all the processes. Several processes communicate with each other through network communication lines.
The operating system manages routing and connection strategies, as well as contention and security issues.
Here are the main activities of an operating system in terms of communication –
- The two processes can be on one computer or on different computers, but are connected through a computer network.
- Two processes often require data transfer between them.
- Communication can be implemented by two methods, either by shared memory or by transmission of messages.
5. Error handling:
Errors can occur anytime and anywhere. An error can occur in the CPU, in the I / O devices, or in the memory hardware.
Here are the main activities of an operating system in regards to error handling –
- The operating system takes the appropriate measures to ensure correct and consistent computing.
- The operating system continuously checks for errors.
6. Resource Management:
In the case of a multi-user or multi-tasking environment, resources like main memory, CPU cycles, and file storage should be allotted to each user or job.
Here are the main activities of an operating system when it comes to resource management –
- CPU scheduling algorithms are used for better CPU utilization.
- The operating system manages all kinds of resources with the help of schedulers.
Considering a computer system having several users and the simultaneous execution of several processes, the different processes must be protected from each other.
Protection refers to a process or means of controlling the access of programs, processes, or users to resources defined by a computer system.
Here are the main activities of an operating system with regard to protection –
- The operating system ensures that external I / O devices are protected against invalid access attempts.
- The operating system ensures that all the access to system resources is controlled.
- The operating system provides authentication functions for each user by means of passwords.