|
| 1 | +--- |
| 2 | +id: function-of-operating-system |
| 3 | +title: function-of-operating-system |
| 4 | +sidebar_label: Function-of-operating-system |
| 5 | +sidebar_position: 7 |
| 6 | +tags: [operating_system, create database, commands] |
| 7 | +description: An Operating System acts as a communication bridge (interface) between the user and computer hardware. |
| 8 | +--- |
| 9 | + |
| 10 | +# Functions of Operating System |
| 11 | + |
| 12 | +An Operating System acts as a communication bridge (interface) between the user and computer hardware. The purpose of an operating system is to provide a platform on which a user can execute programs conveniently and efficiently. |
| 13 | + |
| 14 | +An operating system is a piece of software that manages the allocation of Computer Hardware. The coordination of the hardware must be appropriate to ensure the correct working of the computer system and to prevent user programs from interfering with the proper working of the system. |
| 15 | + |
| 16 | +The main goal of the Operating System is to make the computer environment more convenient to use and the secondary goal is to use the resources most efficiently. |
| 17 | + |
| 18 | +## What is an Operating System? |
| 19 | + |
| 20 | +An operating system is a program that manages a computer’s hardware. It also provides a basis for application programs and acts as an intermediary between the computer user and computer hardware. The main task an operating system carries out is the allocation of resources and services, such as the allocation of memory, devices, processors, and information. The operating system also includes programs to manage these resources, such as a traffic controller, a scheduler, a memory management module, I/O programs, and a file system. The operating system simply provides an environment within which other programs can do useful work. |
| 21 | + |
| 22 | +## Why are Operating Systems Used? |
| 23 | + |
| 24 | +Operating System is used as a communication channel between the computer hardware and the user. It works as an intermediate between system hardware and end-user. Operating System handles the following responsibilities: |
| 25 | + |
| 26 | +- It controls all the computer resources. |
| 27 | + |
| 28 | +- It provides valuable services to user programs. |
| 29 | + |
| 30 | +- It coordinates the execution of user programs. |
| 31 | + |
| 32 | +- It provides resources for user programs. |
| 33 | + |
| 34 | +- It provides an interface (virtual machine) to the user. |
| 35 | + |
| 36 | +- It hides the complexity of software. |
| 37 | + |
| 38 | +- It supports multiple execution modes. |
| 39 | + |
| 40 | +- It monitors the execution of user programs to prevent errors. |
| 41 | + |
| 42 | +## Functions of an Operating System |
| 43 | + |
| 44 | +### Memory Management |
| 45 | + |
| 46 | +The operating system manages the Primary Memory or Main Memory. Main memory is fast storage and it can be accessed directly by the CPU. For a program to be executed, it should be first loaded in the main memory. An operating system manages the allocation and deallocation of memory to various processes and ensures that the other process does not consume the memory allocated to one process. An Operating System performs the following activities for Memory Management: |
| 47 | + |
| 48 | +- It keeps track of primary memory, i.e., which bytes of memory are used by which user program. |
| 49 | + |
| 50 | +- In multiprogramming, the OS decides the order in which processes are granted memory access, and for how long. |
| 51 | + |
| 52 | +- It allocates the memory to a process when the process requests it and deallocates the memory when the process has terminated or is performing an I/O operation. |
| 53 | + |
| 54 | +  |
| 55 | + |
| 56 | +### Processor Management |
| 57 | + |
| 58 | +In a multi-programming environment, the OS decides the order in which processes have access to the processor, and how much processing time each process has. This function of OS is called Process Scheduling. An Operating System performs the following activities for Processor Management: |
| 59 | + |
| 60 | +- Manages the processor’s work by allocating various jobs to it and ensuring that each process receives enough time from the processor to function properly. |
| 61 | + |
| 62 | +- Keeps track of the status of processes. The program which performs this task is known as a traffic controller. |
| 63 | + |
| 64 | +- Allocates the CPU (processor) to a process. |
| 65 | + |
| 66 | +- Deallocates the processor when a process is no longer required. |
| 67 | + |
| 68 | +  |
| 69 | + |
| 70 | +### Device Management |
| 71 | + |
| 72 | +An OS manages device communication via its respective drivers. It performs the following activities for device management: |
| 73 | + |
| 74 | +- Keeps track of all devices connected to the system. Designates a program responsible for every device known as the Input/Output controller. |
| 75 | + |
| 76 | +- Decides which process gets access to a certain device and for how long. |
| 77 | + |
| 78 | +- Allocates devices effectively and efficiently. |
| 79 | + |
| 80 | +- Deallocates devices when they are no longer required. |
| 81 | + |
| 82 | +- Controls the working of input-output devices, receives requests from these devices, performs specific tasks, and communicates back to the requesting process. |
| 83 | + |
| 84 | +### File Management |
| 85 | + |
| 86 | +A file system is organized into directories for efficient or easy navigation and usage. These directories may contain other directories and other files. An Operating System carries out the following file management activities: |
| 87 | + |
| 88 | +- Keeps track of where information is stored, user access settings, the status of every file, and more. These facilities are collectively known as the file system. |
| 89 | + |
| 90 | +- Keeps track of information regarding the creation, deletion, transfer, copy, and storage of files in an organized way. |
| 91 | + |
| 92 | +- Maintains the integrity of the data stored in these files, including the file directory structure, by protecting against unauthorized access. |
| 93 | + |
| 94 | +  |
| 95 | + |
| 96 | +### User Interface or Command Interpreter |
| 97 | + |
| 98 | +The user interacts with the computer system through the operating system. Hence OS acts as an interface between the user and the computer hardware. This user interface is offered through a set of commands or a graphical user interface (GUI). Through this interface, the user interacts with the applications and the machine hardware. |
| 99 | + |
| 100 | +  |
| 101 | + |
| 102 | +### Booting the Computer |
| 103 | + |
| 104 | +The process of starting or restarting the computer is known as booting. If the computer is switched off completely and if turned on then it is called cold booting. Warm booting is a process of using the operating system to restart the computer. |
| 105 | + |
| 106 | +### Security |
| 107 | + |
| 108 | +The operating system uses password protection to protect user data and similar other techniques. It also prevents unauthorized access to programs and user data. The operating system provides various techniques which assure the integrity and confidentiality of user data: |
| 109 | + |
| 110 | +- Protection against unauthorized access through login. |
| 111 | + |
| 112 | +- Protection against intrusion by keeping the firewall active. |
| 113 | + |
| 114 | +- Protecting the system memory against malicious access. |
| 115 | + |
| 116 | +- Displaying messages related to system vulnerabilities. |
| 117 | + |
| 118 | +### Control Over System Performance |
| 119 | + |
| 120 | +Operating systems play a pivotal role in controlling and optimizing system performance. They act as intermediaries between hardware and software, ensuring that computing resources are efficiently utilized. One fundamental aspect is resource allocation, where the OS allocates CPU time, memory, and I/O devices to different processes, striving to provide fair and optimal resource utilization. Process scheduling, a critical function, helps decide which processes or threads should run when, preventing any single task from monopolizing the CPU and enabling effective multitasking. |
| 121 | + |
| 122 | +  |
| 123 | + |
| 124 | +### Job Accounting |
| 125 | + |
| 126 | +The operating system keeps track of time and resources used by various tasks and users. This information can be used to track resource usage for a particular user or group of users. In a multitasking OS where multiple programs run simultaneously, the OS determines which applications should run in which order and how time should be allocated to each application. |
| 127 | + |
| 128 | +### Error-Detecting Aids |
| 129 | + |
| 130 | +The operating system constantly monitors the system to detect errors and avoid malfunctioning computer systems. From time to time, the operating system checks the system for any external threat or malicious software activity. It also checks the hardware for any type of damage. This process displays several alerts to the user so that the appropriate action can be taken against any damage caused to the system. |
| 131 | + |
| 132 | +### Coordination Between Other Software and Users |
| 133 | + |
| 134 | +Operating systems also coordinate and assign interpreters, compilers, assemblers, and other software to the various users of the computer systems. In simpler terms, think of the operating system as the traffic cop of your computer. It directs and manages how different software programs can share your computer’s resources without causing chaos. It ensures that when you want to use a program, it runs smoothly without crashing or causing problems for others. |
| 135 | + |
| 136 | +### Performs Basic Computer Tasks |
| 137 | + |
| 138 | +The management of various peripheral devices such as the mouse, keyboard, and printer is carried out by the operating system. Today most operating systems are plug-and-play. These operating systems automatically recognize and configure the devices with no user interference. |
| 139 | + |
| 140 | +### Network Management |
| 141 | + |
| 142 | +- **Network Communication:** Operating systems help computers talk to each other and the internet. They manage how data is packaged and sent over the network, making sure it arrives safely and in the right order. |
| 143 | + |
| 144 | +- **Settings and Monitoring:** They let you set up your network connections, like Wi-Fi or Ethernet, and keep an eye on how your network is doing. They make sure your computer is using the network efficiently and securely, like adjusting the speed of your internet or protecting your computer from online threats. |
| 145 | + |
| 146 | +## Services Provided by an Operating System |
| 147 | + |
| 148 | +The Operating System provides certain services to the users which can be listed in the following manner: |
| 149 | + |
| 150 | +- **User Interface:** Almost all operating systems have a user interface (UI). This interface can take several forms such as command-line interface (CLI), batch interface, or graphical user interface (GUI). |
| 151 | + |
| 152 | +- **Program Execution:** Responsible for the execution of all types of programs whether it be user programs or system programs. |
| 153 | + |
| 154 | +- **Handling Input/Output Operations:** Responsible for handling all sorts of inputs, i.e., from the keyboard, mouse, desktop, etc. |
| 155 | + |
| 156 | +- **Manipulation of File System:** Responsible for making decisions regarding the storage of all types of data or files. |
| 157 | + |
| 158 | +- **Resource Allocation:** Ensures the proper use of all the resources available by deciding which resource to be used by whom for how much time. |
| 159 | + |
| 160 | +- **Accounting:** Tracks an account of all the functionalities taking place in the computer system at a time. |
| 161 | + |
| 162 | +- **Information and Resource Protection:** Uses all the information and resources available on the machine in the most protected way. |
| 163 | + |
| 164 | +- **Communication:** Implements communication between one process to another process to exchange information. |
| 165 | + |
| 166 | +- **System Services:** Provides various system services, such as printing, time and date management, and event logging. |
| 167 | + |
| 168 | +- **Error Detection:** Needs to detect and correct errors constantly to ensure correct and consistent computing. |
| 169 | + |
| 170 | +## Characteristics of Operating System |
| 171 | + |
| 172 | +- **Virtualization:** Provides virtualization capabilities, allowing multiple operating systems or instances of an operating system to run on a single physical machine. |
| 173 | + |
| 174 | +- **Networking:** Provides networking capabilities, allowing the computer system to connect to other systems and devices over a network. |
| 175 | + |
| 176 | +- **Scheduling:** Provides scheduling algorithms that determine the order in which tasks are executed on the system. |
| 177 | + |
| 178 | +- **Interprocess Communication:** Provides mechanisms for applications to communicate with each other, allowing them to share data and coordinate their activities. |
| 179 | + |
| 180 | +- **Performance Monitoring:** Provides tools for monitoring system performance, including CPU usage, memory usage, disk usage, and network activity. |
| 181 | + |
| 182 | +- **Backup and Recovery:** Provides backup and recovery mechanisms to protect data in the event of system failure or data loss. |
| 183 | + |
| 184 | +- **Debugging:** Provides |
0 commit comments