Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

54
SOFTWARE Operating System 1 Ms Manpreet Kaur, Assistant Professor, DIAS

Transcript of Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Page 1: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 1

SOFTWAREOperating System

Page 2: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 2

Page 3: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 3

Operating Systems

An operating system is the most essential system software that manages the operation of a computer. Without an operating system, it is not possible to use the computer. The computer is useless unless it is provided essential software that makes it ready to use.

An operating system is software which makes a computer ready to use by a process called booting.

What booting exactly means.- When we switch on computer, the instructions stared in ROM are automatically executed. These instructions help computer to load an operating system from external storage device (disk) to internal storage (RAM). This process of loading of operating system from disk to RAM is called booting.

Page 4: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 4

Operating Systems

Operating System is a software, which makes a computer to actually work.

It is the software the enables all the programs we use.

The OS organizes and controls the hardware. OS acts as an interface between the application

programs and the machine hardware. Examples: Windows, Linux, Unix and Mac OS, etc.,

Two primary objectives of an OS are:

§ Making a computer system convenient to use

§ Managing the resources of a computer system

Page 5: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 5

Logical Architecture of a Computer System

The operating system layer hides the details of the hardware from the programmer and provides the programmer with convenient interface for using the system

Page 6: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 6

Logical Architecture of a Computer System

The structure of OS consists of 4 layers: Hardware

Hardware consists of CPU, Main memory, I/O Devices, etc,

Software (Operating System)

Software includes process management routines, memory management routines, I/O control routines, file management routines.

System programs

This layer consists of compilers, Assemblers, linker etc.

Application programs

This is dependent on users need. Ex. Railway reservation system, Bank database management etc.,

Page 7: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 7

Functions Of Operating System

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

Page 8: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 8

Functions Of Operating System

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

The o/s keeps track of the memory, what parts are in use and by whom.

Page 9: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 9

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

The o/s keeps track of processors and the status of processes. It decides who will have a chance to use the processor.

Functions Of Operating System

Page 10: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 10

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

The o/s keeps track of the devices, channels, control units and decides what is an efficient way to allocate the device.

Functions Of Operating System

Page 11: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 11

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

O/S keeps track of the information, its location, use, status etc. and decides who gets use of the resources, enforce protection requirements

Functions Of Operating System

Page 12: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 12

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

An o/s is to protect the user from unauthorized access of his files or data. And also it should protect itself from users

Functions Of Operating System

Page 13: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 13

o Memory managemento Process managemento Device managemento Information managemento Protection o Error Handling

An o/s must respond to errors by taking the appropriate actions.

Functions Of Operating System

Page 14: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 14

Types of Operating Systems

Many types of operating systems are available for computers which can be divided into the following two types:

1. Single-user Operating Systems

2. Multi-user Operating Systems

Page 15: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 15

Single-user Operating Systems

These operating systems are used mainly for computers having only one terminal (stand-alone PCs). MS DOS (Microsoft Disk Operating System) and PC DOS (Personal Computer Disk Operating System) are the two important single user operating systems. Both systems are almost identical and are simply called DOS.

OS/2 and Windows NT are other popular single-user multi-tasking operating systems for microcomputers.

Page 16: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 16

Single-user Operating Systems

i) MS DOS

MS DOS, developed by Microsoft Inc. in 1981, is the most widely used operating system of IBM-compatible microcomputers. The latest version (identification number of a release of software) of MS DOS is 7.

ii) PC DOS

PC DOS is essentially the same operating system as MS DOS but is developed and supplied by IBM for its personal computers.

Page 17: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 17

Multi-user Operating Systems

These operating systems are used for those computers (micro to mainframe) which have many terminals (multi-user systems). The popular operating systems used for multi-user systems are UNIX, NetWare, MVS, OS/400, VMS and Linux.

AT&T at Bell Laboratories initially developed UNIX in 1969. Unix is a highly successful operating system for multi-user systems. Actually, it is more popular among scientific and engineering users rather than business users. A version of UNIX that runs on PCs is XENIX. It was developed by Microsoft Corporation in 1980. It is compatible with AT&T’s System V definition. UNIX System V Release 4 is the latest version of UNIX.

Page 18: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 18

Multi-user Operating Systems

Following are the popular operating systems used for multi-user systems:

i) NetWare

NetWare is a group of network operating systems developed by Novell, Inc. that provides multi-user capabilities.

ii) MVS (Multiple Virtual Storage)

MVS is one of the most complex multi-user operating systems ever developed for IBM mainframes. In MVS, each job (time-sharing user or batch program) is assigned its own virtual storage space.

iii) OS/400

OS/400 is the IBM’s operating system for its AS/400 computer.

iv) VMS (Virtual Memory Storage)

VMS operating system is used on DEC’s VAX series of minicomputers.

v) Linux

Linux is a 32-bit UNIX-like operating system that has been developed recently for microcomputers It is the world’s first free operating system developed and maintained by thousands of people worldwide.

Page 19: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 19

Operating System Techniques

1. Multiprogramming

Multiprogramming is a process by which a single CPU works on two or more programs simultaneously. Using this technique, an operating system keeps a CPU busy. Multiprogramming allows a processor to handle either multiple batch jobs at a time (batch multiprogramming) or multiple interactive jobs shared among multiple users (time sharing multiprogramming). Time-sharing is a technique that allows a CPU to simultaneously support the activities of several users by allocating fixed time slots (in milliseconds). Examples of operating systems that support multiprogramming are OS/2, UNIX and Macintosh System 7.

2. Multiprocessing

Multiprocessing refers to the use of two or more CPUs to perform a coordinated task simultaneously. For example, MVS, VMS and Windows NT support multiprocessing.

3. Multitasking

Multitasking refers to an ability of operating system to execute two or more tasks concurrently. In multitasking environment, a user opens new applications without closing the previous ones and the information can be easily moved among a number of applications. For example, Windows NT and OS/2 operating systems use this technique.

Page 20: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Batch Processing: In Batch processing same type of jobs batch (BATCH- a

set of jobs with similar needs) together and execute at a time.

The OS was simple, its major task was to transfer control from one job to the next.

The job was submitted to the computer operator in form of punch cards. At some later time the output appeared.

The OS was always resident in memory. Common Input devices were card readers and tape

drives.

20

Page 21: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Batch Processing (Contd…): Common output devices were line printers, tape drives,

and card punches. Users did not interact directly with the computer

systems, but he prepared a job (comprising of the program, the data, & some control information).

21

OS

User program area

Page 22: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multiprogramming:

Multiprogramming is a technique to execute number of programs simultaneously by a single processor.

In Multiprogramming, number of processes reside in main memory at a time.

The OS picks and begins to executes one of the jobs in the main memory.

If any I/O wait happened in a process, then CPU switches from that job to another job.

Hence CPU in not idle at any time.

22

Page 23: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

OS Features Needed for Multiprogramming

I/O routine supplied by the system. Memory management – the system must

allocate the memory to several jobs. CPU scheduling – the system must choose

among several jobs ready to run. Allocation of devices.

23

Page 24: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 24

Multiprogramming (Contd…):

OS

Job 1

Job 2

Job 3

Job 4

Job 5

• Figure dipicts the layout of multiprogramming system.

• The main memory consists of 5 jobs at a time, the CPU executes one by one.

Advantages:

•Efficient memory utilization

•Throughput increases

•CPU is never idle, so performance increases.

Page 25: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Uniprogramming Vs Multiprogramming Uniprogramming: Only one job is processed at a time and

all system resources are available exclusively for the job until its completion

Multiprogramming: Interleaved execution of two or more different and independent programs by a computer

Types of Multiprogramming:Multiprogramming with fixed tasks (MFT): Fixed number of jobs

can be processed concurrentlyMultiprogramming with variable tasks (MVT): Number of jobs can

vary Area occupied by each job residing simultaneously in the

main memory is known as a memory partition

25

Page 26: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Uniprogramming System

26

Only one job is processed by the system at a time and all the system resources are exclusively available for the job until it completes

Page 27: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multiprogramming System

27

Page 28: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Time Sharing Systems:

Time sharing, or multitasking, is a logical extension of multiprogramming.

Multiple jobs are executed by switching the CPU between them.

In this, the CPU time is shared by different processes, so it is called as “Time sharing Systems”.

Time slice is defined by the OS, for sharing CPU time between processes.

Examples: Multics, Unix, etc.,

28

Page 29: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Time Sharing Systems: Simultaneous interactive use of a computer system by

many users in such a way that each one feels that he/she is the sole user of the system

User terminals connected to the same computer simultaneously

Uses multiprogramming with a special CPU scheduling algorithm

Short period during which a user process gets to use CPU is known as time slice, time slot, or quantum

CPU is taken away from a running process when the allotted time slice expires

29

Page 30: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Advantages of Time-sharing Systems

Reduces CPU idle time Provides advantages of quick response time Offers good computing facility to small users

30

Page 31: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Desktop Systems Personal computers – computer system dedicated to a

single user. I/O devices – keyboards, mice, display screens, small

printers. User convenience and responsiveness. Can adopt technology developed for larger operating

system’ often individuals have sole use of computer and do not need advanced CPU utilization of protection features.

May run several different types of operating systems (Windows, MacOS, UNIX, Linux)

31

Page 32: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multiprocessing

System with two or more CPUs having ability to execute multiple processes concurrently

Multiple CPUs are used to process either instructions from different and independent programs or different instructions from the same program simultaneously

Types of multiprocessing: Tightly-coupled: Single system-wide primary memory

shared by all processors Loosely-coupled: Each processor has its own local

memory

32

Page 33: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multiprocessing System

33

Page 34: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Parallel Systems Multiprocessor systems with more than on CPU in close

communication. Tightly coupled system – processors share memory and a clock;

communication usually takes place through the shared memory. Advantages of parallel system:

Increased throughputEconomical Increased reliability

○ graceful degradation○ fail-soft systems

34

Page 35: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Parallel Systems (Cont.)

Symmetric multiprocessing (SMP) Each processor runs and identical copy of the operating

system. Many processes can run at once without performance

deterioration. Most modern operating systems support SMP

Asymmetric multiprocessing Each processor is assigned a specific task; master

processor schedules and allocated work to slave processors. More common in extremely large systems

35

Page 36: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

36Ms Manpreet Kaur, Assistant Professor, DIAS

Symmetric Multiprocessing Architecture

Page 37: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

A Distributed Operating System

A distributed operating system manages a group of independent computers and makes them appear to be a single computer.

The development of networked computers that could be linked and communicate with each other, gave rise to distributed computing.

Distributed computations are carried out on more than one machine.

When computers in a group work in cooperation, they make a distributed system.

37

Page 38: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Distributed Systems Distribute the computation among several physical

processors. Loosely coupled system – each processor has its own local

memory; processors communicate with one another through various communications lines, such as high-speed buses or telephone lines.

Advantages of distributed systems.Resources Sharing Computation speed up – load sharing ReliabilityCommunications

38

Page 39: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Distributed Systems (cont)

Requires networking infrastructure. Local area networks (LAN) or Wide area

networks (WAN) May be either client-server or peer-to-

peer systems.

39

Page 40: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

40Ms Manpreet Kaur, Assistant Professor, DIAS

General Structure of Client-Server

Page 41: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 41

RTOS

Page 42: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 42

Real Time System

A system is said to be Real Time if it is required to complete it’s work & deliver it’s services on time.

Example – Flight Control SystemAll tasks in that system must execute on time.

Non Example – PC system

Page 43: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 43

Real-Time Systems

Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems.

Well-defined fixed-time constraints. Real-Time systems may be either hard

or soft real-time.

Page 44: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 44

Hard Real Time Systems

Hard Real Time SystemSecondary storage limited or absent,

data stored in short term memory, or read-only memory (ROM)

Conflicts with time-sharing systems, not supported by general-purpose operating systems.

Failure to meet deadlines is fatalexample : Flight Control System

Page 45: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS 45

Soft Real Time Systems

Soft Real Time SystemLimited utility in industrial control of roboticsUseful in applications (multimedia, virtual

reality) requiring advanced operating-system features.

Late completion of jobs is undesirable but not fatal.

System performance degrades as more & more jobs miss deadlines

Online Databases

Page 46: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Real-Time Systems

Often used as a control device in a dedicated application such as controlling scientific experiments, medical imaging systems, industrial control systems, and some display systems.

Well-defined fixed-time constraints. Real-Time systems may be either hard or soft

real-time.

46

Page 47: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Real-time Operating System

A real-time operating system is a multitasking operating system that aims at executing real-time applications.

Real-time operating systems often use specialized scheduling algorithms so that they can achieve a deterministic nature of behavior.

The main objective of real-time operating systems is their quick and predictable response to events.

They have an event-driven or time-sharing design and often aspects of both.

An event-driven system switches between tasks based on their priorities or external events while time-sharing operating systems switch tasks based on clock interrupts.

47

Page 48: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Real-Time Systems (Cont.)

Hard real-time:Secondary storage limited or absent, data stored

in short term memory, or read-only memory (ROM)

Conflicts with time-sharing systems, not supported by general-purpose operating systems.

Soft real-timeLimited utility in industrial control of roboticsUseful in applications (multimedia, virtual reality)

requiring advanced operating-system features.

48

Page 49: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Types of OS:

Operating System can also be classified as,-

Single User Systems

Multi User Systems

49

Page 50: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Single User Systems:

Provides a platform for only one user at a time. They are popularly associated with Desk Top

operating system which run on standalone systems where no user accounts are required.

Example: DOS

50

Page 51: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multi-User Systems:

Provides regulated access for a number of users by maintaining a database of known users.

Refers to computer systems that support two or more simultaneous users.

Another term for multi-user is time sharing.

Ex: All mainframes and  are multi-user systems. Example: Unix

51

Page 52: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multi-user vs. Single-user

A multi-user operating system allows multiple users to access a computer system concurrently.

Time-sharing system can be classified as multi-user systems as they enable a multiple user access to a computer through the sharing of time.

Single-user operating systems, as opposed to a multi-user operating system, are usable by a single user at a time.

Being able to have multiple accounts on a Windows operating system does not make it a multi-user system. Rather, only the network administrator is the real user.

But for a Unix-like operating system, it is possible for two users to login at a time and this capability of the OS makes it a multi-user operating system.

52

Page 53: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multitasking

Interleaved execution of multiple jobs (often referred to as tasks of same user) in a single-user system

Computer systems used for multitasking are uniprocessor systems (having only one CPU)

Treated differently from multiprogramming that refers to interleaved execution of multiple jobs in a multi- user system

53

Page 54: Operating System 1Ms Manpreet Kaur, Assistant Professor, DIAS.

Ms Manpreet Kaur, Assistant Professor, DIAS

Multi-tasking vs. Single-tasking When only a single program is allowed to run at a time, the

system is grouped under a single-tasking system. However, when the operating system allows the execution of

multiple tasks at one time, it is classified as a multi-tasking operating system.

Multi-tasking can be of two types: pre-emptive.

○ In pre-emptive multitasking, the operating system slices the CPU time and dedicates one slot to each of the programs.

○ Unix-like operating systems such as Solaris and Linux support pre-emptive multitasking.

Cooperative ○ multitasking is achieved by relying on each process to give time to the other

processes in a defined manner. ○ MS Windows prior to Windows 2000 used to support cooperative

multitasking. 54