Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
An Operating System (OS) is a crucial software that acts as an intermediary between hardware and software, allowing users to effectively manage and utilize computer resources. It provides an essential platform to run programs and ensures smooth execution through functions like process management, memory management, and file management. The purpose of operating systems extends to resource allocation, security, and handling multiple tasks at once. In this article, we will explore the functions of an operating system, its role, goals, and how it simplifies computing for users by providing a stable environment to execute programs efficiently.
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 explore some common types of Operating Systems (OS) and their functions:
1. Batch Operating System
A Batch Operating System does not interact with the system directly. Instead, a set of similar jobs is stored in the main memory, and the next job gets assigned to the CPU only when the previous one is complete. The system processes jobs in batches without user interaction.
Example: Early IBM Mainframes used a batch processing system where jobs were grouped and executed in sequence without immediate user input.
2. Multiprogramming Operating System
In a Multiprogramming Operating System, the main memory consists of multiple jobs waiting for CPU access. The OS selects one process and assigns it to the CPU. If the process in execution is interrupted by an external or internal factor, the system performs context switching and executes another process from the queue. This ensures maximum CPU utilization, allowing users to multitask and execute multiple jobs at once.
Example: Unix is a multiprogramming operating system where several programs can run concurrently by switching between them.
3. Multitasking Operating System
A Multitasking Operating System enables the user to perform multiple tasks as a single user at a given time on one computer system. The OS switches between tasks so quickly that the user perceives all processes as running simultaneously. This is vital for creating the illusion of parallel processing.
Example: Windows 10 supports multitasking, allowing users to run multiple applications, such as browsers, word processors, and media players, simultaneously.
4. Time-Sharing Operating System
In a Time-Sharing Operating System, processors simultaneously share time among multiple users. This time is referred to as a quantum. Once a task is completed or its time slice expires, the OS switches to the next task. The main goal of this type of OS is to reduce response time and ensure that users experience a near-instantaneous response from the system.
Example: Multics (Multiplexed Information and Computing Service) was one of the earliest time-sharing systems that allowed users to share access to a mainframe in real time.
5. Real-Time Operating System
A Real-Time Operating System is designed for systems that need to accomplish specific tasks within a defined time frame, known as response time. It is used in systems where delays cannot be tolerated, such as embedded systems or those that control physical hardware.
Example: VxWorks is a popular real-time operating system used in embedded systems for critical applications like spacecraft control, robotics, and automotive systems.
Operating Systems (OS) serve a crucial role in managing both software and hardware resources, creating a seamless experience for users. They act as an intermediary between the user and the hardware, allowing for effective management and execution of tasks. Let's dive deeper into why Operating Systems are used and how they provide essential services.
1. Purpose of Operating Systems
The primary purpose of an operating system is to manage the computer's hardware resources, providing a stable environment for software applications to run. Without an OS, users would struggle to interact with the hardware and perform basic tasks. It essentially creates a platform where users can execute programs easily and efficiently, handling everything from memory management to process scheduling.
2. Managing Multiple Tasks (Multitasking)
One of the key functions of operating systems is multitasking, allowing users to run multiple applications simultaneously. The OS manages CPU resources, switches between tasks, and ensures that each application gets enough resources to operate efficiently. This operating system operation enhances productivity and gives users the impression that multiple tasks are happening at the same time, even though the system might be switching between them rapidly.
For example, on Windows OS, you can have a browser running, while simultaneously listening to music and working in a word processor, all without manually managing the transitions between tasks.
3. Interface Between User and Hardware
An OS provides an interface that allows users to interact with the hardware, whether through a graphical user interface (GUI) or a command-line interface (CLI). The OS handles input/output (I/O) operations, so users can communicate with the system through devices like a keyboard, mouse, or touchscreen. This interaction between the user and the system simplifies hardware management, allowing users to access complex system functions with ease.
Example: In macOS, the user interacts with the hardware through the Finder application, which provides a window into file management, where users can organize, open, or move files.
4. Resource Allocation and Management
Operating Systems are responsible for allocating and managing resources efficiently. This includes memory management, where the OS assigns and tracks memory usage across different processes, and device management, where the OS ensures that connected devices are used effectively. It also handles security and permissions, ensuring that the right users have access to specific resources while preventing unauthorized access.
5. Security and Protection
An OS's role in security cannot be overstated. It manages user accounts, encrypts sensitive data, and monitors the system for potential threats. Modern operating systems provide firewall protection, antivirus software, and other features that safeguard user data and prevent unauthorized access. OS security mechanisms also ensure that users can safely execute programs without risking system integrity.
For example, Linux OS is often preferred in server environments because of its advanced security features, which provide robust protection against malware and unauthorized access.
6. System Stability and Error Handling
Operating systems also play a vital role in maintaining system stability. They handle system errors, such as crashes or bugs, by managing processes and ensuring that one malfunctioning application doesn't affect others. When an error occurs, the OS may notify the user, log the issue for further analysis, and attempt to recover the system to a stable state.
In Windows, when a program crashes, the OS displays an error message and gives users the option to terminate the faulty application without affecting other running processes.
7. Managing File Systems
The file management function of the OS ensures that all data is stored, organized, and easily accessible. It manages file systems and provides methods to store, retrieve, delete, and modify files. The OS handles directory structures, file permissions, and other essential aspects of file organization to ensure that data is safely and efficiently managed.
For example, in Unix and Linux, files are organized hierarchically, allowing users to easily navigate and manipulate file structures through the command line or file managers.
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.
Characteristics of Operating System
An Operating System (OS) is essential for managing hardware and software resources efficiently. It provides various functionalities that ensure smooth system operation. Below are seven key characteristics of an OS:
1. Virtualization
Virtualization allows multiple virtual machines (VMs) to run on a single physical machine. It abstracts hardware resources, enabling efficient resource sharing. Example: Cloud computing platforms like VMware and VirtualBox use OS virtualization to run multiple operating systems on the same server.
2. Networking
An OS manages network communication by handling protocols, IP addressing, and data transfer between devices. It ensures secure and efficient connectivity. Example:Windows and Linux enable file sharing, internet access, and remote connections using TCP/IP protocols.
3. Scheduling
CPU scheduling ensures fair allocation of processing power among multiple tasks, optimizing system performance. Different scheduling algorithms manage this efficiently. Example:Round Robin scheduling is used in Linux to allocate CPU time slices among processes.
4. Interprocess Communication (IPC)
IPC allows processes to communicate and share data through mechanisms like pipes, message queues, and shared memory. It is crucial for multitasking. Example:Web browsers use IPC to allow plugins and extensions to interact with the main application.
5. Performance Monitoring
The OS monitors CPU usage, memory consumption, and system performance to ensure smooth operation and resource optimization. Example:Task Manager (Windows) and htop (Linux) help users track system performance.
6. Backup and Recovery
An OS provides tools to backup data and recover it in case of failure, ensuring data protection and disaster recovery. Example:Windows System Restore and Linux Timeshift help users recover from system crashes.
7. Debugging
Debugging tools in the OS help detect and fix software and hardware issues, ensuring system stability and efficiency. Example:GDB (GNU Debugger) in Linux helps developers debug applications.
These characteristics make an OS vital for efficient system operation and resource management.
Frequently Asked Questions - Functions of Operating System(OS)
1. 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.
2. 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.
3. 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.