© 2002 William Fornaciari© 2002 William Fornaciari
CEFRIELCEFRIELConsorzio per la Formazione e la RicercaConsorzio per la Formazione e la Ricercain Ingegneria dell’Informazionein Ingegneria dell’Informazione
PolitecnicoPolitecnicodi Milanodi Milano
Operating System OverviewOperating System Overview
Lecturer:Lecturer:
William FornaciariWilliam Fornaciari
Politecnico di MilanoPolitecnico di [email protected]@elet.polimi.it
www.elet.polimi.it/~fornaciawww.elet.polimi.it/~fornacia
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating SystemOperating System
A program that controls the execution of application programsAn interface between applications and hardware
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating System ObjectivesOperating System Objectives
ConvenienceMakes the computer more convenient to use
EfficiencyAllows computer system resources to be used in an efficient manner
Ability to evolvePermit effective development, testing, and introduction of new system functions without interfering with service
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Layers of Computer SystemLayers of Computer System
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Services Provided by the Services Provided by the Operating SystemOperating System
Program developmentEditors and debuggers
Program executionAccess to I/O devicesControlled access to filesSystem access
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Services Provided by the Services Provided by the Operating SystemOperating System
Error detection and responseinternal and external hardware errors
memory errordevice failure
software errorsarithmetic overflowaccess forbidden memory locations
operating system cannot grant request of application
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Services Provided by the Services Provided by the Operating SystemOperating System
Accountingcollect statisticsmonitor performanceused to anticipate future enhancementsused for billing users
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating SystemOperating System
Functions same way as ordinary computer software
It is program that is executed
Operating system relinquishes control of the processor to execute other programs
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
The Resource ManagerThe Resource Manager
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
KernelKernel
Portion of operating system that is in main memoryContains most-frequently used functionsAlso called the nucleus
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Evolution of an Operating SystemEvolution of an Operating System
Hardware upgrades and new types of hardwareNew servicesFixes
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Evolution of Operating Evolution of Operating SystemsSystems
Serial ProcessingNo operating systemMachines run from a console with display lights and toggle switches, input device, and printerSchedule tomeSetup included loading the compiler, source program, saving compiled program, and loading and linking
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Evolution of Operating Evolution of Operating SystemsSystems
Simple Batch SystemsMonitors
Software that controls the running programsBatch jobs togetherProgram branches back to monitor when finishedResident monitor is in main memory and available for execution
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Job Control Language (JCL)Job Control Language (JCL)
Special type of programming languageProvides instruction to the monitor
what compiler to usewhat data to use
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Hardware FeaturesHardware Features
Memory protectiondo not allow the memory area containing the monitor to be altered
Timerprevents a job from monopolizing the system
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Hardware FeaturesHardware Features
Memory protectiondo not allow the memory area containing the monitor to be altered
Timerprevents a job from monopolizing the system
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
UniprogrammingUniprogramming
Processor must wait for I/O instruction to complete before preceding
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
MultiprogrammingMultiprogramming
When one job needs to wait for I/O, the processor can switch to the other job
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
MultiprogrammingMultiprogramming
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
MultiprogrammingMultiprogramming
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
ExampleExample
JOB1 JOB2 JOB3
Type of job Heavy compute Heavy I/O Heavy I/O
Duration 5 min. 15 min. 10 min.
Memory required 50K 100 K 80 K
Need disk? No No Yes
Need terminal No Yes No
Need printer? No No Yes
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Effects of MultiprogrammingEffects of Multiprogramming
Uniprogramming Multiprogramming
Processor use 22% 43%
Memory use 30% 67%
Disk use 33% 67%
Printer use 33% 67%
Elapsed time 30 min. 15 min.
Throughput rate 6 jobs/hr 12 jobs/hr
Mean response time 18 min. 10 min.
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Time SharingTime Sharing
Using multiprogramming to handle multiple interactive jobsProcessor’s time is shared among multiple usersMultiple users simultaneously access the system through terminals
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Batch Multiprogramming versus Batch Multiprogramming versus Time SharingTime Sharing
Batch Multiprogramming Time Sharing
Principal objective Maximize processor use Minimize response time
Source of directives to operating system
Job control language commands provided with the job
Commands entered at the terminal
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Major AchievementsMajor Achievements
ProcessesMemory ManagementInformation protection and securityScheduling and resource managementSystem structure
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
ProcessesProcesses
A program in executionAn instance of a program running on a computerThe entity that can be assigned to and executed on a processorA unit of activity characterized by a single sequential thread of execution, a current state, and an associated set of system resources
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Difficulties with Designing Difficulties with Designing System SoftwareSystem Software
Improper synchronizationensure a process waiting for an I/O device receives the signal
Failed mutual exclusionNondeterminate program operation
program should only depend on input to it, not relying on common memory areas
Deadlocks
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
ProcessProcess
Consists of three componentsAn executable programAssociated data needed by the programExecution context of the program
All information the operating system needs to manage the process
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
ProcessProcess
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Memory ManagementMemory Management
Process isolationAutomatic allocation and managementSupport for modular programmingProtection and access controlLong-term storage
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Virtual MemoryVirtual Memory
Allows programmers to address memory from a logical point of viewWhile one process is written out to secondary store and the successor process read in there in no hiatus
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
File SystemFile System
Implements long-term storeInformation stored in named objects called files
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
PagingPaging
Allows process to be comprised of a number of fixed-size blocks, called pagesVirtual address is a page number and an offset within the pageEach page may be located any where in main memoryReal address or physical address in main memory
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Virtual memoryVirtual memory
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Virtual Memory AddressingVirtual Memory Addressing
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Information Protection and Information Protection and SecuritySecurity
Access controlregulate user access to the system
Information flow controlregulate flow of data within the system and its delivery to users
Certificationproving that access and flow control perform according to specifications
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Scheduling and Resource Scheduling and Resource ManagementManagement
Fairnessgive equal and fair access to all processes
Differential responsivenessdiscriminate between different classes of jobs
Efficiencymaximize throughput, minimize response time, and accommodate as many uses as possible
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Major Elements ofMajor Elements ofOperating SystemOperating System
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
System StructureSystem Structure
View the system as a series of levelsEach level performs a related subset of functionsEach level relies on the next lower level to perform more primitive functionsThis decomposes a problem into a number of more manageable subproblems
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating System Design Operating System Design HierarchyHierarchy
Level Name Objects Example Operations
13 Shell User programming Statements in shell languageenvironment
12 User processes User processes Quit, kill, suspend, resume
11 Directories Directories Create, destroy, attach, detach,search, list
10 Devices External devices, such Open, close,as printer, displays read, writeand keyboards
9 File system Files Create, destroy, open, closeread, write
8 Communications Pipes Create, destroy, open. close,read, write
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating System Design Operating System Design HierarchyHierarchy
Level Name Objects Example Operations
7 Virtual Memory Segments, pages Read, write, fetch
6 Local secondary Blocks of data, device Read, write, allocate, freestore channels
5 Primitive processes Primitive process, Suspend, resume, wait, signalsemaphores, readylist
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Operating System Design Operating System Design HierarchyHierarchy
Level Name Objects Example Operations
4 Interrupts Interrupt-handling Invoke, mask, unmask, retry
programs
3 Procedures Procedures, call stack, Mark stack, call, return
display
2 Instruction Set Evaluation stack, micro- Load, store, add, subtract
program interpreter, branchscalar and array data
1 Electronic circuits Registers, gates, buses, Clear, transfer, activate,
etc. complement
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Characteristics of Modern Characteristics of Modern Operating SystemsOperating Systems
Microkernel architectureassigns only a few essential functions to the kernel
address spaceinterprocess communication (IPC)basic scheduling
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Characteristics of Modern Characteristics of Modern Operating SystemsOperating Systems
Multithreadingprocess is divided into threads that can run simultaneously
Threaddispatchable unit of workexecutes sequentially and is interruptable
Process is a collection of one or more threads
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Characteristics of Modern Characteristics of Modern Operating SystemsOperating Systems
Symmetric multiprocessingthere are multiple processorsthese processors share same main memory and I/O facilitiesAll processors can perform the same functions
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Characteristics of Modern Characteristics of Modern Operating SystemsOperating Systems
Distributed operating systemsprovides the illusion of a single main memory and single secondary memory spaceused for distributed file system
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Characteristics of Modern Characteristics of Modern Operating SystemsOperating Systems
Object-oriented designused for adding modular extensions to a small kernelenables programmers to customize an operating system without disrupting system integrity
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Windows 2000Windows 2000
Exploits the power of today’s 32-bit microprocessorsProvides full multitasking in a single-user environmentClient/Server computing
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Windows 2000 ArchitectureWindows 2000 Architecture
Modular structure for flexibilityExecutes on a variety of hardware platformsSupports application written for a variety of other operating system
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
OS OrganizationOS Organization
Modified microkernel architectureNot a pure microkernel Many system functions outside of the microkernel run in kernel mode
Any module can be removed, upgraded, or replaced without rewriting the entire system
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Layered StructureLayered Structure
Hardware abstraction layer (HAL)Isolates the operating system from platform-specific hardware differences
MicrokernelMost-used and most fundamental components of the operating system
Device driversTranslate user I/O function calls into specific hardware device I/O requests
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
W2K ExecutiveW2K Executive
I/O managerObject managerSecurity reference monitorProcess/thread managerLocal procedure call (LPC) FacilityVirtual memory managerCache managerWindows/graphics modules
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
User ProcessesUser Processes
Special system support processesEx: logon process and the session manager
Server processesEnvironment subsystemsUser applications
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Client/Server ModelClient/Server Model
Simplifies the Executivepossible to construct a variety of APIs
Improves reliabilityeach service runs as a separate process with its own partition of memoryclients cannot not directly access hardware
Provides a uniform means fro applications to communicate via LPCProvides base for distributed computing
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Threads and SMPThreads and SMP
Different routines can execute simultaneously on different processorsMultiple threads of execution within a single process may execute on different processors simultaneouslyServer processes may use multiple threadsShare data and resources between process
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Windows 2000Windows 2000
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
UNIXUNIX
Hardware is surrounded by the operating-systemOperating system is called the kernelComes with a number of user services and interfaces
shellC compiler
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
UNIXUNIX
OS OverviewOS Overview © 2002 William Fornaciari© 2002 William Fornaciari
Modern UNIX SystemsModern UNIX Systems
System V Release 4 (SVR4)Solaris 2.x4.4BSDLinux
Top Related