What are the Basic Services Provided by the Operating System?
Introduction
An Operating System is nothing but a software program that acts as an interface between the hardware, the application software, and users. The main aim of an operating system is to manage all the computer resources.
Examples of Operating Systems are Windows, Macintosh, Ipad, Android, Linux, BSD, and, Solaris. Refer to the diagram below to understand the value and working of the operating system.
To understand the topic - what are the basic services provided by the operating system, we should know the need for an operating system. An operating system is one of the most crucial parts of any computer system, and we can say that an operating system is the brain of a computer system. An operating system is responsible for managing the memory of a computer, process, hardware, and software applications.
The prime goal of an operating system can be broadly divided into two major goals. The first goal can be called the primary goal which is nothing but providing the various user applications an environment to run on. The secondary goal is gaining efficiency by running various programs.
The features of an operating system are:
- Providing security to system and application software.
- Memory management.
- Disk management.
- I/O operations.
- File management, etc.
Example of Operating Systems Services
An environment for the execution of the program is one of the most basic but important facilities that an operating system provides. An operating system manages the various resources of the computer system (memory, disk drives, printers, CPU, etc.). An operating system is also responsible for managing, executing, and providing resources to the system software(s), and the application software(s).
Some of the basic services provided by the operating system are:
- Provides user interface.
- Execute programs.
- Provides interface for input-output operation.
- File System Management.
- Memory Management.
- Security Management.
- Resource Management.
- Communication between processes.
- Error detection and correction.
- Protection and Security Management.
Refer to the image below to see the various functions of an operating system.
Let us now discuss the topic - what are the basic services provided by the operating system in detail.
Program Execution
An operating system provides an environment for the execution of programs. Not just that, the operating system is responsible to load the program in execution from the secondary to the main memory (RAM). After loading the program into the main memory, the operating system provides CPU access to the program. Once the execution of the program is completed, the Operating System also makes sure that the program is removed from the main memory (memory release).
Note: An operating system also decides whether the program in execution has been successfully terminated or not. For checking it uses the exit() method.
CPU Scheduling
Scheduling of processes is one of the most important aspects or roles of any operating system. Process Scheduling is an important activity performed by the process manager of the respective operating system. Scheduling deals with the removal of the current process from the CPU and selecting another process for execution.
The Process Scheduler of an operating system deals with process scheduling. The process scheduler chooses a process to be executed, and the process scheduler also decides for how long the chosen process is to be executed. Process Schedulers use scheduling algorithms to choose the best process to be scheduled hence helping in better utilization of the CPU.
There are many types of CPU scheduling algorithms, some of them are:
- First Come First Serve.
- Shortest Job First.
- Shortest Remaining Time First.
- Round Robin Scheduling.
- Priority Scheduling.
- Multilevel Queue Scheduling.
- Multilevel Feedback Queue Scheduling.
Input-Output Management
As we know the various processes require input-output operations in between the execution, so the processes move into a waiting state for the input-output operations. Now, the Operating System must provide an interface so that the I/O becomes convenient.
The operating system deals with device drivers of various input-output devices such as keyboards, mouse, monitors, etc. A program may require to access some file(s) in between its execution, so the operating system also provides a means to access the file(s).
File Management
File management is one of the basic but important features provided by the operating system. The file management in the operating system is nothing but software that handles or manages the files (binary, text, pdf, docs, audio, video, etc.) present in computer software. The file system in the operating system is capable of managing individual as well as groups of files present in the computer system. The file management in the operating system manages all the files present in the computer system with various extensions (such as .exe, .pdf, .txt, .docx, etc.)
We can also use the file system in the operating system to get details of any file(s) present on our system. The details can be:
- location of the file (the logical location where the file is stored in the computer system)
- the owner of the file (who can read or write on the particular file)
- when was the file created (time of file creation and modification time)
- a type of file (format of the file for example text, pdfs, docs, etc.)
- state of completion of the file, etc.
Disk Management
Disk Management is an important functionality provided by the Operating System which can be used to create, delete, format disk partitions, and much more. It enables users to manage and view the different disks and functions like viewing, creating, deleting, and shrinking the partitions associated with the disk drives.
Some of the other functions of Disk Management are:
- Disk Management helps to format disk drives.
- Disk Management enables the user to rename a disk.
- Disk Management also enables the user to change the file system of a disk drive.
- Using Disk Management, the user can assign a Drive Letter to a disk. For example, C Drive or D drive, etc. can be found in Windows File System.
For managing the disks and their partitions, the operating system uses Disk Scheduling algorithms. Let us briefly discuss the various discuss scheduling algorithms:
-
FCFS Algorithm: FCFS is one of the simplest algorithms which stands for First Come First Serve. As the name suggests, the I/O request that has come first will be served first. So, it serves the I/O requests in the order of their arrival.
-
SSTF Algorithm: SSTF is another simple algorithm that stands for Shortest Seek Time First. As the name suggests, the I/O requests having the least seek time are served first.
-
SCAN and C-SCAN Algorithm: SCAN algorithm moves the disk arm in a particular direction and serves the I/O requests coming in its path. The disk then reverses its direction and serves the I/O requests present in the path. Since the movement of the disk is like an elevator, it is also known as the Elevator Algorithm.
In C-SCAN or Circular-SCAN algorithm, the disk arm does not reverse its direction, it simply goes to the other end of the disk and starts serving the requests from there.
- LOOK and C-LOOK Algorithm: The LOOK scheduling algorithm works somewhat similarly to the SCAN algorithm. In the LOOK Algorithm, the disk arm reverses its direction from the last served request. Hence, the LOOK algorithm prevents useless delay in the movement of the disk to the last.
In C-LOOK or Circular-LOOK algorithm, the disk arm does not reverse its direction from the last request, it simply goes to the other end’s last request and starts serving the requests from there.
Memory Management
Memory management is managing the data stored present on the memory for achieving proper utilization of the memory. Memory management plays an important role in achieving a degree of multiprogramming (running of two or more programs simultaneously by a computer with more than one central processor).
The various facilities provided by memory management are:
- keeps track of memory locations and checks whether it is free or allocated to some process.
- enables processes to share memory space hence helping various programs to reside in the same address space of main memory at different times.
- protects the memory address space of every process so that a process cannot access the memory of another process (es) without proper permission of the operating system.
- performs swapping that is moving information back and forth between primary memory and secondary memory so that various processes can be executed even if the main memory is small in size.
Paging is a technique that divides memory into fixed-sized blocks. The main memory is divided into blocks known as frames and the logical memory is divided into blocks known as pages.
Segmentation divides the user program and the secondary memory into uneven-sized blocks known as segments.
Resource Management
A process requires various resources like registers, memory, CPU, I/O devices, etc. to complete its execution. In today's scenarios when there are so many processes running simultaneously, proper allocation of these resources has become one of the most crucial works of an operating system.
The various facilities provided by resource management are:
- memory allocation and de-allocation.
- CPU allocation.
- handling and providing I/O access.
- file system allocation, etc.
Communication
A process sometimes needs to communicate with another process (es) for exchanging information (known as inter-process communication). A process may communicate with the other process present on the same computer system or the other computer system.
So, an operating system also provides means of process communication in two ways namely: shared memory and message passing. As the name suggests, shared memory is the memory that can be accessed by multiple processes at the same time (simultaneously). On the other hand, message passing is a technique used by a process for invoking or sending a message to another process.
Error Detection, Device Management, and Security Management
Errors may arise in any of the resources like CPU, memory, input-output devices, etc. So, it is the responsibility of an operating system he OS to keep on the lookout for such errors, correct the errors when they occur, and make sure that the system works uninterruptedly.
The operating system also controls the access of various system resources so that any unauthorized process (or malware) cannot access the resources. The protection of processes and devices from malware practices comes under security management of the operating system.
The operating system is responsible for keeping track of the status of all the devices present in the computer system. So, device management refers to managing all the hardware devices of the computer system. Device management includes the management of the storage device as well as the management of all the input and output devices of the computer system.
Learn More about Operating System
To learn more about the operating systems, refer below article:
Conclusion
- The main aim of an operating system is to manage all the computer resources.
- An operating system provides an environment for the execution of programs.
- Operating system is responsible to load the program in execution from the secondary to the main memory (RAM).
- Process Scheduling is an important activity performed by the process manager of the respective operating system. Scheduling deals with the removal of the current process from the CPU and selecting another process for execution.
- File management in the operating system is software that handles or manages the files (binary, text, pdf, docs, audio, video, etc.) present in computer software.
- Disk Management enables users to manage and view the different disks and functions like viewing, creating, deleting, and shrinking the partitions associated with the disk drives.
- Memory management is managing the data stored present on the memory for achieving proper utilization of the memory.