operating systems- module 1

Upload: sammit-nadkarni

Post on 10-Jan-2016

20 views

Category:

Documents


0 download

DESCRIPTION

Operating systems for 5th semester computer science engineering, first module.

TRANSCRIPT

PowerPoint Presentation

Operating SystemsProf Shamik PalitDepartment of Engineering & ITManipal University, DubaiModule 1contentsOperating System Introduction

Operating System Structure

Operating System ServicesModule 1

Operating System IntroductionDefinitionAn Operating System is a program that acts as an intermediary between user of a computer and computer Hardware.

An Operating System provides environment a user can execute programs in convenient and efficient way.

An Operating System must ensure the correct operation of Computer System

An Operating System also provides certain services to the programs and user of programs.What is an Operating System?A program that acts as an intermediary between a user of a computer and the computer hardware.

Operating system goals:Execute user programs and make solving user problems easier.Make the computer system convenient to use.

Use the computer hardware in an efficient manner.What is an Operating System?Computer systems typically contain:Hardware and Software

Hardware - electronic, mechanical, optical devicesSoftware programs

Without support software, the computer is of little use..What is an Operating System?An interface between Hardware and User Programs

An abstraction of the hardware for all the (user) processesHide the complexity of the underlying hardware and give the user a better view of the computer

Computer System ComponentsHardware provides basic computing resources (CPU, memory, I/O devices).

Operating system controls and coordinates the use of the hardware among the various application programs for the various users.

Applications programs define the ways in which the system resources are used to solve the computing problems of the users (compilers, database systems, video games, business programs).

4.Users (people, machines, other computers). 9Abstract View of System Components

The OS

The Goals of an OSLet users run programs:

CorrectnessMemory boundaries, priorities, steady state

ConvenienceUser should not handle the tiny details (encapsulate/abstract), provide synchronization primitives, system calls, file system, toolsThe Goals of an OSLet users run programs:

EfficiencyResource Utilization, resource Sharing, Multitasking

Fairness (in resource allocation)Among: users, tasks, resourcesThe tradeoff between efficiency and fairnessAn OS is a Resource AllocatorMultiple users (?) get all computing resources simultaneously:CPU timeMemory (ram, swap, working set, virtual,..)File system (storage space)I/O devices (display, printers, mouse,..)ClockThe OS should give every user the illusion that she is getting all resources to herself (not sharing!) TYPES OF OS :Mainframe SystemsReduce setup time by batching similar jobs

Automatic job sequencing automatically transfers control from one job to another. First rudimentary operating system.

Resident monitorinitial control in monitor control transfers to job when job completes control transfers pack to monitorTYPES OF OS : Simple Batch System

TYPES OF OS : Multiprogrammed Batch SystemsSeveral jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

TYPES OF OS : Time-Sharing SystemsThe CPU is multiplexed among several jobs that are kept in memory and on disk (the CPU is allocated to a job only if the job is in memory).

A job swapped in and out of memory to the disk.

On-line communication between the user and the system is provided; when the operating system finishes the execution of one command, it seeks the next control statement from the users keyboard.

On-line system must be available for users to access data and code.TYPES OF OS : Desktop SystemsPersonal 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)TYPES OF OS : Parallel SystemsMultiprocessor 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 reliabilitygraceful degradationfail-soft systemsTYPES OF OS : 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 multiprocessingEach processor is assigned a specific task; master processor schedules and allocated work to slave processors.More common in extremely large systemsTYPES OF OS : Distributed SystemsDistribute 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 ReliabilityCommunicationsTYPES OF OS : 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.

TYPES OF OS : Clustered SystemsClustering allows two or more systems to share storage.

Provides high reliability.

Asymmetric clustering: one server runs the application while other servers standby.

Symmetric clustering: all N hosts are running the application.TYPES OF OS : Real-Time SystemsOften 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.TYPES OF OS : 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.TYPES OF OS : Handheld SystemsPersonal Digital Assistants (PDAs)Cellular telephonesIssues:Limited memorySlow processorsSmall display screens.Migration of Operating-System Concepts and Features

28Module 1

Operating System StructureOperating system structureSystem Components

Process managementMain memory managementFile ManagementI/O System managementSecondary Storage managementNetworkingProtection SystemCommand Interpreter System

Operating system structureSystem ComponentsProcess managementA process can be thought as a program in executionEx : A word processing program run by userProcess need resourcesCPU time, Memory, Files , I/O DeviceProcess is unit of work in SystemCreate, delete user, system processSuspending and resume processMechanism for process synchronizationMechanism for process communication

Operating system structureSystem Components

Main memory management

Central to the all operation of Computer SystemCentral Processor reads instruction from main memoryCentral Processor reads, writes data from main memoryWhich part of the memory currently used by whomWhich process are to be loaded into memoryAllocating and De allocating memory space

Operating system structureSystem Components

File Management

Most Visible component of Operating SystemFile is a collection of related informationCreating, deleting filesCreating , deleting directoriesBacking up files on storage.

Operating system structureSystem Components

I/O System management

OS hides peculiarities of Hardware device from userI/O Subsystem consists of Memory management componentGeneral Device driver interfaceDriver for specific Hardware Device

Operating system structureSystem Components

Secondary Storage management

Used as back up memoryPrograms Compilers, assemblers stored on diskFree space managementStorage AllocationDisk Scheduling

Operating system structureSystem Components

Networking

Distributed systemCollection of process that do not share memoryEach processor has its local memoryProcess communicate through networkUser access various resourcesEx: http used in communication web server & browser

Operating system structureSystem Components

Protection System

Mechanism for controlling access of program, processImproves reliability of detecting errorsDistinguish between authorized, unauthorized access.Ex: Memory address hardware ensures that process can execute within its own address space.

Operating system structureSystem Components

Command Interpreter System

Interface between user and OSNew job started in batch systemCommand Line interpreter Shell get command statement and execute

Operating system structureA modern OS must be engineered carefully if it is to function properly and modified easily.

Simple Structure

Layered Approach

MicrokernelsOperating system structureSimple StructureMany commercial systems do not have well defined structureSuch OS started small , simple, limited systems then grow beyond their original scopeEx : MS DOS, UNIXUNIX initially had 2 componentsKernelSystem ProgramsNew version of UNIX are designed to use more advanced hardwareOperating system structure

Operating system structureLayered ApproachOS is broken up into number of layers / levelsBottom layer is Hardware, highest layer is user interfaceOS layer is an implementation of abstract objectAdvantage : Modularity Each layer uses functionality of its lower levelIt simplifies debugging and system verificationIt is less efficientEx: OS/2, Windows NT

Operating system structure

Operating system structureMicrokernelsRemove all non essential components from the kernel and implement them as system

Minimal process and memory management

Provide a communication facility between client program and various services

Communication is provided by message passingOperating system structure

Operating system structureMicrokernelsClient Program and service communicate indirectly by exchanging message with microkernel

Advantage: All new services are added to user space , do not require modification of kernel.

ExamplesTru 64 UNIXApple Mac OS X ServerQNX

Module 1

Operating System ServicesOperating system servicesOperating System provides an environment for execution of programs.It provides following services to programs and users:Program executionI/O operationFile system manipulationCommunicationsError detectionsResource AllocationAccountingProtections

Operating system servicesProgram execution

System must be able to load a program into memory and to run that programProgram must be able to end its execution

Operating system servicesI/O operation

A running program may require I/OA FileI/O DeviceUsers can not control I/O directlyOS provides a means to do I/OOperating system servicesFile system manipulation

Programs need to read and write filesPrograms need to create and delete filesOperating system servicesCommunications

Can occur in 2 ways:Between processes execute on same computerBetween processes execute in different computerCommunications implemented via shared memory or message passing technique.

Operating system servicesError detections

OS need to be aware of possible errorsErrors may occur in CPU, memory hardwareI/O devicesUser ProgramOS must take appropriate action for each type of error to ensure correct and consistent computingOperating system servicesResource AllocationResource must be allocated when Multiple users logged into systemMultiple jobs are running in same time

Different type of resource managed by OSCPU cycles, Main memory, file storageI/O device

OS maintains CPU scheduling routines.

Operating system servicesAccounting

Which user use how many and which kind of computer resourcesRecord keeping used for accounting ,usage statisticsUsed to improve computing services.Operating system servicesProtectionsOwner of the information stored in multiuser computer want to control use of that informationProtection ensures that all access to the system resources are controlledSecurityUser AuthenticationExternal I/O devicesThank You