chapter 02

67
1 Operating System Overview Chapter 2

Upload: akhil-vashishtha

Post on 02-Oct-2015

213 views

Category:

Documents


1 download

DESCRIPTION

OS

TRANSCRIPT

  • Operating System OverviewChapter 2

  • Operating SystemA program that controls the execution of application programsAn interface between applications and hardware

  • Operating System ObjectivesConvenienceMakes the computer more convenient to useEfficiencyAllows computer system resources to be used in an efficient mannerAbility to evolvePermit effective development, testing, and introduction of new system functions without interfering with service

  • Layers of Computer System

  • Services Provided by the Operating SystemProgram developmentEditors and debuggersProgram executionAccess to I/O devicesControlled access to filesSystem access

  • Services Provided by the Operating SystemError detection and responseInternal and external hardware errorsMemory errorDevice failureSoftware errorsArithmetic overflowAccess forbidden memory locationsOperating system cannot grant request of application

  • Services Provided by the Operating SystemAccountingCollect usage statisticsMonitor performanceUsed to anticipate future enhancementsUsed for billing purposes

  • Operating SystemResponsible for managing resourcesFunctions same way as ordinary computer softwareIt is program that is executedOperating system relinquishes control of the processor

  • KernelPortion of operating system that is in main memoryContains most frequently used functionsAlso called the nucleus

  • Evolution of an Operating SystemHardware upgrades plus new types of hardwareNew servicesFixes

  • Evolution of Operating SystemsSerial ProcessingNo operating systemMachines run from a console with display lights, toggle switches, input device, and printerSchedule timeSetup included loading the compiler, source program, saving compiled program, and loading and linking

  • Evolution of Operating SystemsSimple Batch SystemsMonitorsSoftware that controls the sequence of eventsBatch jobs togetherProgram branches back to monitor when finished

  • Job Control Language (JCL)Special type of programming languageProvides instruction to the monitorWhat compiler to useWhat data to use

  • Hardware FeaturesMemory protectionDo not allow the memory area containing the monitor to be alteredTimerPrevents a job from monopolizing the system

  • Hardware FeaturesPrivileged instructionsCertain machine level instructions can only be executed by the monitorInterruptsEarly computer models did not have this capability

  • Memory ProtectionUser program executes in user modeCertain instructions may not be executedMonitor executes in system modeKernel modePrivileged instructions are executedProtected areas of memory may be accessed

  • I/O Devices Slow

  • UniprogrammingProcessor must wait for I/O instruction to complete before preceding

  • MultiprogrammingWhen one job needs to wait for I/O, the processor can switch to the other job

  • Multiprogramming

  • Utilization Histograms

  • Example

  • Time SharingUsing multiprogramming to handle multiple interactive jobsProcessors time is shared among multiple usersMultiple users simultaneously access the system through terminals

  • Compatible Time-Sharing System (CTSS)First time-sharing system developed at MIT

  • Major AchievementsProcessesMemory ManagementInformation protection and securityScheduling and resource managementSystem structure

  • ProcessesA 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

  • Difficulties with Designing System SoftwareImproper synchronizationEnsure a process waiting for an I/O device receives the signalFailed mutual exclusionNondeterminate program operationProgram should only depend on input to it, not on the activities of other programsDeadlocks

  • ProcessConsists of three componentsAn executable programAssociated data needed by the programExecution context of the programAll information the operating system needs to manage the process

  • Process

  • Memory ManagementProcess isolationAutomatic allocation and managementSupport of modular programmingProtection and access controlLong-term storage

  • Virtual MemoryAllows programmers to address memory from a logical point of viewNo hiatus between the execution of successive processes while one process was written out to secondary store and the successor proceess was read in

  • Virtual Memory and File SystemImplements long-term storeInformation stored in named objects called files

  • PagingAllows 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

  • Virtual Memory

  • Virtual Memory Addressing

  • Information Protection and SecurityAvailabilityConcerned with protecting the system against interruptionConfidentialityAssuring that users cannot read data for which access is unauthorized

  • Information Protection and SecurityData integrityProtection of data from unauthorized modificationAuthenticityConcerned with the proper verification of the identity of users and the validity of messages or data

  • Scheduling and Resource ManagementFairnessGive equal and fair access to resourcesDifferential responsivenessDiscriminate among different classes of jobsEfficiencyMaximize throughput, minimize response time, and accommodate as many uses as possible

  • Key Elements ofOperating System

  • System StructureView 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

  • Process Hardware LevelsLevel 1Electronic circuitsObjects are registers, memory cells, and logic gatesOperations are clearing a register or reading a memory locationLevel 2Processors instruction setOperations such as add, subtract, load, and store

  • Process Hardware LevelsLevel 3Adds the concept of a procedure or subroutine, plus call/return operationsLevel 4Interrupts

  • Concepts with MultiprogrammingLevel 5Process as a program in executionSuspend and resume processesLevel 6Secondary storage devicesTransfer of blocks of dataLevel 7Creates logical address space for processesOrganizes virtual address space into blocks

  • Deal with External ObjectsLevel 8Communication of information and messages between processesLevel 9Supports long-term storage of named filesLevel 10Provides access to external devices using standardized interfaces

  • Deal with External ObjectsLevel 11Responsible for maintaining the association between the external and internal identifiersLevel 12Provides full-featured facility for the support of processesLevel 13Provides an interface to the operating system for the user

  • Modern Operating SystemsMicrokernel architectureAssigns only a few essential functions to the kernelAddress spacesInterprocess communication (IPC)Basic scheduling

  • Modern Operating SystemsMultithreadingProcess is divided into threads that can run concurrentlyThreadDispatchable unit of workexecutes sequentially and is interruptableProcess is a collection of one or more threads

  • Modern Operating SystemsSymmetric multiprocessing (SMP)There are multiple processorsThese processors share same main memory and I/O facilitiesAll processors can perform the same functions

  • Multiprogramming and Multiprocessing

  • Modern Operating SystemsDistributed operating systemsProvides the illusion of a single main memory space and single secondary memory space

  • Modern Operating SystemsObject-oriented designUsed for adding modular extensions to a small kernelEnables programmers to customize an operating system without disrupting system integrity

  • Windows ArchitectureModular structure for flexibilityExecutes on a variety of hardware platformsSupports application written for other operating system

  • Operating System OrganizationModified microkernel architectureNot a pure microkernel Many system functions outside of the microkernel run in kernel modeAny module can be removed, upgraded, or replaced without rewriting the entire system

  • Kernel-Mode ComponentsExecutiveContains base operating system servicesMemory managementProcess and thread managementSecurityI/OInterprocess communicationKernelConsists of the most used components

  • Kernel-Mode ComponentsHardware abstraction layer (HAL)Isolates the operating system from platform-specific hardware differencesDevice driversTranslate user I/O function calls into specific hardware device I/O requestsWindowing and graphics systemsImplements the graphical user interface (GUI)

  • Windows ExecutiveI/O managerCache managerObject managerPlug and play managerPower managerSecurity reference monitorVirtual memory managerProcess/thread managerConfiguration managerLocal procedure call (LPC) facility

  • User-Mode ProcessesSpecial system support processesEx: logon process and the session managerService processesEnvironment subsystemsUser applications

  • Client/Server ModelSimplifies the ExecutivePossible to construct a variety of APIsImproves reliabilityEach service runs on a separate process with its own partition of memoryClients cannot not directly access hardwareProvides a uniform means for applications to communicate via LPCProvides base for distributed computing

  • Threads and SMPOperating system routines can run on any available processorDifferent 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

  • Windows ObjectsEncapsulationObject consists of one or more data items and one or more proceduresObject class or instanceCreate specified instances of an objectInheritanceSupport to some extent in the ExecutivePolymorphism

  • UNIXHardware is surrounded by the operating system softwareOperating system is called the system kernelComes with a number of user services and interfacesShellComponents of the C compiler

  • UNIX

  • UNIX Kernel

  • Modern UNIX Kernel

  • Modern UNIX SystemsSystem V Release 4 (SVR4)Solaris 94.4BSDLinux