cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern...

22

Click here to load reader

Transcript of cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern...

Page 1: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 6Paper title : Operating SystemsTittle : Types of Operating Systems

Introduction

In the last lecture, we have already discussed about the various components of operating system. We had also discussed about various resources available with computer system. How these resources are distributed among competing processes (resource allocation) and how the detail of hardware is hidden from the applications programs (resource abstraction) has also been discussed. In this lecture, we will study about various types of operating systems, i.e., batch processing, multiprogramming, time sharing, personal computer operating system and real time operating systems.

There are various types of operating systems as discussed following.

Batch processing operating systems

It is one of the early types of operating system, when computers were large machines and dedicated to execute a single program at a time. The memory layout of a simple batch processing system is shown in figure. The programmer was given the full access to the entire machine. The users of these systems did not interact directly with the computer systems. As shown in figure, user prepares his job consisting of program and associated data on punched cards and submits it to a computer operator. The computer operator collects the jobs from various users and arranges them in batches. One batch may be consisting of similar types of jobs or mixture of different types of jobs. One complete batch is submitted as a unit to the batch processing operating system for execution. A batch processing operating system reads a series of separate jobs, each with its own data and control

Page 2: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

information. When the job is completed, its output is printed. With this form of processing, operator or user intervention was reduced as jobs could be serviced one after the other automatically. A memory resident portion of the batch processing operating system- sometimes called the batch monitor transfer control from one job to another automatically.

In this execution, CPU is often idle. This idleness occurs because the speeds of the mechanical I/O devices are slower then those of electronics devices (CPU). To balance the speed mismatch between I/O devices and CPU, the concept of Spooling (Simultaneous Peripheral Operations Online) is introduced. Using Spooling, when the CPU is busy to execute some job, the input operations and output operations are performed simultaneously to keep CPU busy in processing the jobs for most of the time as shown in figure. Spooling can keep both the CPU and the I/O devices working at much higher rates. 1.1 Problems of batch processing

1. Turnaround time is more in batch processing OS. The turnaround time is the time difference between time of completion of the job and time of submission of job. Usually, in batch processing, turnaround time is high as it takes a lot of time to create a batch and only after that execution starts.

2. CPU remains free for most of the time. CPU remains idle during the time to create batch, time to load the jobs, time to load the input data of jobs and time to print the output of jobs.

3. No interaction is possible with the user while jobs are being executed. Due to this error correction is not possible as they occur.

4. Proceeding of multiple jobs is not possible.

1.2 Advantages of batch processing operating system

1. This is the best operating system for implementing the jobs that require the computer or a peripheral device for an extended period of time but need very little user interaction, e.g., Generation of electricity or telephone bills of a city, payroll etc.

Multiprogrammed operating system (Multiprogramming):

Page 3: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Batch processing dedicates resources (CPU and memory) of a computer system to a single program at a time. Single user cannot keep either the CPU or the I/O devices busy at all times. Therefore, to increase the utilization of resources, multiprogrammed operating system is used. Multiprogrammings keeps several jobs in memory at one time and are executed concurrently. In multiprogramming systems, when one job during execution needs I/O transfer, the CPU switches to the other job and start executing it. When that job needs I/O, the CPU is switched to another job, and so on. Eventually, the first job to execute, the CPU will never be idle. Memory layout of multiprogrammed operating system has been shown in figure. In this figure one can see that there are five jobs simultaneously loaded and executing in system. In this figure, Initially, CPU is working on job 4. Job 1 is performing its I/O operations. Rests of the jobs are in ready state (waiting for CPU). After some time CPU switches to job 3 and, job 4 starts performing its I/O operations. Again after some time CPU switches to job 2 while job 1 has completed its I/O operations and goes in waiting state. This process has also been shown in the figure. Here, in this figure, Job 1 and Job 2 are in ready state. Initially, job 1 gets CPU. After some time when job 1 requires performing its I/O operations, it goes to waiting state and performs I/O operations. CPU is allocated to job 2. Again after completing its I/O operations job 1 comes back to ready state and waits for CPU.

Multiprogramming can be defined as interleaved execution of two or more programs. Since there is only one processor, there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on. To the user it appears that all programs are executing at the same time. Multiprogramming increases CPU utilization by organizing jobs such that the CPU always has one to execute.

Many real life situations are common with multiprogramming concept. A lawyer does not have a single client at one time. He has many clients in the process of being served at the same time. While one case is waiting to go for trail or to have papers typed, the lawyer can work on another case. Similarly, a judge in court may be hearing many cases at same time. A police officer may be investigating many cases simultaneously. 2.1 Advantages of multiprogramming

Page 4: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

1. Throughput of the system is increased as CPU always has one job to execute. Throughput can be defined as the numbers of jobs completed per

unit time.

2. Response time, turnaround time and waiting time decreases.

2.2 Disadvantages of multiprogramming

1. Due to simultaneous presence of more than one job in memory, complex memory management algorithms are required to implement multiprogramming.

2. Many jobs present in memory (which are not doing I/O operations) are always waiting for CPU and whenever CPU gets free, CPU scheduler is required to select the next job for CPU out of these waiting jobs.

3. To take the maximum benefit of multiprogramming, proper job mix (input/output bound and CPU processes) is required.

4. Memory protection is required.

3. Time sharing operating system

Batch processing and multiprogramming OS provide non-interactive computing environment. Time sharing systems were developed to provide interactive use of a computer system at a reasonable cost. Time sharing or multitasking is logical extension of multiprogramming. Multiple processes (jobs) are executed by the CPU switching between them, but the switching occurs so frequently that the users may interact with each process while it is running. Each user is provided with a small share of CPU called timeslice. Every process runs for the timeslice, it is provided. Either process finishes or goes to waiting stage before its timeslice expires; otherwise process is interrupted and placed at the rear end of the queue of processes waiting for execution.

Time shared operating system allows the many users to share the computer simultaneously. Since each action or command in a time-shared system tends to be short, only a little CPU time is needed for each user. As the system switches rapidly from one user to the next, each user is given the impression that he has his own computer, whereas actually one computer is being shared among many users. A time shared system uses CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared computer.

Page 5: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

In this figure, there are six jobs in row and CPU currently is executing Job 1. CPU will execute jobs one by one only. The maximum time CPU will serve any job is the timeslice (fixed amount of time). This process has also been shown in the figure. Here, in this figure, Job 1 and Job 2 are in ready state. Initially, job 1 gets CPU. After some time when job 1 requires performing its I/O operations, it goes to waiting state and performs I/O operations. CPU is allocated to job 2. Again after completing its I/O operations job 1 comes back to ready state and waits for CPU. In the meanwhile timeslice of job 2 expires and it goes back to ready state for its turn to CPU. The process continues in the same way and so on.

The time-shared systems are more complex than the multi-programming systems. In time-shared systems multiple processes are managed simultaneously which requires an adequate management of main memory so that the processes can be swapped in or swapped out within a short time.

3.1 Advantages of time sharing operating system

1. Resources are used more efficiently.

2. CPU remains busy most of the time.

3. Response time is very less.

4. More interaction of users with the programs is possible.

3.2 Disadvantages of time sharing operating system

1. Frequent swapping of CPU between different processes may decrease the effective utilization of CPU. Program status preservation is required more number of times.

2. More memory is required to accommodate more processes to use resourcesefficiently.

Personal Computers

Page 6: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

As hardware cost have decreased, it has once again become feasible to have a computer system dedicated to a single user. These types of computer systems are usually called personal computers. Personal computers are micro computers considerably smaller than and less expensive than mainframe systems. The goals of these operating systems were to provide maximum convenience to user (user friendliness) instead of increasing CPU and peripheral utilization. Microsoft Windows, MS-DOS and Apple Macintosh operating systems fall in this category.

A personal computer (PC) is a general-purpose computer, whose size, capabilities and cost makes it useful for individuals, and operated directly by an end-user with no intervening computer operator. This contrasted with the batch processing or time-sharing models which allowed larger, more expensive minicomputer and mainframe systems to be used by many people, usually at the same time. Therefore, operating system of a personal computer is very simple and less sophisticated.

Software applications for most personal computers include, but are not limited to, word processing, spreadsheets, databases, web-browsers and e-mail clients, digital media playback, games and special-purpose software applications. Modern personal computers often have connections to the internet, allowing access to the World Wide Web and a wide range of other resources. Personal computers may be connected to a local area network (LAN), either by a cable or a wireless connection. A personal computer may be a desktop computer or a laptop, tablet or a handheld PC.

5. Workstation

A workstation is a special personal computer designed for technical, mathematical, or scientific applications. Normally, workstation is used by one person at a time, commonly connected to a local area network and run multi-user operating systems. Workstations are used for tasks such as computer-aided design, drafting and modeling, computation-intensive scientific and engineering calculations, image processing, architectural modeling, and computer graphics for animation and motion picture visual effects.

There is not much difference between personal computers (PCs) and workstations. Both are desktop computers. Historically, workstations had offered higher

Page 7: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

performance than personal computers, especially with respect to CPU and graphics, memory capacity and multitasking capability. Workstations are essentially desktop PCs that have been upgraded heavily with powerful hardware and software specifically keyed toward a certain task. For example, film editors use specially customized workstations to take raw digital footage and edit it into a watchable form. Video game developers also use workstation computers to piece together graphics, animation and sound.

Real Time Operating System (RTOS)

Real time operating system runs applications with very precise timing and a high degree of reliability. Real time operating system is a special purpose OS that has rigid time constraints for any job to be completed. System responses arrived later than the expected times are either irrelevant or meaningless. Therefore, in RTOS, the correctness of the computations not only depends upon the logical correctness of the computation but also upon the time at which the result is produced. Main objective of the real time systems is to provide quick event response times, and thus meet the scheduling deadlines. User convenience and resource utilization are of secondary concern to RTOS. The sensor produces the signal that is interpreted by the OS as an interrupt. On receiving the interrupt, the operating system invokes a specific process or a set of processes to serve the interrupt. This can be especially important in measurement and automation systems where downtime is costly or a program delay could cause a safety hazard. Some of the examples of real time systems are medical imaging systems, industrial control systems, telephone switching systems, automobile-engine fuel injection systems, air traffic control, missile guidance, etc. RTOS can be categorized in two parts:

6.1 Hard real time operating system

Operating systems that can absolutely guarantee a maximum time for these operations are commonly referred to as "hard real-time". In hard RTOS, all critical tasks have to be completed strictly within the specified amount of time i.e., within the given deadline. In a hard real-time operating system however, not only tasks must be completed within the specified timeframe, but they must also be

Page 8: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

completed correctly. In hard RTOS, failure to meet deadlines may cause heavy loss. Consider an example of air bags provided in cars. At the time of requirement, if air bags do not open, it may cost the life to some passenger. Other examples of hard RTOS are flight control system, online stock trading system etc.

6.2 Soft real time operating system

In a soft real-time system, tasks are completed as fast as possible without having to be completed within a specified timeframe. Late completion of jobs is undesirable but not fatal. In soft RTOS, if deadline is not met, the system does not fail but the performance deteriorates. Operating systems that can only guarantee a maximum time most of the time are referred to as "soft real-time”. Here system performance degrades as more & more jobs miss deadlines.

7. Conclusions

There are many types of operating systems designed for various types of applications. Various types of operating systems are: batch processing, multiprogramming, time sharing, personal computer operating system and real time operating systems. The major difference between these operating systems is the manner in which they cater to user jobs, manner in which system resources are distributed among various processes and type of jobs to be processed.

Page 9: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 3Topic : IntroductionTittle : Types of Operating Systems

Objective

The main objective of the lecture is to discuss the various types of operating system and advantages and disadvantages of each.

Page 10: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 6Paper title : Operating SystemsTittle : Types of Operating Systems

Summary

Batch processing operating system is used for processing jobs requiring less user interaction. Multiprogramming operating system increases system performance by executing multiple jobs simultaneously. High throughput, less turnaround time and less waiting time are achievements of multiprogramming. Time sharing operating system is logical extension of multiprogramming and CPU is shared among many processes only for specified amount of time. This reduces the response time and user interactive jobs are handled in good manner. Operating systems for personal computers are less expensive and used to provide maximum convenience to user (user friendliness) instead of increasing CPU and peripheral utilization. Workstations are special kinds of personal computers used for specific task. Real time operating systems are used for processing the jobs having rigid time constraint.

Page 11: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 6Paper title : Operating SystemsTittle : Types of Operating Systems

FAQs

Q1 : What is batch processing ?

Ans : Batch processing is a technique in which a user gives a computer a batch of jobs and waits for the whole batch to be processed.

Q2 : What is multiprogramming ?Ans : Multiprogramming can be defined as interleaved execution of two or more programs. Since there is only one processor, there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another, and so on. To the user it appears that all programs are executing at the same time.

Q3 : What is the time sharing operating system ?Ans : Time sharing or multitasking is logical extension of multiprogramming. Multiple jobs are executed by the CPU switching between them, but the switching occurs so frequently that the users may interact with each program while it is running. Each user is provided with a small share of CPU called timeslice. Every program runs for timeslice it is provided.

Q4 : What is real time operating system ?

Ans : Operating system which guarantees processing of job within specified time constraint.

Page 12: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 6Paper title : Operating SystemsTittle : Types of Operating Systems

Glossary

1. Spooling: It is called simultaneous peripheral operations online. It is the technique of performing input output operations on some jobs while CPU is executing some other job.

2. Throughput: Number of jobs completed per unit time.

3. Turnaround time: The turnaround time is the time difference between time of completion of the job and time of submission of job.

4. Response time: It is time difference between the first output produced by a job and time of submission of the job.

5. Waiting time: It is the time spend by a job in wait of CPU to be allocated.

Page 13: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Assignment

1. What is difference between multiprogramming and time sharing operating systems ?

2. What is real time operating system? What is difference between hard and soft real time operating systems ?

3. What is difference between personal computers and workstations ?

Page 14: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Quiz

1. Which of the following applications are well suited for batch processing ?a) Process controlb) Video game controlc) Preparing pay bills of employeesd) Job requiring frequent user interactionAns: C 

2. Interval between the time of submission and completion of the job isa) Waiting time CPU  b) Turnaround time  c) Throughputd) Response timeAns: B 

3. Throughput of a system isa) Number of processes completed per unit timeb) Number of times the program is invoked by the systemc) Number of requests made to a program by the systemd) None of the aboveAns: A

4. What is full form of spoolinga) Simultaneous Peripheral Operations Onlineb) Simultaneous Peripheral Operations Offlinec) Single Peripheral Operations Onlined) Single Peripheral Operations Offline Ans: A

Page 15: cec.nic.incec.nic.in/wpresources/Module/EPAT_BAPS/160/types...  · Web viewA. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson . education. A. Silberschatz, P. B. Galvin,

Course : Bachelor Applied Physical Sciences (Computer Science)Subject : CSPT-404: Operating SystemsPaper 13 Part II (Sem IV)Lecture No. 6Paper title : Operating SystemsTittle : Types of Operating Systems

References

1. A. S. Tanenbaum, Modern Operating System, 3rd edition, Pearson

education.

2. A. Silberschatz, P. B. Galvin, G. Gagne Operating System Concepts, Ninth Edition John Wiley Publication. 

3. W. Stallings, Operating System, 5th edition, prentice hall of India.

4. P. Chakraborty, Operating System, first edition, Jaico Publishing House.

5. Anshuman Sharma, Anurag Gupta, S. K. Kakkar and Sandeep Sood,

Fundaments of Operating System, first edition, Lakhanpal publishers.

Links

www.icai.org/resource_file/22446ittstm_U2_cp1.pdf

www.personal.kent.edu/~rmuhamma/OpSystems/Myos/osIntro.htm