Unit 1 introduction to operating system

36
Introduction To Operating System Prepared By Prof. Bhushan Pawar www.bhushanpawar.com

Transcript of Unit 1 introduction to operating system

Page 1: Unit 1 introduction to operating system

Introduction

To

Operating System

Prepared By

Prof. Bhushan Pawar

www.bhushanpawar.com

Page 2: Unit 1 introduction to operating system

Basics

Prof.Bhushan Pawar www.bhushanpawar.com

Page 3: Unit 1 introduction to operating system

Operating System

• It is a collection of software that managescomputer hardware resources and providescommon services for computer programs.

• The operating system is a vital component ofthe system software in a computer system

• Definition- “An operating system is a programthat acts as an interface between the user andthe computer hardware and it controls theexecution of all kinds of programs”

Prof.Bhushan Pawar www.bhushanpawar.com

Page 4: Unit 1 introduction to operating system

Operating System

Prof.Bhushan Pawar www.bhushanpawar.com

Page 5: Unit 1 introduction to operating system

History of UNIX

• In mid-1960s, Massachusetts Institute ofTechnology, AT&T Bell Labs and GeneralElectric were (Ken Thompson, Dennis Ritchie,Doug McIlroy, and Joe Ossanna) developing anexperimental time-sharing & hierarchical filesystem operating system called Multics.

• In 1970, Peter Neumann coined the project nameUNICS (UNiplexed Information and ComputingService) as a pun on Multics (MultiplexedInformation and Computer Services)

Prof.Bhushan Pawar www.bhushanpawar.com

Page 6: Unit 1 introduction to operating system

History of UNIX (Continued…)• In 1972, Unix was rewritten by Dennis Ritchie in

the C programming language .

• In 1980, Bell developed multiple versions of Unixfor internal use, such as CB UNIX, PWB/UNIX(Programmer's Workbench)

• Microcomputer Unix became commerciallyavailable in 1980, when Onyx Systems released itsZilog Z8000-based C8002 and Microsoft announcedits first Unix for 16-bit microcomputers calledXenix, which the Santa Cruz Operation (SCO)ported to the 8086 processor in 1983

Prof.Bhushan Pawar www.bhushanpawar.com

Page 7: Unit 1 introduction to operating system

History of UNIX (Continued…)

• Can find out more at:

http://en.wikipedia.org/wiki/History_of_Unix

Prof.Bhushan Pawar www.bhushanpawar.com

Page 8: Unit 1 introduction to operating system

Unique Features of Unix

• Multitasking

• Multiuser

• Portability

• Application Libraries and Tools (e.g

shell, gedit etc.)

Prof.Bhushan Pawar www.bhushanpawar.com

Page 9: Unit 1 introduction to operating system

Benefits of Unix• High level language “C” which makes it easier to

read understand and update.

• Complex programs can be built on simple programs.

• Hierarchal file system which allows easy

maintenance and efficient implementation.

• Provides simple and consistent interface to the

peripheral devices.

• It completely hides the machine architecture from the

user which makes it easier for the programmers to

write programs independent of hardware.

Prof.Bhushan Pawar www.bhushanpawar.com

Page 10: Unit 1 introduction to operating system

System Structure

Prof.Bhushan Pawar www.bhushanpawar.com

Page 11: Unit 1 introduction to operating system

System Structure

Prof.Bhushan Pawarwww.bhushanpawar.com

Page 12: Unit 1 introduction to operating system

System Structure

Prof.Bhushan Pawar www.bhushanpawar.com

Page 13: Unit 1 introduction to operating system

System Structure

• It can be viewed as a set of layers

• Lowermost layer is Hardware Layer which is notthe part of the UNIX operating system

• Middle layer is called the System Kernel or thekernel which is a actual operating system code andfunctionality. It is totally isolated from user’sprogram. The programs interact with the kernel byusing the system calls

• User programs can be built on top of the lowerlevel programs using these lower level programsand system calls

Prof.Bhushan Pawar www.bhushanpawar.com

Page 14: Unit 1 introduction to operating system

User Perspective

• User perspective is basically based

on 3 scenarios

–The File System

–Processing Environment

–Building Block Primitives

Prof.Bhushan Pawar www.bhushanpawar.com

Page 15: Unit 1 introduction to operating system

File System

• Characteristics of UNIX file system

– A hierarchal structure.

– Consistent treatment of data

– Ability to create and delete files

– Dynamic growth of files

– Peripheral devices are also treated as files

Prof.Bhushan Pawar www.bhushanpawar.com

Page 16: Unit 1 introduction to operating system

File System- Diagram 1

Prof.Bhushan Pawar www.bhushanpawar.com

Page 17: Unit 1 introduction to operating system

File System- Diagram 2

Prof.Bhushan Pawar www.bhushanpawar.com

Page 18: Unit 1 introduction to operating system

File System

• A full path name starts with the root directory i.e.a slash character ( “/” ) and specifies the file thatcan be found by travestying the tree.

• The path that starts from the root directory iscalled the Absolute Path.

• Alternatively we can give path of any file relativeto any other directory. This path will be calledRelative Path.

• The files are just stream of bytes it is up-to the program to interpret these bytes.

Prof.Bhushan Pawar www.bhushanpawar.com

Page 19: Unit 1 introduction to operating system

File System

• Permission to any file is governed by the file

access permissions.

• Access permissions are set independently for

read, write and execute. These permissions are

set independently for the file user, file group

and others.

– E.g. rwx rwx rwx–

u g o

Prof.Bhushan Pawar www.bhushanpawar.com

Page 20: Unit 1 introduction to operating system

Pro

f.B

hu

shan

Paw

ar

w

ww

.bh

ush

anp

awar

.co

m

Page 21: Unit 1 introduction to operating system

Processing Environment• Program is an executable file and Process is an

instance of program in execution.

• Many processes can execute simultaneously on

UNIX systems (sometimes this feature is

known as Multiprogramming or Multitasking)

• Various system calls allow processes to create

new processes, terminate processes,

synchronize stages of process execution, and

control reaction to various events

Prof.Bhushan Pawar www.bhushanpawar.com

Page 22: Unit 1 introduction to operating system

Processing Environment

Prof.Bhushan Pawar www.bhushanpawar.com

Page 23: Unit 1 introduction to operating system

Building Block Primitives

• Unix allows user to write small, modular

programs, which are later on use as a building

block for complex programs.

• It has 3 standard files

– Standard Input File

– Standard Output File

– Standard Error File

Prof.Bhushan Pawar www.bhushanpawar.com

Page 24: Unit 1 introduction to operating system

Building Block Primitives

• e.g

– One primitive building block available to the shell

user is the redirect I/O

• ls – this command gives the list of all files in current

directory

– The second building block primitive is the PIPE

• ls | more

Prof.Bhushan Pawar www.bhushanpawar.com

Page 25: Unit 1 introduction to operating system

Operating System Services

• Memory Management

• Processor Management

• Device Management

• File Management

• Security

• Control over system performance

• Job accounting

• Error detecting aids

• Coordination between other software and users

Prof.Bhushan Pawarwww.bhushanpawar.com

Page 26: Unit 1 introduction to operating system

Operating System Services

• Process Controlling– Controlling the Creating, Termination and Suspension

of processes.

• Scheduling Processes– Since many programs can execute simultaneously in

UNIX the process scheduling is also done by thekernel.

• Main Memory Management– allocating main memory to the user programs and

protecting the memory region where kernel is running.Also, protecting the memory region of one processfrom another process.

Prof.Bhushan Pawar www.bhushanpawar.com

Page 27: Unit 1 introduction to operating system

Operating System Services

• Secondary Memory Management

– Managing the secondary storage for the efficient andtimely retrieval and storage of data.

• Virtual Memory

– Managing the swap device and handling the swappingsystem. Controlling the pages in the pagingsystem(memory allocation)

• Controlling Peripheral Devices

– Kernel controls the peripheral devices such asterminals, disk drives and network devices.

Prof.Bhushan Pawar www.bhushanpawar.com

Page 28: Unit 1 introduction to operating system

Assumptions about the Hardware

• When a process executes on UNIX it executes

on two levels or we can say it executes in two

modes

– User level

– Kernel level

Prof.Bhushan Pawar www.bhushanpawar.com

Page 29: Unit 1 introduction to operating system

User Level Vs. Kernel Level

• Processes in user mode can access their own

instructions and data but not kernel

instructions and data (or those of other

processes).

• Processes in kernel mode, can access kernel

data and instructions as well as user data and

instructions.

Prof.Bhushan Pawar www.bhushanpawar.com

Page 30: Unit 1 introduction to operating system

Assumption 1

Interrupts and exceptions

• UNIX supports asynchronous interrupt coming

facility.

• After receiving interrupt kernel saves the context and

services the interrupt, After servicing the interrupt it

reloads its context and resumes whatever it was

doing.

• There might be a possibility that kernel is servicing

one interrupt and another interrupt may occur. So

whether or not to service that interrupt and stop

whatever kernel was doing is decided by the interrupt

priority(or interrupt levels).Prof.Bhushan Pawar

www.bhushanpawar.com

Page 31: Unit 1 introduction to operating system

Interrupts and exceptions• If a high priority interrupt occurs the kernel stops the

previous one and jumps onto second. If a lower priority

interrupt occurs the kernel will not stop what it was

doing and that interrupt will have to wait. In other words

the lower priority interrupt is blocked if kernel is

servicing some high priority interrupt.

• An exception occurs when a process does something

unexpected. Exceptions are different from interrupts

they occur as events. If an interrupt occurs in the middle

of instruction, that instruction will be restarted after

handling the exception. If the exception is not caused by

the instruction but because of some other reasons and

between two instructions then the next instruction is

processed after handling the exception.

Pro

f.B

hu

shan

Paw

arw

ww

.bh

ush

anp

awar

.co

m

Page 32: Unit 1 introduction to operating system

Interrupts and exceptions

Prof.Bhushan Pawar www.bhushanpawar.com

Page 33: Unit 1 introduction to operating system

Assumption 2

Processor Execution Levels

• Computers typically have a set of privileged

instructions that set the processor execution level in

the processor status word. Setting the processor

execution level to certain values masks off interrupts

from that level and lower levels, allowing only

higher-level interrupts

Prof.Bhushan Pawar www.bhushanpawar.com

Page 34: Unit 1 introduction to operating system

Assumption 3

Memory management

• It is functionality of an operating system which

handles or manages primary memory.

• It keeps track of each and every memory location

either it is allocated to some process or it is free.

• It checks how much memory is to be allocated to

processes, decides which process will get memory at

what time.

• It tracks whenever some memory gets freed or

unallocated and correspondingly it updates the status.

Prof.Bhushan Pawarwww.bhushanpawar.com

Page 35: Unit 1 introduction to operating system

Assumption 3

Memory management

• It consist of 7 operations– Dynamic Loading

– Dynamic Linking

– Logical versus Physical Address Space

– Swapping

– Memory Allocation

– Fragmentation

– Paging

– Segmentation

Prof.Bhushan Pawar www.bhushanpawar.com

Page 36: Unit 1 introduction to operating system

Any Question???• If you having any doubt then you can freely

ask me question on

[email protected]

Or

contact me on (+91)-7588318728

Prof.Bhushan Pawar www.bhushanpawar.com

36