Need & Functions of OS



Operating System
An operating system (OS) is system software that manages computer hardware and software resources and provides common services for computer programs. It is an interface between hardware and user which is responsible for the management and coordination of activities and the sharing of the resources of a computer. It hosts the several applications that run on a computer and handles the operations of computer hardware.


Need for an Operating System
In earlier day’s user had to design the application according to the internal structure of the hardware. Operating System was needed to enable the user to design the application without concerning the details of the computer’s internal structure. In general the boundary between the hardware & software is transparent to the user.

Usage of Operating System:-

1.       Easy interaction between the human & computer.
2.       Starting computer operation automatically when power in turned on.
3.       Loading & scheduling users program.
4.       Controlling input & output.
5.       Controlling program execution.
6.       Managing use of main memory.
7.       Providing security to users program


Functions of an Operating System
An operating system has variety of functions to perform. Some of the prominent functions of an operating system can be broadly outlined as:
  1. Processor Management
  2. Memory Management
  3. File Management
  4. Device Management
   1. Processor Management: - The process management module of an Operating System takes care of the creation & deletion of processes, scheduling of various system resources to the different process requesting them & providing mechanism for synchronization & communication among processes.

·     Priority Scheduling: Each task is given CPU time according to the priority assigned to that task. The program with higher priority will be given CPU time before a program with lower priority. The CPU executes the task till it is completed or there is some interrupt request i.e. till the time operating system has to stop (interrupt) the current task due to an unavoidable job request. The major drawback of Priority scheduling is that even a small job has to wait for a long time when a long duration job with higher priority is being executed.
·   Round Robin Scheduling: This type of scheduling technique is also known as Time Sharing Scheduling. In this, each program or task is given a fixed amount of time to execute. The CPU continues with the execution till either the allotted time is over or there is some interrupt request or the task is completed before the allotted time. If the task is not completed at the end of the allotted time, it is put at the end of the queue. So each task gets its allotted share of CPU time. This scheduling technique improves the response time and provides an interactive environment. Hence time sharing operating system is very useful in network environment as each user is allowed to share the network resources.

    2. Device Management: - Coordination & control of various input & output devices is an important function of the Operating System. The Operating System communicates with hardware and the attached devices and maintains a balance between them and the CPU. This is all the more important because the CPU processing speed is much higher than that of I/O devices. In order to optimize the CPU time, the operating system employs two techniques - Buffering and Spooling.

·    Buffering: In this technique the temporary storage of input and output data is done in Input Buffer and Output Buffer. Once the signal for input or output is sent to or from the CPU respectively, the operating system through the device controller moves the data from the input device to the input buffer and for the output device to the output buffer. When the signal is sent to/from the operating system to the respective device controllers, the program doesn’t wait rather it returns to its processing. In case of input, if the buffer is full, the operating system sends a signal to the program which processes the data stored in the buffer. When the buffer becomes empty, the program informs the operating system which reloads the buffer and the input operation continues. Similarly for output when the program being executed has to display some output, it fills the buffer and then informs the operating system. Thereafter the operating system empties the buffer by sending data to the output device and in the meantime the program fills another buffer. This technique is called overlapped processing. This is because while the operating system reloads one buffer, the executing program doesn’t stop as it is able to retrieve/fill data from/in another buffer.
    
   Spooling (Simultaneous Peripheral Operation on Line): This is a device management technique used for processing of different tasks on the same input/output device. Say for example there are various users on a network sharing the same printer. At one point of time more than one user might give print command. The speed of the printer is very slow as compared to the CPU processing. So the operating system temporarily stores the data of every user on the hard disk of the computer to which the printer is attached. The individual users need not wait for the printing process to be complete. Instead the operating system sends the data from hard disk to the printer one by one.
  
  3. Memory Management: - The memory management module of an Operating System takes care of the allocation & reallocation of memory space to the various program in need of this resource. The common memory management techniques used by the operating system are Partitioning and Virtual Memory.
§ Partitioning: The total memory is divided into various partitions of same size or different sizes. This helps to accommodate number of programs in the memory. The partition can be fixed i.e. remains same for all the programs in the memory or variable i.e. memory is allocated when a program is loaded on to the memory. The later approach causes less wastage of memory but in due course of time, it may become fragmented.
§ Virtual Memory: This is a technique used by the operating system by virtue of which the user can load the programs which are larger than the main memory of the computer. In this technique the program is executed even if the complete program is not loaded on to the main memory. The operating system divides the main memory into equal sizes called pages. A part of the program resides in the main memory and is called the active set. The rest is in the secondary storage device in the form of tracks/sectors or blocks. With the help of Page Map Tables (PMT), the operating system keeps track which page of main memory is storing which block of secondary memory.
    A virtual address (which is not the real physical address) is mapped either to the main memory or the secondary memory. Hence virtual memory allows more programs and even larger programs to be executed in the main memory leading to efficient memory utilization.

    4. File Management: - Computer uses a lot of data & programs, which are, stored on secondary storage devices. File management functions of an Operating System involves keeping track of all different files & maintaining the integrity of data stored in the files including file directory structure. Any data on a computer is stored in the form of files and the operating system keeps information about all of them using File Allocation Table (FAT). The FAT stores general information about files like filename, type (text or binary), size, starting address and access mode (sequential/indexed sequential/direct/relative). 





Comments

Post a Comment

Popular posts from this blog

ASCII / ISCII / UNICODE

CISC / RISC / EPIC

Evolution of Computers