The functions of an operating system (OS) cover a wide range of crucial duties that make it easier to manage and utilise computer resources effectively. It is crucial for controlling hardware resources, running programmes, and offering essential services.
How can such small units of a system carry out such extensive processing, and how can multiple processes coincide? If you have and are still curious, this blog will help you understand the concepts more clearly.
What is an Operating System?
An Operating System provides an interface for the user and hardware. It is in charge of running all the processes, Resource Allocation, CPU management, File Management, and many other tasks in our system. The purpose of an operating system is to provide an atmosphere to the user where they can execute programs easily and efficiently.
Some of the most used operating systems are as such:
Windows
macOS
Linux
iOS
Android
Unix
IBM z/OS
Types of Operating Systems
Let us look at some types of Operating Systems-
Batch Operating SystemThis type of OS does not interact with the system directly. A set of similar jobs is stored in the main memory. The next job gets assigned to the CPU only when the previous job is done. Read about Batch Operating System here.
Multiprogramming Operating System
The main memory consists of multiple jobs waiting for CPU access. The OS selects one of the processes and assigns it to the CPU. Now, if the process in execution is interrupted by an outside or internal factor process, it performs context switching, and another process in the queue is executed. In this way, we can utilize the CPU at max, and the user can do multiple tasks at once.
Multitasking Operating System
Multitasking OS allows the user to perform multiple tasks as a single user at a given time on one computer system. The switch is so rapid that the user gets the illusion that all the processes are running at the same time.
Time-Sharing Operating System
In this system, processors simultaneously share time among multiple users. This time is referred to as quantum. Once the task is completed, the OS switch to the next task. The main goal of such systems is to reduce response time.
Real-Time Operating System
Real-Time OS is usually built for dedicated systems to accomplish specific tasks within the specified time. This time period is called response time.
An operating system provides a platform for users to run their software programs. It is designed to operate various tasks, such as controlling various tasks and execution, etc.
Booting is the process of starting the computer. When the CPU is first switched ON, loading the OS to the main Memory to start the computer is booting. Hence, the OS helps start the computer when the power is switched ON.
The OS helps to run more than one app on the computer. It plays a vital role while multitasking since it manages Memory and other devices.
OS acts as an interface between computer software and hardware. It also acts as an interface for the user and the computer.
All the data in the system is in the form of files which can be hard to access. The OS helps to manage these files on the system. Thus, it becomes easier for the user to access these files easily.
The OS also helps to manage the main memory of the system. It allocates and deallocates memory for all the system tasks.
Functions of Operating System
Let us look at some functions of Operating Systems-
Process Management
In a multiprogramming environment, when there are multiple processes queued, it is the job of the OS to decide the order in which process will have access to the processor and the time each process has for some event. This function of the operating system is known as process scheduling.
Process Scheduling is done using various algorithms. These scheduling are implemented using schedulers like pipelines where the process is scheduled.
Long-term scheduler- It interacts between secondary and primary memory and decides the process that will be submitted for processing.
Medium-term scheduler- It helps in rescheduling the process into the main memory, and the process can be continued from where it left off.
Short-term scheduler- It is the fastest scheduler that selects only those ready to execute processes.
Memory Management
An operating system is responsible for managing the memory. Primary memory is fast but relatively small compared to secondary memory. This memory through which the CPU directly interacts with the operating system and keeps track of the memory used by a particular user in their program. i.e., The memory that has already been utilized and has not yet been used.
All the data is stored in the form of addresses. There are two types of addresses:
Physical address-It is the real address where the data is stored in the memory.
Logical address- This is an address given by the CPU.
The OS keeps track of these addresses. The process is loaded in the main memory for fast execution. This allocation can be of two types:
Contiguous allocation- store in continuous location.
Non-contiguous allocation- store in a non-continuous fashion. Paging and segmentation are used to allocate this type of memory.
For a detailed answer on how memory management is done by operating systems, you can refer to this blog.
Device Management
An operating system keeps track of all the devices connected to the system. It also decides how a particular device would be allocated to some process and how long. The vital function of OS is to ensure that all the devices are allocated efficiently and effectively.
File Management
A system contains a huge amount of data. Here, the operating system keeps track of where data is stored, user access settings, and the status of every file, along with managing and deleting files.
Manage the file attributes, i.e., name, location, and size for a given file.
Manage all the operations like opening, renaming, closing, and updating a file.
Computer security is a very crucial aspect of any operating system. The better the security, the more reliable our system will be. It prevents unauthorized access to programs and user data. E.g., Modern operating systems use a firewall for security.
Operating systems provide access control mechanisms to limit who has access to what resources. The OS manages user access to files and folders through ownership and permissions. This makes it harder for unauthorised people to read, alter, or delete important files. Many operating systems come with built-in encryption features that guard data both while it's in transit and at rest.
Job Priority
It determines actions that should be done first in a computer system, so the OS assigns priorities to the given job. One with the highest priority will be executed first.
Managing job priorities is essential for maximising resource allocation, assuring responsive performance, and satisfying the needs of various activities or users. Because activities are frequently time-sensitive, job priority is essential in real-time operating systems. Due to their strict time limits, these systems make sure that tasks with deadlines are given more priority.
Control over System Performance
The OS takes care of the activities of the computer system during multiple processes. This aborts the program having some errors. Thus, the operating system sends instant messages to the user for any unexpected error and helps improve the system's performance.
Handling I/O
The OS is responsible for handling inputs, i.e., from the keyboard, mouse, desktop, etc. It ensures that all kinds of operations on input/output occur most efficiently.
The primary goal of an Operating System is to execute user programs and make tasks easier. Various application programs and hardware systems are used to perform this work. Operating System is software that manages and efficiently controls the entire set of resources.
Handling and Logging of Errors
The OS's error detection and reporting system notifies users or administrators of errors and problems. The auditing and logging of the records system use and event logs for use in troubleshooting and security evaluation. Errors are possible for a number of causes, including software faults, user error, and hardware malfunctions.
To maintain system stability, dependability, and efficient troubleshooting, the operating system is crucial in error detection, management, and logging. The operating system helps maintain system stability, assists in problem diagnosis, and makes sure that users and administrators are promptly informed about the system's health and status by handling and logging failures effectively.
Networking
By supplying protocol layers and controlling network connections, the OS controls network communications. The OS enables users to set up their networks and join various networks. Errors are possible for several causes, including software faults, user error, and hardware malfunctions. The operating system is crucial in error detection, management, and logging to maintain system stability, dependability, and efficient troubleshooting.
The operating system helps maintain system stability, assists in problem diagnosis, and ensures that users and administrators are promptly informed about the system's health and status by effectively handling and logging failures.
Services Provided by an Operating System
Here are the different services provided by the OS.
Program Execution The OS runs all the user and system programs. It manages the whole process of program execution. In the first step, it loads the program in the memory for execution. The order of execution of these processes depends on the scheduling algorithm. While the program is running, the OS handles the thread of deadlock. The OS uses various system resources to ensure a smooth program execution.
Handling Input/Output Operations The OS manages the I/O operations of the computer system. All the input tasks from the keyboard, mouse, and desktop are a few of these operations. OS also gives access to the required I/O devices for the process when needed.
Manipulation of File System The OS decides where to store all the data in the system. It provides a medium for the user to create or delete files or directories. OS grants permission to read and write to a process. The OS also provides the backup of the file system.
Error Detection and Handling The OS manages and handles any error that occurs during a process. It constantly checks for any possible errors that may occur during the process and tries to fix them. It works as a backup for any possible intrusion into the system.
Resource Allocation In a computer system, resources are shared by multiple processes. The OS handles these resources and tries to lower the risk of deadlock. It gives resources to the process in such a way that the resources are utilized properly.
Accounting In a computer system, multiple functions can remain active at a time. The OS keeps track of these functions in the system. It also includes a track of all facts, including some mistakes that may have happened.
Information and Resource Protection In a computer system, protection is a must in order to control access to the process, program, or resources in the machine. The OS provides security to the system from any external attacks and threats. All the operating systems must provide this facility to the computer system.
System Services The OS system gives various services to the user to interact with the system. The OS provides services to handle system performance, resource usage, and system health. It also provides tools for system diagnostics and observing the system's performance.
Frequently Asked Questions
What are the functions of OS?
Functions are the task performed by the OS. The OS provides various functionality to the user. Some of these are process management, memory management, device management, security, etc. It helps the user to interact with the system easily.
What are the 5 main functions of an operating system?
The five main functions of the OS are process management, file management, device management, memory management, and handling I/O. Apart from these, the OS also helps the user to interact with the system.
What is OS and its types and functions?
Operating System is a software program that acts as an interface for computer hardware and software. Some of the types of OS are Windows, Linux, Mac OS, Android, and IOS. It helps in file, memory, and device management of the system.
Conclusion
So, this article discussed the functions of an operating system and some basics, like why we need an operating system. The operating system essentially acts as the foundation for modern computing, smoothly integrating hardware and software elements while supplying a setting that promotes user productivity and effective resource management.