Anda di halaman 1dari 60

UNIT 1 Introduction of Operating System

By: Prof. D. A. Ghate


DCOER, Pune TE IT

Topics to be covered in Unit 1


1)Operating system objectives and functions. 2) Evolution of operating systems, Batch, multiprogramming. Multitasking, Multiuser, parallel, distributed & real time 3) Architecture of OS 4) System calls, O. S. Shell 5) Linux Shell commands, Shell programming 6) Awk programming. 7) Examples of O. S.: Linux , MS-Windows,

Objectives
At the end of this unit, you will be able to Understand the definition and functions of OS. Understand the basic concept of operating system. Different architecture of OS. Learn and understand shell and awk programming. Comparison between different operating system.

Books to Refere
1. William Stalling Operating System 6th Edition Pearson Education. 2. Silberschatz Galvin Operating System Concepts 8th Edition John Wiley Pub. 3. Sumitabha Das UNIX Concepts and Applications 3rd Edition TMGH.

Operating System
A program that controls the execution of application programs An interface between applications and hardware Best Possible Definition: An Operating system is the software on a computer that manages the way different programs use its hardware and regulates the way that a user controls the computer.

Operating System Objectives


Convenience ( OS can be viewed as a user computer interface)- An operating system makes a computer more convenient to use. Efficiency (OS can be viewed as a resource manager) An operating system allows the computer system resources to be used in an efficient manner. Ability to evolve (OS can be viewed as a program) An operating system should permit the effective development, testing, and introduction of new system functions without interfering with the services.

Layers and Views

Abstract view of the components of a computer system


Users Application Programs Operating system Computer Computer Hardware Hardware

Services Provided by the OS


Program development
Operating system provides editor and debuggers to assist the programmer in creating the programs.

Program execution - Number of task need to be perform to execute a program - Instruction and data must be loaded in main memory. O. S. handles these scheduling duties for the user.

Services Provided by the OS


Access I/O devices - Each I/O device requires its own set of instructions for operations. - OS provides uniform interface that hides these details, so that programmer can access such devices using simple read and writes.

Services Provided by the OS


Controlled access to files - In case of file access OS provides structure of data contained in the files on the storage medium. - In case of system with multiple users, OS may provide protection mechanism to control access to files.

Services Provided by the OS


System access - In case of shared or public system, OS controls access to the system. - Access function must provides protection of resources and data from unauthorized user.

Services Provided by the OS


Error detection and response
Internal and external hardware errors Software errors Operating system cannot grant request of application In each case, OS must provides a response that clears error conditions with list impact on running applications.

Services Provided by the OS


Accounting
Collect usage statistics for various resources and Monitor performance parameters. Used to anticipate future enhancements

Operating System
Responsible for managing resources Functions same way as ordinary computer software
It is a program that is executed

OTHER DEFINITIONS
o An Operating System is a control program.

o An Operating System is similar to a Government. o An Operating System can be defined as a Resource Manager.

OTHER DEFINITIONS
o An Operating System is a control program.

o An Operating System is similar to a This program controls the execution Government. of user programs to prevent errors and
improper use can of the computer. o An Operating System be defined as a Resource Manager.

OTHER DEFINITIONS
o An Operating System is and a control program. As a resource manager allocator, the OS

will resolve the confliting request for An Operating is similar a computer System resources(CPU time,to memory space, files storage space, input/output Government. devices, etc) from various users or programs.

o An Operating System can be defined as a Resource Manager.

OS as Resource Manager

COMPUTER HARDWARE & SOFTWARE


o H/w - Physical Components of a Computer. o S/w Set of Computer Programs.

COMPUTER SOFTWARE

System Programs

Application Programs

Which manages the operations of the computer

Which solve problems for their users

OPERATING SYSTEM
o It is the most fundamental of all the system programs, which controls all the computers resources and provides the base upon which the application programs can be written. o It is a layer of s/w on the top of the bare h/w, which will shield programmers from the complexity of the h/w.

COMPUTER SYSTEM
Banking System
Compilers Editors

Airline System
Command Interpreter

Application Programs

System Programs Operating System Machine Language Microprogramming

Hardware

Physical Devices

A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Integrated circuit chips, wires, power suppliers, cathode ray tube, etc.

Operating System Machine Language Microprogramming

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Operating System Machine Language Microprogramming

Directly controls the physical devices and provides a cleaner interface to the next layer. It interprets the instructions from the above layer and carry out them.

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Operating System Machine Language Microprogramming

Instructions for moving data around the machine, doing arithmetic and comparing values. I/O devices are controlled by loading values into specified device registers.

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Operating System Machine Language Microprogramming

Major function is to hide all h/w complexity and give the programmer a more convenient set of instructions to work with.

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Operating System Machine Language Microprogramming

The OS runs in kernel mode but the compilers and editors run in user mode. If a user does not like a particular complier, the user is free to write his own but he is not free to write his own disk interrupt handler, which is part of the OS.

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

COMPUTER SYSTEM
Banking System
Compliers Editors

Airline System
Command Interpreter

Operating System Machine Language Microprogramming

These programs are written by the users to solve their particular problems, such as commercial data processing, engineering calculations, or game playing.

Physical Devices
A Computer system consists of Hardware, System Programs and Application Programs

Evolution of Operating Systems


Hardware upgrades plus new types of hardware New services

Evolution of Operating Systems


Serial processing
No operating system Programs in a machine code loaded via input devices (Card reader) Machines run from a console with display lights, toggle switches, input device, and printer

Evolution of Operating Systems


Batch system - Users submits job - Operator forms a batch by bunching user jobs - Loads job into the card reader - Computer executes these jobs sequentially and produces results on printer - Printed out put is collected by operator and distributed to user.

Punched Card( Hollerith's card)

Batch Processing

Characteristics of Batch System


Once a job starts executing , until finished no other job can execute Low CPU utilization because when program is reading data or producing output CPU is idle No user interaction Batch systems are appropriate for executing large jobs that require little interaction

Card Reader

Computer

Printer

Batch system Memory Layout

Job Control Language


Main task of the Batch processing OS was to transfer control from one job to another.
Problems
1. How does the monitor know about the nature of the job (e.g., Fortran versus Assembly) or which program to execute? 2. How does the monitor distinguish (a) job from job? (b) data from program?

Solution Job Control language

Uniprogramming
Processor must wait for I/O instruction to complete before proceeding

Multiprogramming
In this environment, multiple programs are kept in memory and one program is executed at a time. When a program terminates or goes for I/O resources, another program starts executing Multiprogramming improves CPU utilization Improves Throughput

Multiprogramming
When one job needs to wait for I/O, the processor can switch to the other job

Multiprogramming

Memory Layout for multiprogramming

Time Sharing Systems


Using multiprogramming to handle multiple interactive jobs Processors time is shared among multiple users A time unit is divided into small slice and each user can be allocated CPU in round robin manner A time shared OS allows many users to share the computer simultaneously Multiple users simultaneously access the system through terminals Gives illusion that each user has his own dedicated machine

Requirements of time shared system


Needs to keep track of time Requires Dynamic Resource allocation
To mange memory processes can be swapped out requiring backing store

Dynamic resource allocation required elaborate and complicated resource management and access control technique

Parallel & Distributed System


Parallel processing improves performance Approaches for parallel processing
Pipelining eg. Instruction pipelining Multiplicity of components (Multiprocessor Systems)
Symmetric Multiprocessing Asymmetric multiprocessing

Multiplicity of Systems
Cluster Grid

Multiprocessor System Offers


Increased throughput Economy Increased Reliablity
Graceful Degradation Fault tollerent

Symmetric Multiprocessing :Each processor runs identical copy of OS Asymmetric multiprocessing: master slave relation exist. These are tightly coupled systems

Distributed Systems
These systems depend on network for their functionality
Client Server Systems Peer to peer systems

Each processor has its own local memory Processors communicate with each other through communication links Loosely coupled Systems

Real-time systems

Those systems in which the correctness of the system depends not only on the logical result of computation, but also on the time at which the results are produced.

A Sample Real Time System

Sample Real Time System


Mission: Reaching the destination safely. Controlled System: Car. Operating environment: Road conditions. Controlling System - Human driver: Sensors - Eyes and Ears of the driver. - Computer: Sensors - Cameras, Infrared receiver, and Laser telemeter.

Example Flight Control System


All tasks in that system must execute on time.

Hard and Soft Real Time Systems


Hard Real Time System
Failure to meet deadlines is fatal example : Flight Control System

Soft Real Time System


Late completion of jobs is undesirable but not fatal. System performance degrades as more & more jobs miss deadlines Online Databases

Major Achievements
Processes Memory management Information protection and security Scheduling and resource management System structure

FUNCTIONS OF OPERATING SYSTEM


o o o o o o

Memory management Process management Device management Information management Protection The o/s keeps track of the memory, what Handling parts are in use and by whom. Error

FUNCTIONS OF OPERATING SYSTEM


o o o o o o

Memory management Process management Device management Information management

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

FUNCTIONS OF OPERATING SYSTEM


o o o o o o

Memory management Process management Device management Information management


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

FUNCTIONS OF OPERATING SYSTEM O/S keeps track of the information,


o o o o o o

its location, use, status etc. and decides Memory management who gets use of the resources, Process management enforce protection requirements

Device management Information management Protection Error Handling

FUNCTIONS OF OPERATING SYSTEM


o o o o o o

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

Protection Error Handling

FUNCTIONS OF OPERATING SYSTEM


o o o o o o

Memory management Process management


An o/s must respond to errors by taking Device management the appropriate actions.-*

Information management Protection Error Handling

Different Architectures of OS

Anda mungkin juga menyukai