OPERATING SYSTEM Introduction: An operating system (commonly abbreviated to either OS or O/S) is an interface between hardware and user. OS is responsible for the management and coordination of activities and the sharing of the resources of the computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, controlling peripheral devices such as disk drives and printers. Logical Architecture of Computer System The hardware resources are surrounded by operating system layer. OS is surrounded by a layer of other system software (such as compiler, editors, utilities etc) and a set of application programs (such as commercial data processing applications, scientific and engineering applications, entertainment and educational applications, etc). Finally the end users view the computer system in terms of the user interfaces provided by the application programs. Definition: An Operating System is an integrated set of programs that controls the resources (the CPU, memory, I/O devices, etc) of a computer system and provides its users with an interface that is more convenient to use than the bare machine. Objectives of Operating System: Making a computer system convenient to use: That is operating system hides the details of the hardware resources from the programmer and provides the programmer with a convenient interface for using the computer system. Managing the resources of a computer system: This involves performing such tasks as keeping track of who is using which resource, granting resource requests, accounting for resource usage, and mediating conflicting requests from different programs and users. Functions of Operating System: 1. Process Management: The process management module of an operating system takes care of the creation and deletion of processes, scheduling of various system resources to the different processes requesting them, and providing mechanisms for synchronization and communication among processes. 2. Memory Management: The memory management module of an operating system takes care of the allocation and de-allocation of memory space to the various programs in need of this resource. 3. File Management: The file management module of an operating system takes care of file related activities such as organization, storing, retrieval, naming, sharing and protection of files.
4. Security: The security module of an operating system protects the resources and information of a computer system against destruction and unauthorized access. 5. Command Interpretation: The command interpretation module of an operating system takes care of interpreting user commands, and directing the system resources to handle the requests. With this mode of interaction with the system, the user is usually not too concerned with the hardware details of the system. Measuring System Performance: The efficiency of an operating system and the overall performance of a computer system are usually measured in terms of the following: Throughput: In computer technology, throughput is the amount of work that a computer can do in a given time period. Turnaround Time: Turnaround time is the interval from the time of submission of a job to the system for processing to the time of completion of the job. Response Time: The elapsed time between the end of an inquiry or demand on a computer system and the beginning of a response. Types of Operating System Programs: 1. Booting Loader: The main function of the bootstrap loader program, which is usually contained in ROM, is to read the main portion of the operating system from secondary memory when the computer is first turned on. 2. Diagnostic Tests: The OS contains a number of diagnostic programs that test the operation of the system components. Eg. One diagnostic program might check the operation of the disk drives, while another might check the operation of RAM. Some of these programs are contained within ROM and are run automatically when the system is first turned on. 3. Operating System Executive: The OS Executive also called monitor is a program that controls the activities of the system including the executing programs and assigning tasks to H/W devices. 4. BIOS: The Basic Input Output System programs consist of the low level routines used to control the most rudimentary functions of the hardware devices. Some functions BIOS programs control are: Reading a character from the keyboard. Writing a character on video display. Writing a character to the printer. Determining whether printer is ready or not. The BIOS programs are usually recorded in ROM. 5. Utility Programs: Every computer system needs utility programs to perform housekeeping functions. Some of the functions controlled by utility programs are: a. Formatting a disk. b. Displaying the contents of disk. c. Copying the contents of one disk onto another. d. Determining the space remaining on a disk. e. Making a backup copy of the contents of a hard disk.
f. Restoring the contents of a hard disk from a backup copy. File Maintenance: The OS provides service routines that can be used to maintain files on the various secondary memory devices attached to the system. These file maintenance programs allow user programs to create, read and write files. Types of Operating Systems: 1. Batch Processing System: Batch processing is execution of a series of programs ("jobs") on a computer without human interaction. Batch jobs are set up so they can be run to completion without human interaction. This is in contrast to "online" or interactive programs which prompt the user for some input. A program takes a set of data files as input, process the data, and produces a set of output data files. Batch jobs can be stored up during working hours and then executed during the evening or whenever the computer is idle. Batch processing is particularly useful for operations that require the computer or a peripheral device for an extended period of time. Once a batch job begins, it continues until it is done or until an error occurs. Note that batch processing implies that there is no interaction with the user while the program is being executed. An example of batch processing is the way that credit card companies process billing. The customer does not receive a bill for each separate credit card purchase but one monthly bill for all of that month s purchases. The bill is created through batch processing, where all of the data are collected and held until the bill is processed as a batch at the end of the billing cycle. Benefits of Batch Processing System: Batch processing has these benefits: It allows sharing of computer resources among many users and programs. It shifts the time of job processing to when the computing resources are less busy. It avoids idling the computing resources with minute-by-minute human interaction and supervision. By keeping high overall rate of utilization, it better amortizes the cost of a computer, especially an expensive one. 2. Interactive Systems: An interactive operating system allows users to interact directly with a computer. The user can interrupt a low-priority batch job and cause the computer to perform his high priority work. Interactive operating systems must be multiprogramming systems. Also, real-time systems must be interactive since real-time files must be updated immediately after real world events occur. An interrupt is required, which is the suspension of the execution of a computer program, caused by an event external to the program, and performed in such a way that the execution can later be resumed. Examples of such external events would be a request for data, or input of data, from an interactive terminal.
3. Multiprogramming System: In Batch Operating System the jobs are loaded into the system and processed one at a time. Once loaded, job will remain in the memory until its execution is completed and the next job will be loaded only after completion of the previous job. It was observed that a job does not need the CPU for the entire duration of its processing. In addition to doing computation (CPU is needed) a job often needs to perform I/O operations during the course of its processing. Job can be: CPU bound or I/O bound. In this case CPU will be idle whenever the job that is currently being processed by the system performs I/O operations. The concept of multiprogramming was introduced to minimize the idle time of the CPU by organizing multiple jobs in the system so that the CPU always has something to execute. Multiprogramming is a technique used to utilize maximum CPU time by running multiple programs simultaneously. The execution begins with the first program and continues till an instruction waiting for a peripheral is reached, the context of this program is stored, and the second program in memory is given a chance to run. The process continues until all programs finished running. The computer has a number of programs loaded into memory and the operating system switches quickly between them, processing a little bit of each one in turn. Requirements of Multiprogramming system: 1. Large Memory: The main memory should be large enough to accommodate a good number of user programs along with operating system. 2. Memory Protection: The computer should have some type of memory protection mechanism to prevent program in one memory portion from changing information or instruction of a program, in another memory portion. 3. Program Status Prevention: In multiprogramming there is possibility of stopping execution of one program and restarting it at a later time. Thus all the intermediate results in the CPU registers should be stored somewhere while stopping the execution of program and retrieving it when restarting execution.
4. Program Job Mix: A proper mix of input/output bound and CPU bound jobs is required for effective overlapping of the CPU and I/O device operations. So that the CPU & I/O devices both are busy at the same time. Advantages of Multiprogramming: Increased Throughput. Shorter Response Time. Ability to assign priorities to job. Improved Primary storage allocation. Disadvantages: The operating system overhead (its primary storage requirements and CPU execution time requirements) is greater with multiprogramming. Inter program interference. 4. Virtual Storage OS: Virtual storage OS uses both types of physical storage (central and auxiliary) to enable another kind of storage called virtual storage. In VOS, each user has access to virtual storage, rather than physical storage. This use of virtual storage is central to the unique ability of OS to interact with large numbers of users concurrently, while processing the largest workloads. Virtual storage means that each running program can assume it has access to all of the storage defined by the architecture's addressing scheme. To allow each user to act as large storage really exists in the computer system, OS keeps only the active portions of each program in central storage. It keeps the rest of the code and data in files called page data sets on auxiliary storage, which usually consists of a number of high-speed direct access storage devices (DASD). Virtual storage is this combination of real and auxiliary storage. OS uses a series of tables and indexes to relate locations on auxiliary storage to locations in central storage. It uses special settings to keep track of the identity and authority of each user or program. OS uses a variety of storage manager components to manage virtual storage. Advantages of Virtual Storage: The CPU is utilized more fully. Pages from many different programs can reside in main storage at any time. Programmers no longer need to concern themselves about primary storage size constraints when writing programs. Disadvantages of Virtual Storage: Increased overhead cost. CPU time is required to page all those pages in and out of main storage. Additional primary storage is required to hold the tables that keep track of the pages and to hold virtual storage OS. Thrashing: It occurs when one or more pages of a program have to be paged in and paged out of primary storage frequently during execution of the program. Thrashing could reach a point where the CPU is spending too much time on paging in and out as compared to time spent on program execution.
5. Time Sharing & Interactive Computing: Time sharing is technique permitting many users simultaneously access to a central computer through remote terminals. It is a method of operation in which multiple users with different programs interact nearly simultaneously with the central processing unit of a computer. As the central processor operates substantially faster than peripheral equipment (e.g., video display terminals, tape drives, and printers), it has sufficient time to solve several discrete problems during the input/output process. Commonly used time-sharing techniques include multiprocessing, parallel operation, and multiprogramming. Also, many computer networks organized for the purpose of exchanging data and resources are centered on time-sharing systems. Working of time sharing system: In time sharing system each user has a separate terminal. Unlike the multiprogramming system in time sharing the CPU time is divided among all the users on scheduling basis. The period of time during which a user gets the attention of CPU is called as slice period or quantum. Due to high processing speed of CPU it can switch easily from one user station to another. The user can give his program from his terminal and correct the errors if any during data entering. He can then submit it to the processor for execution. The processor executes the program within a given slice period and after the execution is completed returns the output to the terminal. 6. Multiprocessing System: Multiprocessing is a type of processing in which two or more processors work together to process more than one program simultaneously. It allows the system to do more work in a shorter period of time. Multiprocessor system is also known as parallel system or tightly-coupled system. It means that multiple processors are tied together in some manner. Generally, (the processors are in close communication with each other. They share common data structures and a common system clock. Advantages of Multiprocessor Systems: Some advantages of multiprocessor system are as follows: 1. Reduced Cost: Multiple processors share the same resources. Separate power supply or mother board for each chip is not required. This reduces the cost. 2. Increased Reliability: The reliability of system is also increased. The failure of one processor does not affect the other processors though it will slow down the machine. If a processor fails, a job running on that processor also fails. 3. Increased Throughput: An increase in the number of processes completes the work in less time. It is important to note that doubling the number of processors does not halve the time to complete a job. It is due to the overhead in communication between processors and contention for shared resources etc.
7. Multitasking: The ability to execute more than one task at the same time, a task being a program. The terms multitasking and multiprocessing are often used interchangeably, although multiprocessing implies that more than one CPU is involved. In multitasking, only one CPU is involved, but it switches from one program to another so quickly that it gives the appearance of executing all of the programs at the same time. There are two basic types of multitasking: preemptive and cooperative. In preemptive multitasking, the operating system parcels out CPU time slices to each program. In cooperative multitasking, each program can control the CPU for as long as it needs it. If a program is not using the CPU, however, it can allow another program to use it temporarily. Ankit Gupta ankitg1689@gmail.com