An operating system is a program on which application programs are executed and acts as a communication bridge (interface) between the user and the 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.
Important functions of an operating System:
Security:
The operating system uses password protection to protect user data and similar other techniques. it also prevents unauthorized access to programs and user data.
Control over system performance:
Monitors overall system health to help improve performance. records the response time between service requests and system response to having a complete view of the system’s health. This can help improve performance by providing important information needed to troubleshoot problems.
Job accounting:
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.
Error-detecting aids:
The operating system constantly monitors the system to detect errors and avoid malfunctioning a computer systems.
Coordination between other software and users:
Operating systems also coordinate and assign interpreters, compilers, assemblers, and other software to the various users of the computer systems.
Memory Management:
The operating system manages the Primary Memory or Main Memory. Main memory is made up of a large array of bytes or words where each byte or word is assigned a certain address. 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 performs the following activities for memory management: It keeps track of primary memory, i.e., which bytes of memory are used by which user program. The memory addresses that have already been allocated and the memory addresses of the memory that has not yet been used. In multiprogramming, the OS decides the order in which processes are granted access to memory, and for how long. 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.
The operating system:
- Allocates and deallocates the memory.
- Keeps a record of which part of primary memory is used by whom and how much.
- Distributes the memory while multiprocessing.
- In multiprogramming, the operating system selects which processes acquire memory when and how much memory they get.
Processor Management:
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. Keeps track of the status of processes. The program which performs this task is known as a traffic controller. Allocates the CPU that is a processor to a process. De-allocates processor when a process is no more required.
The OS:
- Allocates and deallocates processor to the processes.
- Keeps record of CPU status.
- Certain algorithms used for CPU scheduling are as follows:
- First Come First served (FCFS)
- Shortest Job First (SJF)
- Round-Robin Scheduling
- Priority-based scheduling etc.
The purpose of CPU scheduling is as follows:
- Proper utilization of CPU. Since the proper utilization of the CPU is necessary. Therefore, the OS makes sure that the CPU should be as busy as possible.
- Since every device should get a chance to use the processor. Hence, the OS makes sure that the devices get fair processor time.
- Increasing the efficiency of the system.
Device Management:
An OS manages device communication via its respective drivers. It performs the following activities for device management. Keeps track of all devices connected to the system. designates a program responsible for every device known as the Input/Output controller. Decides which process gets access to a certain device and for how long. Allocates devices in an effective and efficient way. Deallocates devices when they are no longer required.
The OS:
- Allocates and deallocates devices to different processes.
- Keeps records of the devices.
- Decides which process can use which device for how much time.
File Management:
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. It keeps track of where information is stored, user access settings and the status of every file, and more… These facilities are collectively known as the file system.
The OS:
- Keeps records of the status and locations of files.
- Allocates and deallocates resources.
- Decides who gets the resources.
Storage Management
Storage management is a procedure that allows users to maximize the utilization of storage devices while also protecting data integrity on whatever media on which it lives. Network virtualization, replication, mirroring, security, compression, deduplication, traffic analysis, process automation, storage provisioning, and memory management are some of the features that may be included. The operating system is in charge of storing and accessing files. The creation of files, the creation of directories, the reading and writing of data from files and directories, as well as the copying of the contents of files and directories from one location to another are all included in storage management.
Moreover, Operating System also provides certain services to the computer system in one form or the other.
The Operating System provides certain services to the users which can be listed in the following manner:
- Program Execution: The Operating System is responsible for the execution of all types of programs whether it be user programs or system programs. The Operating System utilizes various resources available for the efficient running of all types of functionalities.
- Handling Input/Output Operations: The Operating System is responsible for handling all sorts of inputs, i.e, from the keyboard, mouse, desktop, etc. The Operating System does all interfacing in the most appropriate manner regarding all kinds of Inputs and Outputs.
For example, there is a difference in the nature of all types of peripheral devices such as mice or keyboards, the Operating System is responsible for handling data between them. - Manipulation of File System: The Operating System is responsible for making decisions regarding the storage of all types of data or files, i.e, floppy disk/hard disk/pen drive, etc. The Operating System decides how the data should be manipulated and stored.
- Error Detection and Handling: The Operating System is responsible for the detection of any type of error or bugs that can occur while any task. The well-secured OS sometimes also acts as a countermeasure for preventing any sort of breach to the Computer System from any external source and probably handling them.
- Resource Allocation: The Operating System ensures the proper use of all the resources available by deciding which resource to be used by whom for how much time. All the decisions are taken by the Operating System.
- Accounting: The Operating System tracks an account of all the functionalities taking place in the computer system at a time. All the details such as the types of errors that occurred are recorded by the Operating System.
- Information and Resource Protection: The Operating System is responsible for using all the information and resources available on the machine in the most protected way. The Operating System must foil an attempt from any external resource to hamper any sort of data or information.
All these services are ensured by the Operating System for the convenience of the users to make the programming task easier. All different kinds of Operating systems more or less provide the same services.