Notes, Exercises, Videos, Tests and Things to Remember on Introduction, role and function of operating system
Please scroll down to get to the study materials.
An operating system is an integrated set of programs that controls the resources (the CPU, memory, I/O devices etc.) of the computer system. It provides an interface to its users, which is more convenient to use than the bare machine. Making a computer system more convenient to use and managing the resources of the computer system are the two primary objectives of an operating system. An operating system is a collection of programs that controls the overall operation of the computer system. Operating system controls and coordinates the use of the hardware among the various application programs for the various users. So it acts as an interface between the user and the computer hardware.
An operating system manages and coordinates the function performed by the computer hardware, including the CPU, input/output devices, secondary storage device, and communication and network equipment. The operating system is the most important program that runs on a computer. For every purpose, a computer must have an operating system to run other programs. It performs basic tasks, such as recognizing input from the keyboard, sending output to display units, keeping track of files and directories on the disks, and controlling peripheral devices such as disk drives and printers. The operating system also hides the complexities of the hardware from a user.
The operating system is also defined as a program suite of programs that control the input and output devices. The primary goal of an operating system is to maximize the productivity of a computer system by operating it in the most efficient manner and minimizing the amount of a human intervention required. MS-DOS, MS Windows 3.1, UNIX, LINUX, MS Windows 2000, etc. are the examples of an operating system.
Input/output (IO) is an essential element for the operation of any computer. It allows the computer to interact with peripheral devices such as a keyboard, mouse, terminals (like modem, TV card, and NIC card), disks or tapes (CD, DVD, and Floppy disk), printer etc.
Fig: IO Management
The command interpreter reads the commands that a user types at a terminal, interprets them, and translate them into a detailed set of instructions that the computer hardware can understand. It varies from one OS to another. Every OS must provide command interpreter of its operation.
Fig: Command Interpreter
Data management allows organizing their data into logical groupings called files. Earlier, only a few of OS provide data management, containing limited flexibility and usefulness. At present, most of the OS provides this feature.
Fig: Data management
Memory management is the function responsible for managing the computer's primary memory. Memory is a large array of words or bytes, each with its own address. When the user requests to the CPU for read/write operation, OS determines the amount of memory required for the program instructions and data. Then, OS allocates required memory to load the program and data into RAM. When a program terminates, its memory space is free and the same memory area can be allocated to another program.
Fig: Memory Management
Process management is the process by which operating systems manage processes, threads, enable processes to share information, protect process resources and allocate system resources to processes that request them in a safe manner. It finds the status of processors and processes (Traffic controller), chooses a job (job scheduler), chooses process in the job (process scheduler), allocates the processors to the process (dispatcher), and free the processor when the process is executed.
Fig: Process Mnagement
The device management allocates a device to a process. It finds the status of device, channels and control units, finds answer to questions like which process, which device how much and allocates the device to the process (IO Scheduling), initiates the IO operation and finally free the device when the process is completed.
The file management keeps track of all information on files. It is an opens and closes files. It finds and records the following for all files: location, size, usage (attributes) status etc. It also finds as to which process wants which files, checks through the protection routine, opens the file if allowed, and allocates it to the process. Finally, it closes the file when the process is executed. Processor management is at a low level which is very near to the machine whereas file management is at a higher level which is very near to the user.
Time sharing management is a function of OS which involves the CPU to allocate the time to a number of users on the same computer. it is generally found in network operating system. As the number of users increases the response time for each terminal declines. Time sharing creates the illusion to the each user so that they are the sole user of the system because the speed of the CPU compared to that of the monitor and terminal, which is so much faster. thereby giving each time slice for each user to operate the program interactively. Time sharing manages the time of CPU. Time sharing checks for CPU requests from higher-priority processes that are made every 10 milliseconds.
Figure: Time sharing
The security feature protects one user from another and the OS as a whole from all users. Its main function is to make sure that only authorized users to get access from the computer, and the users only do things they are authorized to do. Larger OS provides some kind of security but the degree varies from one OS to another.
During the processing, a situation can arise in which a resource (hardware or software) shared by two or more processes cannot continue because the resource required by a process is held by another. This situation is known as deadlock. For example: if process 1 is allocated to resource A and later it requests resources B, and process 2 is allocated to resource B and later it requests to resource A. in this situation, neither process 1 nor process 2 will be executed. Such a situation is known as deadlock.
OS ensures that the above condition does not hold, and thus prevents it from deadlock. It takes suitable action by the careful allocation of resources so that deadlock can be avoided. If deadlock cannot be avoided. OS detects it and tries to recover from it.
Fig: Deadlock prevention
An interrupt is a signal from a device attached to a computer or from a program within the computer that causes the main program that operates the computer (the operating system) to stop and figure out what to do next. Almost all personal (or larger) computers today are interrupt-driven- that is, they start down the list of computer instructions in one program (perhaps an application such as a word processor) and keep running the instructions until either (A) they can't go any further or (B) an interrupt signal is sensed. After the interrupt signal is sensed, the computer either resumes running the program it was running or begins running another program.
In a multiprogramming system, there can be many programs located in the memory along with the operating system. If the program is larger than main memory of the computer, operating system uses free space of secondary memory which is termed as virtual memory. It is not necessary to have the entire program in primary storage at one time, only the part on which the computer is working is needed. The area of secondary storage used for storing pages is called virtual storage.
(Shrestha & Manandhar, 2014)
Shrestha, R. P., & Manandhar, s. (2014). Computer Essential. Kathmandu: Ashmita publication.
Khanal, R., & Rokka, P. (2013). Computer Essentials I. Putalisadak, Kathmandu: Asmita's Publication.
Functions of operating system: