Introduction to Operating Systems: Unit I: Introduction

Evolution of Operating System

Introduction - Introduction to Operating Systems

Types of an operating system are a grouping that differentiates or identifies the operating system based on how it works the type of hardware it controls and the application it supports.

Evolution of Operating System

AU: DEC-19

• Types of an operating system are a grouping that differentiates or identifies the operating system based on how it works the type of hardware it controls and the application it supports.

• Evolution of an operating systems are as follows:

a) Early systems/serial processing (mid 1940s to mid 1950s)

b) Simple batch systems (1960)

c) Multi-programmed batch systems (1970)

d) Time-sharing and real-time systems (1970)

e) Multiprocessor systems (1980)

f) Networked/distributed systems (1980)

Batch System

• Batch system process a collection of jobs, called a batch. Batch is a sequence of user jobs.

• Job is a predefined sequence of commands, programs and data that are combined into a single unit.

• Each job in the batch is independent of other jobs in the batch. A user can define a job control specification by constructing a file with a sequence of commands.

• Jobs with similar needs were batched together to speed up processing. Card readers and tape drives are the input device in batch systems. Output devices are tape drives, card punches and line printers.

• Primary function of the batch system is to service the jobs in a batch one after another without requiring the operator's intervention. There is no need for human/user interaction with the job when it runs, since all the information required to complete job is kept in files.

• Some computer systems only did one thing at a time. They had a list of instructions to carry out and these would be carried out one after the other. This is called a serial system. The mechanics of development and preparation of programs in such environments are quite slow and numerous manual operations non involved in the process.

• Batch monitor is used to implement batch processing system. Batch monitor is also called kernel. Kernel resides in one part of the computer main memory.

• The memory allocator managed the main memory space. Batch monitor controls the sequence of events. Main memory store the batch monitor and users program and data (jobs). Fig. 1.3.1 shows memory layout for a batch system.

• Computer operator gives a command to start the processing of a batch, the kernel sets up the processing of the first job. Job was selected from the job queue and loaded into main memory. When a job completed execution, its memory was released and the output for the job was copied.

• When a job is completed, it returns control to the monitor, which immediately reads in the next job.

• Fig. 1.3.2 shows concept of batch system.

• Scheduling is also simple in batch system. Jobs are processed in the order of submission i.e. first come first served fashion.

• When a job completes execution, its memory is released and the output for the job gets copied into an output spool for later printing.

Spooling

• Spooling an acronym for simultaneous peripheral operation on line. Spooling uses the disk as a large buffer for outputting data to printers and other devices. It can also be used for input, but is generally used for output.

• Its main use is to prevent two users from alternating printing lines to the line printer on the same page, getting their output completely mixed together. It also helps in reducing idle time and overlapped I/O and CPU.

• Batch system often provides simple forms of file management. Access to file is serial. Batch systems do not require any time critical device management.

• Batch systems are inconvenient for users because users cannot interact with their jobs to fix problems. There may also be long turnaround times. Example of this system is generating monthly bank statement.

• An optimization used to minimize the discrepancy between CPU and I/O speeds is spooling. It overlaps of one job with computation of other job.

• The spooler for instance could be reading the input of one job while printing the output of different job.

• Spooling refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when it is ready.

• Spooling is useful because device access data at different rates. The buffer provides a waiting station where data can rest while the slower device catches up.

• Computer can perform I/O in parallel with computation, it becomes possible to have the computer read a deck of cards to a tape, drum or disk and to write out to a tape printer while it was computing. This process is called spooling.

• The most common spooling application is print spooling.

• Spooling batch system were the first and are the simplest of the multiprogramming systems.

Advantages of spooling

1. The spooling operation uses a disk as a very large buffer.

2. Spooling is however capable of overlapping I/O operation for one job with processor operations for another job.

Advantages and Disadvantages of Batch System

Advantages of batch system

1. Move much of the work of the operator to the computer.

2. Increased performance since it was possible for job to start as soon as the previous job finished.

Disadvantages of batch system

1. Turn around time can be large from user standpoint.

2. Program debugging is difficult.

3. There was possibility of entering jobs in infinite loop.

4. A job could corrupt the monitor, thus affecting pending jobs.

5. Due to lack of protection scheme, one batch job can affect pending jobs.

Multi-programing Operating System

• CPU remains idle in batch system. At any time either CPU or I/O device was idle in batch system. To keep CPU busy, more than one program/job must be loaded for execution. It increases the CPU utilizations. So multiprogramming increases the CPU utilization.

• Resource management is the main aim of multiprogramming operating system. File system, command processor, I/O control system and transient area are the essential components of a single user operating system.

• Multiprogramming operating system divides the transient area to store the multiple programs and provides resource management to the operating system.

• The concurrent execution of programs improves the utilization of system resources. A program in execution is called a "Process", bini "Job" or a "Task".

• When two or more programs are in the memory at the same time, sharing the processor is referred to the multiprogramming operating system.

• Fig. 1.3.3 shows the memory layout for a multiprogramming operating system. 

 

• Operating system keeps number of programs into the memory. It selects one program from the memory and executes it. All the programs that enter the system are kept in the job pool.

• Job pool consists of all processes residing on disk and waiting to allocate primary memory. Job scheduling concept is used if there is no space for process in the primary memory.

• Memory management is also required to manage the memory for process. CPU scheduling is applied for selecting process from memory.

• When computer loads more than one program in to the memory, CPU executes one program and I/O system is busy with other programs.

• Multiprogramming operating system do not provide user interaction with the

program.

• Fig. 1.3.4 shows working of multiprogramming OS.

• In multiprogramming operating system, programs are competing for resources. A function of the multiprogramming operating system is CPU scheduling, memory management and I/O management.

• Suppose there are four programs for execution. All four programs are loaded into the memory. CPU select first program for execution. Normally programs contain instruction for CPU and I/O operation.

• CPU bound instructions: c = a + b

• I/O bound instructions: printf, scanf etc.

• When any I/O instruction is encounter in the program, CPU select next program for processing. CPU select second program for execution and I/O system select  first program for performing I/O operation. Multiprogramming operating system  monitors the state of all active programs and system resources.

Advantages:

1. CPU utilization is high.

2. It increases the degree of multiprogramming.

Disadvantages :

1. CPU scheduling is required.

2. Memory management is also required.

Time Sharing System

• Time sharing is also called multitasking operating system. It is logical extension of the multiprogramming operating systems.

• User interaction with program is possible in time sharing operating system. During execution of the program, user interacts directly with the program, supplying information to the program.

• Multi-tasking means that the computer can work with more than one program at a time. For example, user could be working with information from one database on the screen analyzing data, while the computer is sorting information from another database, while a excel sheet is performing calculations on a separate worksheet.       

• Many users share the computer system simultaneously in time sharing operating system. Time sharing system uses multiprogramming and CPU scheduling. Each user has at least one separate program in memory.

• In time sharing system, each user is given a time slice for executing his/her job in round robin fashion. Job continues until the time slice ends.

• Fig. 1.3.5 shows multitasking OS.

• Concept of virtual machine is used in time sharing system. It creates virtual machine one per user. User interaction with system by using virtual machine. User enters the command for virtual machine and result will received back to user.

• Time sharing system is more complex than multiprogramming operating system. It So disk sni also takes help of file system. File system is stored on the disk management is also required.

• Major problem with time sharing system is protection and security of data.

• Time sharing system uses medium term scheduling such as round robin for the foreground. Background process uses can use a different scheduling method.

• Difference between multiprogramming and multitasking operating system is context switching. In multiprogramming system a context switching occurs only when the currently executing process stalls for some reasons.

• Time sharing system gives each user the impression that the entire system is dedicated to his use. Context switching simply allows several applications to be open, but only one is working at a time.

• Truly speaking, even in true multi-tasking, only one application program is ever running at anyone instant. Because the computer automatically switches from one program to the next program so quickly, all the programs seem to run don simultaneously.

 Difference between Time sharing Os and multiprogramming Os

• In a multiprogramming and time-sharing environment, several users share the system simultaneously. This situation can result in various security problems. Such problems are privacy, integrity and denial of service.

a) Privacy: One user can read the private data of another user.

b) Integrity: One user can corrupt the private data of another user.

c) Denial of Service: One user can prevent another user from getting anything done.

• Can we get the same degree of security in a time-shared machine as we have in a dedicated machine? Solution to this is Yes/No. There are two answers, either one correct.

 a) Yes: If we can ensure that the operating system prevents any sharing of data between users, either for reading or writing and fairly shares the computer, then we can achieve the same level of security.

b) No: We can never be sure that our software doesn't have bugs, so we can never be sure that we prevent all sharing of data and fairly allocate computer resources.


University Question

1. Distinguish multiprogramming and time-sharing environment. In a multiprogramming and od time-sharing environment, several users share the system simultaneously. This situation can result in various security problems.

i) What are two such problems?

ii) Can we ensure the same degree of security in a time-shared machine as in a dedicated machine? Explain your answer.  AU Dec.-19, Marks 13

Introduction to Operating Systems: Unit I: Introduction : Tag: : Introduction - Introduction to Operating Systems - Evolution of Operating System