fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X,...

14
Chapter 1 Introduction to OS 1.1 Operating system : evolutions & generations of OS Operating System (OS) is an interface between computer user and computer hardware. OR An operating system is software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers. Example Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs. Fig.1: Operating System OS acts as a control program which controls all activities of computer system. It interacts with hardware of computer system to perform different tasks. Primary objective of OS is to make computer convenient to use and utilize hardware in efficient manner. Computer system can be divided into 4 components: 1. Hardware 2.Operating System 3.Application Program 4.Users

Transcript of fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X,...

Page 1: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

Chapter 1

Introduction to OS

1.1 Operating system : evolutions & generations of OS

Operating System (OS) is an interface between computer user and computer hardware. OR

An operating system is software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Example Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc.

OR

An operating system is a program that acts as an interface between the user and the computer hardware and controls the execution of all kinds of programs.

Fig.1: Operating System

OS acts as a control program which controls all activities of computer system. It interacts with hardware of computer system to perform different tasks.

Primary objective of OS is to make computer convenient to use and utilize hardware in efficient manner.

Computer system can be divided into 4 components:

1. Hardware 2.Operating System 3.Application Program 4.Users

Page 2: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

Fig.2 : Components of Computer System

1. Hardware : These are physical parts of machine which provides basic computing resources. It includes CPU, memory, I/O devices etc. which provides basic computing resources for system.

2. Application Program : It defines the way in which these resources are used to solve user computing problems. e.g. word processor,compiler,browser

3. Operating System : It controls & coordinate the use of hardware amongst the various application program for various users.

4. Users :Users are human beings, machines and other computers .

Functions of an Operating System: Transferring input from input device to memory. Transferring input from memory to CPU. Transferring data from CPU to output device. Copy or move data from one storage device to other. It manages the programs running on the system Display appropriate error messages in case of software or hardware problems. Maintain details of files & directories. To provide security to users data. Protection of storage devices from overwriting. It manages the hardware and software resources of the system. It provides a stable, consistent way for applications to deal with the hardware without

knowing all the details of the hardware.

Computer System generation:-

1. Zeroth Generation computers (Mechanical Parts) Made up of analytical engine This machine was mechanical design with wheels, gears etc. Able to do basic calculations only. Slow speed.

2. First Generation Computers: [1945-1955] Vaccume tube is used as processing unit. These computers were fastest calculating device at that time.

Page 3: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

In this generation mainly batch processing operating system were used. In this generation Punched cards, Paper tape, Magnetic tape Input & Output device

were used. But because of Vaccume tube first generation computer were very large Slower & less

efficient & require large space. Suffered with heat & maintenance problem.

3. Second generation Computers : [1955-1965] This generation uses the transistor. Transistor were 100 times smaller than Vaccume tube. There were Batch processing and Multiprogramming Operating system used. Transistor were cheaper, consumed less power, more compact in size, more reliable

and faster than the first generation machines Transistor required frequent maintenance.

4. Third Generation Computers : [1965-1980] In this IC used Due to IC size of the computer is reduced & computer becomes faster. In this generation Remote processing, Time-sharing, Real-time, Multi-programming

Operating System were used. This generation computers were more reliable, smaller in size, generates less heat,

consumed less electricity. Highly sophisticated technology is required for IC Manufacturing.

5. Fourth Generation Computers : [1980-1990] The fourth generation of computers makes use of Very Large Scale Integrated (VLSI)

circuits. VLSI circuits having about 5000 transistors and other circuit elements and their

associated circuits on a single chip. Fourth Generation computers became more powerful, compact, reliable, and

affordable, very small in size. Highly sophisticated technology is required for VLSI chip Manufacturing In this generation Time sharing, Real time, Networks, Distributed Operating System

were used.

Evolution of Operating System:

1. Serial/sequential Processing Users access the computer in series. From the late 1940's to mid-1950's, the programmer interacted directly with

computer hardware i.e., no operating system. These machines were run with a console consisting of display lights, toggle switches,

some form of input device and a printer. Programs in machine code are loaded with the input device like card reader. If errors occur the program was halted and the error condition was indicated by lights. If the program is success, then output will appear on the printer. Main problem here is the setup time.

2. Simple Batch Systems To speed up processing, jobs with similar needs are batched together and run as a

group. Thus, the programmers will leave their programs with the operator. The operator will sort programs into batches with similar requirements.

The drawbacks with Batch Systems are: a. Lack of interaction between the user and job. b.CPU is often idle,

Page 4: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

For overcoming this problem use the Spooling Technique.

3. Multiprogrammed Batch Systems Jobs must be run sequentially, on a first-come, first-served (FCFS) basis. when several jobs are on a direct-access device like disk, job scheduling is possible. The main aspect of job scheduling is multiprogramming. Single user cannot keep the

CPU or I/O devices busy at all times. Thus multiprogramming increases CPU utilization.

4. Time-Sharing /Multitasking Systems Time-sharing or multitasking is a logical extension of multiprogramming. In this processors time is shared among multiple users simultaneously is called time-

sharing. The main difference between Multiprogrammed Batch Systems and Time-Sharing

Systems is in multiprogrammed batch systems its objective is maximize processor use, whereas in Time-Sharing Systems its objective is minimize response time.

Multiple jobs are executed by the CPU by switching between them, but the switches occur so frequently. Thus, the user can receive an immediate response.

Operating system uses CPU scheduling and multiprogramming to provide each user with a small portion of a time.

5. Personal-Computer Systems (PCs) A computer system is dedicated to a single user is called personal computer. The goals of the operating system have changed with time; instead of maximizing

CPU and peripheral utilization, the systems developed for maximizing user convenience and responsiveness.

6. Parallel Systems(tightly coupled systems/Multiprocessor) Most systems to date are single-processor systems; that is they have only one main

CPU. Multiprocessor systems have more than one processor There are two types of parallel systems:.

a. Symmetric multiprocessing model Each processor runs an identical job (copy) of the operating system, and these copies

communicate. Encore's version of UNIX operating system is a symmetric model.b. Asymmetric multiprocessing model Each processor is assigned a specific task. A master processor controls the system. Sun's operating system SunOS version 4 is a asymmetric model.

7. Distributed Systems(Loosely coupled System) Distributed systems distribute computation among several processors. In contrast to tightly couple systems (i.e., parallel systems), the processors do not

share memory or a clock. Instead, each processor has its own local memory. The processors communicate with one another through various communication lines.

8. Real-time Systems Real-time systems are used when there are rigid time requirements on the operation

of a processor or the flow of data and real-time systems can be used as a control device in a dedicated application.

Real-time operating system has well-defined, fixed time constraints otherwise system will fail.

Page 5: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

There are two types of real-time systems:a. Hard real-time systems

hard real-time systems guarantees that critical tasks complete on time. b. Soft real-time systems

Soft real time systems are less restrictive.

1.2 Types of Operating System

1. Batch operating System A batch stands for sequence of user job. The programmers leave their programs with the operator, operator then sorts the

programs with similar requirements into batches & submit it to batch processing system (BPS) & then those jobs were executed automatically without user interaction.

The users of a batch operating system do not interact with the computer directly. The jobs were recognized with the special markers which indicate start & end of jobs. Following fig. shows schematic of batch processing system. BPS consists of batch monitor or supervisor was the major component which

permanently placed in part of memory & other part of memory is used to process user’s job.

Batch monitor keeps control on processing environment. Functions of batch monitor are:

a. Scheduling:o This activity determines which service request should be handled in next

turn.o BPS uses First Come First Serve (FCFS) algorithm for scheduling.

b.Memory management:-

o During BPS operation memory is divided into two parts1. System working area 2. User working area.

o Partitioning of memory is done by OS.o Some part of monitor is permanently stored in memory known as

resident area of monitor. c.Sharing & protection :

o By dividing the memory in two parts protection is very well provided.

Advantages of Batch OS:

o Repeated jobs are done fast in batch systems without user interaction.o You don’t need special hardware and system support to input data in batch systems.o Best for large organizationso Sharing of batch system for multiple users.o The idle time batch system is very less.

Page 6: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

o You can assign specific time for the batch jobs so when the computer is idle it starts processing the batch jobs i.e. at night or any free time.

o The batch systems can manage large repeated work easily.o Programmer attention is reduced.

Disadvantages of Batch OS:

o Monitor remains in memory it results in amount of memory wastageo It is difficult to debug batch systems.o Batch systems are sometime costly.o Lack of protection

2. Multiprogramming The process of executing multiple programs simultaneously is known as

multiprogramming. Uniprogramming cannot keep CPU & I/O devices busy at all time. Uniprogramming cannot keep I/O devices as well as CPU busy. Using multiprogramming we can increase utilization of CPU & I/O device. Multiprogramming OS keeps several jobs in memory at a time. Set of jobs are shown

below

Fig. :- Memory layout of Multiprogramming.

This set of jobs is kept in job pool. Following diagram shows working of uniprogramming & multiprogramming system

Page 7: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

By considering above diagram of multiprogramming system initially, Job A is given for execution .After some time it may require I/O operation So the CPU become Idle(wait),instead of making CPU idle ,it switches to next job for execution till it require I/O operation, The CPU switched to next job and so on.

Job may have to wait for some task. When job needs to wait CPU switches to another job, execute it and so on.

E.g. A computer running excel and firefox browser simultaneously

Advantages :-

o Setup time is reduced.o Efficiency is improvedo Waiting time is limited for programs.o CPU utilization increases.

Disadvantages :-

o Proper memory management is required.o Proper scheduling algorithm is required.o Maintenance is expensive.

3. Multitasking Multitasking is the ability of an operating system to execute more than one task

simultaneously on a single processor machine Multitasking is logical extension of multiprogramming. Though we say so but in reality no two tasks on a single processor machine can be

executed at the same time. Actually CPU switches from one task to the next task so quickly that appears as if all

the tasks are executing at the same time. A task is a particular operation like edit, copy, rename, delete, open, close etc. Multitasking is possible by executing one job in foreground & many jobs in

background. Foreground jobs require user interaction where as background jobs does not require

user interaction. E.g. While editing we can take printouts & listen music.

Page 8: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

Advantages :-

o Multiple tasks can be run simultaneouslyo Increases sped of executiono CPU utilization increases.

Disadvantages:-

o These systems are not reliable.o Problem of data communication.o It raises question of security of user program & data.

Sr. No.

Multiprogramming Multitasking

1 Multiple programs are executed simultaneously.

Multiple tasks are executed simultaneously.

2 Collection of different tasks is program. Task is smaller unit of program.3 Program may contain multiple task . Task do not contain program4 User interaction is not provided User interaction is provided5 It utilizes CPU & I/O devices efficiently It utilizes CPU efficiently6 There are simply only programs There are two types of task foreground

& background task.

4. Time sharing OS

Time-sharing is a technique which enables many people, located at various terminals, to use a particular computer system at the same time.

Time-sharing is a logical extension of multiprogramming. Processor's time which is shared among multiple users simultaneously is termed as

time-sharing. The main objective of Time-Sharing is to minimize response time. Multiple jobs are executed by the CPU by switching between them, but the switches

occur so frequently. Thus, the user can receive an immediate response. Example OS :Linux

Page 9: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

Fig. Time shared OS

In this there is large central computer system to which number of terminals are connected.

Central computer provides time slice(in milliseconds) at regular interval to each terminal.

The time sliced is switched so rapidly that each terminal feels that the whole computer is dedicated to himself or herself.

CPU does not wait for any operation for every job ,it immediately switched to to other job as the time slice is very less.

Advantages :-

o Provides the advantage of quick responseo Avoids duplication of softwareo Reduces CPU idle time

Disadvantages :-

o Expensive to build.o Problem of data communicationo Difficult & complicated.

5. Multiprocessor OS/Tightly couples/Parallel System In this more than one processors can be places in single cabinet which shares

resources, bus, memory etc. Objective –is to get maximum work done in less time. It is also called as tightly coupled or parallel system.

Fig. Multiprocessor OS

Types of Multiprocessor System are

CPU 1 CPU 2

Large central system

Terminal 1

CPU n

Terminal 2 Terminal n

Memory,BUS

Resources

Page 10: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

1. Symmetric Multiprocessing – In this two or more processors are connected with high bandwidth link & manage by single OS. All processor equally share I/O devices.

2. Asymmetric Multiprocessing –Each processor is assigned specific task.IN this Master-Slave concept is used. Master processors controls slave processors.

Advantages:-

o It increases throughput.o It increases reliability (if one processor fails, whole system will not fail.)o More than one processors can be used.o Maximum work done can be done in less time.

Disadvantages:-

o Expensive to build & maintain.o More complex in both hardware & software as compare to uniprocessor system.

6. Distributed Operating System/Loosely coupled Systemo It is collection of processors interconnected by communication network.o Also called as loosely coupled system and are exactly opposite to

multiprocessor system.o From point of view of specific processor, rest of processor & their respective

resources are remote whereas its own are local.o Data processing jobs are distributed among the processors accordingly. o The processors communicate with one another through various communication

lines (such as high-speed buses or telephone lines).o Processors in a distributed system may vary in size and function. o These processors are referred as sites, nodes, computers, and so on.

Advantages:-

o With resource sharing facility, a user at one site may be able to use the resources available at another.

o Speedup the exchange of data with one another via electronic mail. o If one site fails in a distributed system, the remaining sites can potentially

continue operating.o Better service to the customers. o Reduction of the load on the host computer. o Reduction of delays in data processing.

Page 11: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

Disadvantages:-

o Complex & difficult to build.o Special security measures are needed to protect the shared resources.

7. Clustered System Clustered architecture interconnects two or more computer using additional

software & network technology to make a single, virtual or logical structure. This system uses multiple computers to complete a task. High availability service is provides by this system because even if one

computer in cluster fails whole system will not fail. Cluster system combines best features of distributed & multiprocessor system. There are two types of cluster system

1. Asymmetric system – one machine is in hot standby mode while others running the applications.Hot standby mode –host machine does nothing but monitors active server. If server fails then host machine becomes active server.

2. Symmetric System – Two or more host are running the applications & are monitoring each other. It is most efficient because it uses all available hardware.

Advantages:-

o Provides high reliabilityo Provides High availability service

Disadvantages:-

o It is not flexible.o Implementation is expensive.

8. Real time System Real time systems are used in environment where a large number of events,

mostly external to the computer system, must be accepted and processes in short time or within deadline.

This systems are often used as control device in dedicated application. Objective -To provide quick event response time & meet scheduled deadline. It is used when rigid time requirement have been placed on operation of a

process.

Page 12: fdp201xoersite.files.wordpress.com · Web viewExample Operating Systems :- Linux, Windows, OS X, VMS, OS/400, AIX, z/OS, etc. OR. An operating system. is a program that acts as an

In this sensors are used, sensors bring data to computer, computer then analyses data & adjust controls according to sensors input.

It has fixed time constraints otherwise system will fail. Examples: Nuclear power plant control, Railway & airline reservation system,

industrial control system, satellite communication, traffic light control etc. There are two types of real-time systems:a. Hard real-time systems

hard real-time systems guarantees that critical tasks complete on given time.E.g. car engine control system.- delay in particular signal may cause engine failure.[plz illustrate example]b. Soft real-time systemsSoft real time systems will tolerate delay in time.E.g. Live audio, live video [plz illustrate example]

Advantages :-o Direct communication between user & system is possibleo System generated task can be completed within time

Disadvantages :-

o More complex & difficult to maintain