您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 操作系统-精髓与设计原理英文ppt-Chapter03
1ProcessDescriptionandControlChapter32RequirementsconcernedwithProcessesinanOperatingSystem•Interleavetheexecutionofmultipleprocessestomaximizeprocessorutilizationwhileprovidingreasonableresponsetime•Allocateresourcestoprocesses•Supportinterprocesscommunicationandusercreationofprocesses3Concepts•Computerplatformconsistsofacollectionofhardwareresources•Computerapplicationsaredevelopedtoperformsometask•Inefficientforapplicationstobewrittendirectlyforagivenhardwareplatform•Operatingsystemprovidesaconvenienttouse,featurerich,secure,andconsistentinterfaceforapplicationstouse•OSprovidesauniform,abstractrepresentationofresourcesthatcanberequestedandaccessedbyapplication4ManageExecutionofApplications•Resourcesaremadeavailabletomultipleapplications•Processorisswitchedamongmultiptleapplication•TheprocessorandI/Odevicescanbeusedefficiently5Process•Aprograminexecution•Aninstanceofaprogramrunningonacomputer•Theentitythatcanbeassignedtoandexecutedonaprocessor•Aunitofactivitycharacterizedbytheexecutionofasequenceofinstructions,acurrentstate,andanassociatedsetofsysteminstructions6ProcessElements•Identifier•State•Priority•Programcounter•Memorypointers•Contextdata•I/Ostatusinformation•Accountinginformation7ProcessControlBlock•Containstheprocesselements•Createdandmanagebytheoperatingsystem•Allowssupportformultipleprocesses8ProcessControlBlock9TraceofProcess•Sequenceofinstructionthatexecuteforaprocess•Dispatcher–Aprogramthatmovestheprocessorfromoneprocesstoanother–switchestheprocessorfromoneprocesstoanothertopreventasingleprocessfrommonopolizingtheprocessortime10TraceofProcesses1112ExampleExecution13Two-StateProcessModel•Processmaybeinoneoftwostates–Running–Not-running14Not-RunningProcessinaQueue15ProcessCreation16ProcessTermination17ProcessTermination18Processes•Not-running–readytoexecute•Blocked–waitingforI/O•Dispatchercannotjustselecttheprocessthathasbeeninthequeuethelongestbecauseitmaybeblocked19AFive-StateModel•Running•Ready•Blocked•New•Exit20Five-StateProcessModel21ProcessStates22UsingTwoQueues23MultipleBlockedQueues24SuspendedProcesses•ProcessorisfasterthanI/OsoallprocessescouldbewaitingforI/O•Swaptheseprocessestodisktofreeupmorememory•Blockedstatebecomessuspendstatewhenswappedtodisk•Twonewstates–Blocked/Suspend–Ready/Suspend25ReasonsforProcessSuspension26OneSuspendState27TwoSuspendStates28ProcessesandResources29OperatingSystemControlStructures•Informationaboutthecurrentstatusofeachprocessandresource•Tablesareconstructedforeachentitytheoperatingsystemmanages–memorytables–I/Otables–filetables–processtables3031MemoryTables•Allocationofmainmemorytoprocesses•Allocationofsecondarymemorytoprocesses•Protectionattributesforaccesstosharedmemoryregions•Informationneededtomanagevirtualmemory32I/OTables•I/Odeviceisavailableorassigned•StatusofI/Ooperation•LocationinmainmemorybeingusedasthesourceordestinationoftheI/Otransfer33FileTables•Existenceoffiles•Locationonsecondarymemory•CurrentStatus•Attributes•Sometimesthisinformationismaintainedbyafilemanagementsystem34ProcessTable•Whereprocessislocated•Attributesintheprocesscontrolblock•Program•Data•Stack35ProcessImage3637ProcessControlBlock•Processidentification•ProcessorStateInformation•ProcessControlInformation38ProcessControlBlock•ProcessidentificationNumericidentifiersthatmaybestoredwiththeprocesscontrolblockinclude–Identifierofthisprocess–Identifieroftheprocessthatcreatedthisprocess(parentprocess)–Useridentifier–Others39•ProcessorStateInformation–User-visibleregisters–Controlandstatusregisters–StackpointersProcessControlBlock40ProcessControlBlock•ProcessorStateInformation–User-VisibleRegisters•Auser-visibleregisterisonethatmaybereferencedbymeansofthemachinelanguagethattheprocessorexecuteswhileinusermode.Typically,therearefrom8to32oftheseregisters,althoughsomeRISCimplementationshaveover100.41ProcessControlBlock•ProcessorStateInformation–ControlandStatusRegistersTheseareavarietyofprocessorregistersthatareemployedtocontroltheoperationoftheprocessor.Theseinclude•Programcounter:Containstheaddressofthenextinstructiontobefetched•Programstatusword(PSW)–Conditioncodes:Resultofthemostrecentarithmeticorlogicaloperation(e.g.,sign,zero,carry,equal,overflow)–Statusinformation:Includesinterruptenabled/disabledflags,executionmode–Example:theEFLAGSregisteronPentiummachines42PentiumIIEFLAGSRegister4344ProcessControlBlock•ProcessorStateInformation–StackPointers•Eachprocesshasoneormorelast-in-first-out(LIFO)systemstacksassociatedwithit.Astackisusedtostoreparametersandcallingaddressesforprocedureandsystemcalls.Thestackpointerpointstothetopofthestack.45ProcessControlBlock•ProcessControlInformation–SchedulingandStateInformationThisisinformationthatisneededbytheoperatingsystemtoperformitsschedulingfunction.Typicalitemsofinformation:•Processstate:definesthereadinessoftheprocesstobescheduledforexecution(e.g.,running,ready,waiting,halted).•Priority:Oneormorefieldsmaybeusedtodescribetheschedulingpriorityoftheprocess.Insomesystems,severalvaluesarerequired(e.g.,default,current,highest-allowable)•Scheduling-relat
本文标题:操作系统-精髓与设计原理英文ppt-Chapter03
链接地址:https://www.777doc.com/doc-3356680 .html