Functions of Operating System

Learn via video courses
Topics Covered

What is an Operating System?

When you go to a doctor for a checkup, he examines you and speaks in medical jargon or uses terms that you cannot understand. Wouldn't you feel confused and disheartened? You ask him to rephrase to clear your doubts. Now, he simplifies your illness and prescribes you medicines. The doctor will make sure that these medicines are well suited for your illness and body requirements. In case you ask your doctor about someone else's illness, they might refuse as per protocols.

What is an Operating System

We can compare the above scenario to an Operating System.

An operating system is system software that acts as a mediator between the user and the device's underlying hardware. The device can be a computer, phone, or any appliance. It helps you carry out various tasks like translation, computation, etc., along with being a mediator between you and the computer. This is similar to how your doctor acted as the mediator between you and your illness, helping you to recover sooner. An Operating System is designed in a way that it can manage all hardware and software resources and operations of a computer. Common examples of the operating system are Linux and Windows.

Every computer must necessarily have an operating system to function and be able to use processes like Word, Excel, and even the Web. The OS is your communicator with the computer. It helps you send messages to it and get back the desired results. All computations are a product of the Operating System.

Use of an Operating System

An operating system serves as a crucial communication channel between computer hardware and users by acting as an intermediary. It assumes several vital responsibilities to ensure efficient system functioning:

  • Resource Control: The OS manages computer resources efficiently.

  • Service Provision: The OS offers valuable services to user programs.

  • Program Coordination: The OS coordinates the execution of user programs.

  • Resource Provision: The OS provides access to system resources.

  • User Interface: The OS enables user interactions through an interface.

  • Software Complexity Abstraction: The OS simplifies system complexities for users.

  • Multiple Execution Modes: The OS supports different execution modes.

  • Program Monitoring: The OS monitors program execution for errors.

What are the Functions of the Operating System?

what are the functions of operating system

1. Memory Management

Considering the doctor's example given above: Your doctor checked you and analyzed the symptoms you showed. He stored all the information he gathered in a note and further prescribed you medicines based on that. Similarly, an operating system also stores data and programs in memory so that they can be used for further processing. As shown in the below figure, whenever any application requires memory, the Operating system allocates it based on the requirement.

Memory Management

2. Process Management

Operating System is the major decision-maker while selecting the order in which processes access the processor and also determines the amount of processing time allocated to each. It also tracks the status of these processes to understand if they succeed or fail. The diagram below depicts the life cycle of a process. When a new process enters the queue, it stays there until it is ready to be dispatched. Once it is dispatched, it is in the running phase. The process can be preempted (interrupted) by another process in the queue on the instruction of the Operating system. This can happen if the other process has a higher priority than the existing one. In case the existing process requires something like Input from the user, it can be blocked temporarily until the event has occurred. Once the process is completed, it will be terminated.

Process Management

3. File Management

Data is stored on files. An operating system helps us create, edit, update and delete files. It also helps in transferring files from one device to another. Files are visible as entities that are physically stored on the hardware.

File Management

4. Device Management

An operating system is not only useful in communicating with the computer. It also helps the computer communicate with peripheral devices via their respective drivers. If you want to print 5 copies of this article, then the operating system will help you fulfill the job. And again, it will be the Operating System that decides whether you get to access the printer or not and for how long. It is also in charge of deallocating devices when not in use.

5. I/O Management

Any kind of Input that you want to give to the computer goes through the operating system. Any output that we get is also acted upon by the Operating System. In the below example, the user instructs the system to play abc.mp3 on his computer using a music application. Here, the OS will first read the audio file from his hard disk (which is the storage device from where the Input is retrieved) and then send the player output to the speakers (output device) where it will be played.

I/O Management

6. Secondary Storage Management

Systems have primary storage, which is easily accessible, and secondary storage, which can be connected and accessed using peripheral hardware devices. The following figure shows commonly used secondary storage devices.

Secondary Storage Management

7. Security

In today's world, ensuring that your data is secure is a must, and an operating system helps you achieve this purpose. This feature of an Operating System makes it more reliable. An Operating System makes use of firewalls that protects the system from incoming threats and blocks them. Only users who have been permitted to use the system can gain access to prove their identities.

8. Command Interpretation

You, as a user, input your commands in a language that is understood by you. Since the computer only understands 0s and 1s (binary language), the operating system manages the interpretation of the commands and then guides the resources to process them.

Command Interpretation

9. Networking

Operating systems play a major role in networking. A common example is that of distributed systems in which a server OS can ensure that there is uniformity between the distributed PCs. In such a system, a large number of independent and physically separated computers can connect through a single communication channel, and this is supported by the operating system. The following image shows how a distributed OS is arranged.

Networking

10. Communication

The Operating System acts as a mediator between the system hardware and the user. It coordinates and assigns tasks to different software, including interpreters, compilers, etc., as required by the user. Processes A and B can communicate with each other as given below. The sending process A sends across a message via the message passing module, which goes as a packet that contains Process ID and Message and is received by the Receiving Process on Process B's end.

Communication

11. Job Accounting

An operating system keeps track of resources and time used by various jobs and users.

12. Job Scheduling

Just like humans, operating systems can have various tasks to fulfill that are called jobs. The priority of these jobs depends on various criteria, including a user-defined value, order of arrival, etc. It is easy to schedule a single task, but when multiple tasks are taken into consideration, sophisticated scheduling mechanisms need to be used. An operating system determines the order in which tasks are allocated resources and further completed.

Job Scheduling

13. Monitoring Health and Error Detection

The operating system needs to keep an eye on the different activities that simultaneously occur, errors incurred, and interrupts, if any. It may choose to send instant notifications to users regarding errors or abort the programs in consideration. Monitoring the system helps us in understanding its health by checking which programs or processes impact CPU and memory utilization and cut down its usage. This also gives us the information that is required to troubleshoot system-related issues. Following is a screenshot of Task Manager that gives details on the CPU and Memory Utilization of various processes on Windows OS.

Monitoring Health and Error Detection

Services Provided by Operating System

Operating systems provide a variety of essential services to ensure efficient and secure system operation. They manage processes, allocate and manage memory, handle file system organization, control hardware devices, enable networking capabilities, implement security measures, detect and handle errors, offer user interfaces for interaction, and support virtualization. These services collectively form the foundation for users to effectively utilize and interact with their computer systems while maintaining system stability and security.

Characteristics of Operating System

Operating systems possess several key characteristics that define their functionality and role within a computer system. Here are some important characteristics of operating systems:

  1. Concurrency: Operating systems are designed to handle multiple tasks and processes simultaneously, allowing for multitasking and efficient resource sharing.

  2. Resource Management: They manage computer resources such as CPU, memory, storage, and peripheral devices, allocating and scheduling them effectively to ensure optimal utilization.

  3. Abstraction: Operating systems provide a simplified and standardized interface between users and hardware, hiding the complexities of hardware and software interactions, and making it easier for users and applications to interact with the system.

  4. Virtualization: Some operating systems support virtualization, enabling the creation of multiple virtual machines or environments on a single physical machine, providing isolation and resource allocation for different tasks or applications.

  5. Protection and Security: Operating systems implement security measures to protect the system from unauthorized access, viruses, malware, and other threats. They enforce access control, and data encryption, and provide mechanisms for secure communication.

FAQs

Q. What are the 5 functions of the operating system of a computer?

A. The operating system performs process management by handling the creation, termination, scheduling, and synchronization of processes. It allocates and manages system memory to ensure efficient utilization. The operating system also manages files, allowing for functions like creation, deletion, access, and modification. It controls and manages hardware devices, providing device drivers and handling device communication. Additionally, operating systems provide user interfaces, such as command-line or graphical interfaces, for users to interact with the system.

Q. What is a Process in an Operating System?

A. A process in an operating system is an instance of a program that is currently being executed. It has its own memory, resources, and execution state. The operating system manages and schedules processes to enable multitasking and efficient resource utilization.

Q. What are the Advantages of OS?

A. Operating systems offer significant advantages for computer systems. They efficiently manage system resources, ensuring optimal utilization and fair distribution. Operating systems simplify the user experience by abstracting hardware complexities and providing a standardized interface, enhancing usability and productivity. Additionally, they incorporate robust security measures to protect system resources and data from unauthorized access or attacks. These advantages contribute to the smooth and secure operation of computer systems.

Conclusion

  • An Operating System is an interface that helps a user connect and communicate with computer hardware.
  • It is an essential part of computing devices like mobiles, laptops, cameras, and other appliances. Even some washing machines and refrigerators have them.
  • The operating system manages files, processes, storage, and external devices and also monitors the device for errors.
  • It also helps in maintaining security and protects the OS from destruction.
  • It also works to ensure that different jobs and processes get allocated resources according to their requirements for a fixed amount of time based on their respective priorities.