Following are the services provided by an operating system for the convenience of users:

Program Execution

The purpose of computer system is to allow the users to execute programs in an efficient manner. The operating system provides an environment where the user can conveniently run these programs. The user does not have to worry about the memory allocation or de-allocation or any other thing because these things are taken care of by the operating system.

To run a program, the program is required to be loaded into the RAM first and then to assign CPU time for its execution. Operating system performs this function for the convenience of the user. It also performs other important tasks like allocation and de-allocation of memory, CPU scheduling etc.

2. I/O Operations

Each program requires an input and after processing the input submitted by user it produces output. This involves the use of I/O devices. The operating system hides the user from all these details of underlying hardware for the I/O. So the operating system makes the users convenient to run programs by providing I/O functions. The I/O service cannot be provided by user-level programs and it must be provided by the operating system.

3. File System Manipulation

While working on the computer, generally a user is required to manipulate various types of files like as opening a file, saving a file and deleting a file from the storage disk. This is an important task that is also performed by the operating system.

Thus operating system makes it easier for the user programs to accomplish their task by providing the file system manipulation service. This service is performed by the 'Secondary Storage Management' a part of the operating system.

4. Communication

Operating system performs the communication among various types of processes in the form of shared memory. In multitasking environment, the processes need to communicate with each other and to exchange their information. These processes are created under a hierarchical structure where the main process is known as parent process and the sub processes are known as child processes.

5. Error Detection

Operating system also deals with hardware problems. To avoid hardware problems the operating system constantly monitors the system for detecting the errors and fixing these errors (if found). The main function of operating system is to detect the errors like bad sectors on hard disk, memory overflow and errors related to I/O devices. After detecting the errors, operating system takes an appropriate action for consistent computing.

This service of error detection and error correction cannot be handled by user programs because it involves monitoring the entire computing process. These tasks are too critical to be handed over to the user programs. A user program, if given these privileges; can interfere with the corresponding operation of the operating systems.

6. Resource allocation

In the multitasking environment, when multiple jobs are running at a time, it is the responsibility of an operating system to allocate the required resources (like as CPU, main memory, tape drive or secondary storage etc.) to each process for its better utilization. For this purpose various types of algorithms are implemented such as process scheduling, CPU scheduling, disk scheduling etc.

7. Accounting

Operating system keeps an account of all the resources accessed by each process or user. In multitasking, accounting enhances the system performance with the allocation of resources to each process ensuring the satisfaction to each process.

8. Protection System

If a computer system has multiple users and allows the concurrent execution of multiple processes, then the various processes must be protected from one another's activities.

Operating System Services as Resource Manager

Operating system works as a resource manager to manage the resources efficiently in a computer such as processor, memory, input/ output devices etc. To decide about which resources are used by which running programs and how to administer them, is known as the resource management. Operating system assigns the computer resources to processes for an efficient use; therefore, it plays an important role as a resource manager while ensuring the user satisfaction.

To manage the computer resources most effectively the OS decides which program should run at what time, how much memory should be allocated for an execution of a program, where to save the file so that disk space can be optimally utilized etc. Below given are some of the important services performed by operating system as a resource manager:

1. Process Management

In multiprocessing environment, operating system allows more than one application (or process) to run simultaneously. Process management is a part of an operating system which manages the processes in such a way that system performance can be enhanced. The operating system deals with other types of activities also that includes user programs and system programs like as printer spooling virtual memory, swapping etc.

A process is an activity that needs certain resources to complete its task. Various computer resources are CPU time, main memory, and I/O devices. These resources are allocated to the processes and based on decision that which process should be assigned for the allocation of resource and this decision is taken by process management implementing the process scheduling algorithms.

It is important to note that a process is not a program. A process is only ONE instant of a program in execution. There are many processes running the same program.

The five major activities of an operating system in regard to process management are:

Creation and deletion of user and system processes.

Suspension and re-activation of processes.

A mechanism for process synchronization.

A mechanism for process communication.

A mechanism for deadlock handling.

2. Main-Memory Management

Memory management is the most important part of an operating system that deals directly with both the primary (known as main memory) memory and secondary memory. The main memory is a large array of bytes and each byte has its own address. Main memory provides the storage for a program that can be accessed directly by the CPU for its exertion. So for a program to be executed, the primary task of memory management is to load the program into main memory.

Memory management performs mainly two functions, these are:

Each process must have enough memory in which it has to execute.

The different locations of memory in the system must be used properly so that each and every process can run most effectively.

Operating system loads the instructions into main memory then picks up these instructions and makes a queue to get CPU time for its execution. The memory manager tracks the available memory locations which one is available, which is to be allocated or de-allocated. It also takes decision regarding which pages are required to swap between the main memory and secondary memory. This activity is referred as virtual memory management that increases the amount of memory available for each process.

The major activities of an operating system in regard to memory-management are:

Keep track of which part of memory are currently being used and by whom.

Decide which processes should be loaded into memory when the memory space is free.

Allocate and de-allocate memory spaces as and when required.

3. File Management

A file is a collection of related information defined by its creator. Computer can store files on the disk (secondary storage), which provide long term storage. Some examples of storage media are magnetic tape, magnetic disk and optical disk. Each of these media has its own properties like speed, capacity, and data transfer rate and access methods.

A file system is normally organized into directories to make ease of their use. These directories may contain files and other directories. Every file system is made up of similar directories and subdirectories. Microsoft separates its directories with a back slash and its file names aren't case sensitive whereas Unix-derived operating systems (including Linux) use the forward slash and their file names generally are case sensitive.

The main activities of an operating system in regard to file management are creation and deletion of files/ folders, support of manipulating files/ folders, mapping of files onto secondary storage and taking back up of files.

4. I/O device Management

Input/ Output device, management is a part of an operating system that provides an environment for the better interaction between system and the I/O devices (such as printers, scanners tape drives etc.). To interact with I/O devices in an effective manner, the operating system uses some special programs known as device driver. The device drivers take the data that operating system has defined as a file and then translate them into streams of bits or a series of laser pulses (in regard with laser printer).

A device driver is a specific type of computer software that is developed to allow interaction with hardware devices. Typically this constitutes an interface for , communicating with the I/O device, through the specific computer bus or communication subsystem that the hardware is connected with. The device driver is a specialized hardware dependent computer program that enables another program, typically an operating system to interact transparently with a hardware device, and usually provides the required interrupt handling necessary for the time dependent hardware interfacing.

5. Secondary-Storage Management

A computer system has several levels of storage such as primary storage, secondary storage and cache storage. But primary storage and cache storage can not be used as a permanent storage because these are volatile memories and its data are lost when power is turned off Moreover, the main memory is too small to accommodate all data and programs. So the computer system must provide secondary storage to backup the main memory. Secondary storage consists of tapes drives, disk drives, and other media.

The secondary storage management provides an easy access to the file and folders placed on secondary storage using several disk scheduling algorithms.

The four major activities of an operating system in regard to secondary storage management are:

•.Managing the free space available on the secondary-storage device .

•.Allocation of storage space when new files have to be written .

•.Scheduling the requests for memory access.

•.Creation and deletion of files.

6. Network Management

An operating system works as a network resource manager when multiple computers are in a network or in a distributed architecture. A distributed system is a collection of processors that do not share memory, peripheral devices, or a clock. The processors communicate with one another through communication lines called network The communication-network design must consider routing and network strategies, and the problems with network and security.

Most of today's networks are based on client-server configuration. A client is a program running on the local machine requesting to a server for the service, whereas a server is a program running on the remote machine providing service to the clients by responding their request.

7. Protection (User Authentication)

Protection (or security) is the most demanding feature of an operating system. Protection is an ability to authenticate the users for an illegal access of data as well as system.

Operating system provides various services for data and system security by the means of passwords, file permissions and data encryption. Generally computers are connected through a network or Internet link, allowing the users for sharing their files accessing web sites and transferring their files over the network. For these situations a high level security is expected.

At the operating system level there are various software firewalls. A firewall is configured to allow or deny traffic to a service running on top of the operating system. Therefore by installing the firewall one can work with running the services, such as telnet or ftp, and not to worry about Internet threats because the firewall would deny all traffic trying to connect to the service on that port.

If a computer system has multiple users and allows the concurrent execution of multiple processes, then the various processes must be protected from one another's activities. Protection refers to mechanism for controlling the access of programs, processes, or users to the resources defined by a computer system.

8. Command Interpreter System

A command interpreter is an interface of the operating system with the user. The user gives commands which are executed by operating system (usually by turning them into system calls). The main function of a command interpreter is to get and execute the user specified command.

Command-Interpreter is usually not a part of the kernel, since multiple command interpreters may be supported by an operating system, and they do not really need to run in kernel mode. There are two main advantages of separating the command interpreter from the kernel.

If you want to change the way the command interpreter looks, i.e., you want to change the interface of command interpreter, then you can do that if the command interpreter is separate from the kernel. But if it is not then you cannot change the code of the kernel and will not be able to modify the interface.

If the command interpreter is a part of the kernel; it is possible for an unauthenticated process to gain access to certain part of the kernel. So it is advantageous to have the command interpreter separate from kernel.