計算機系統結構2英文課件_第1頁
計算機系統結構2英文課件_第2頁
計算機系統結構2英文課件_第3頁
計算機系統結構2英文課件_第4頁
計算機系統結構2英文課件_第5頁
已閱讀5頁,還剩89頁未讀 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst1Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst2CommonSystemComponentsProcessManagementMainMemoryManagementSecondary-StorageManagementI/OSystemManagementFileManagementProtectionSystemNetworkingCommand-InterpreterSystemCommonSystemComponentsProces3ProcessManagementAprocessisaprograminexecution.Aprocessneedscertainresources,includingCPUtime,memory,files,andI/Odevices,toaccomplishitstask.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionwithprocessmanagement.

在同進程管理有關的活動中,操作系統負責下列事務Pcesssuspensionandresumption.

Provisionofmechanismsfor

processsynchronizationprocesscommunicationProcessManagementAprocessis4Main-MemoryManagementMemoryisalargearrayofwordsorbytes,eachwithitsownaddress.Itisarepository

ofquicklyaccessibledatasharedbytheCPUandI/Odevices.Mainmemoryisavolatile

storagedevice.Itlosesitscontentsinthecaseofsystemfailure.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswithmemorymanagement:Keeptrackofwhichpartsofmemoryarecurrentlybeingusedandbywhom.Decidewhichprocessestoloadwhenmemoryspacebecomesavailable.Allocateanddeallocatememoryspaceasneeded.Main-MemoryManagementMemoryi5Secondary-StorageManagementSincemainmemory(primarystorage)isvolatileandtoosmalltoaccommodatealldataandprogramspermanently,thecomputersystemmustprovidesecondarystoragetobackupmainmemory.Mostmoderncomputersystemsusedisksastheprincipleon-linestoragemedium,forbothprogramsanddata.TheoperatingsystemisresponsibleforthefollowingactivitiesinconnectionwithdiskmanagementFreespacemanagementStorageallocationDiskschedulingSecondary-StorageManagementSi6I/OSystemManagementTheI/Osystemconsistsof:Abuffer-cachingsystemAgeneraldevice-driverinterfaceDriversforspecifichardwaredevicesI/OSystemManagementTheI/Os7FileManagementAfileisacollectionofrelatedinformationdefinedbyitscreator.Commonly,filesrepresentprograms(bothsourceandobjectforms)anddata.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswithfilemanagement:Filecreationanddeletion.Directorycreationanddeletion.Supportofprimitives原語formanipulatingfilesanddirectories.Mappingfilesontosecondarystorage.Filebackuponstable(nonvolatile)storagemedia.FileManagementAfileisacol8ProtectionSystemProtectionreferstoamechanismforcontrollingaccessbyprograms,processes,oruserstobothsystemanduserresources.Tvideameansofenforcement.

ProtectionSystemProtectionre9Networking(DistributedSystems)Adistributedsystemisacollectionprocessorsthatdonotsharememoryoraclock.Eachprocessorhasitsownlocalmemory.Theprocessorsinthesystemareconnectedthroughacommunicationnetwork.Adistributedsystemprovidesuseraccesstovarioussystemresources.Accesstoasharedresourceallows:Computationspeed-up加速運算Increaseddataavailability提高數據利用性Enhancedreliability增強可靠性Networking(DistributedSystem10Command-InterpreterSystemManycommandsaregiventotheoperatingsystembycontrolstatementswhichdealwith:processcreationandmanagementI/Ohandlingsecondary-storagemanagementmain-memorymanagementfile-systemaccessprotectionnetworkingCommand-InterpreterSystemMany11Command-InterpreterSystem(Cont.)Theprogramthatreadsandinterpretscontrolstatementsiscalledvariously:control-cardinterpreter

command-lineinterpreter

shell(inUNIX)Itsfunctionistogetandexecutethenextcommandstatement.Command-InterpreterSystem(Co12Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst13OperatingSystemServicesProgramexecution

–systemcapabilitytoloadaprogramintomemoryandtorunit.I/Ooperations

–sinceuserprogramscannotexecuteI/Ooperationsdirectly,theoperatingsystemmustprovidesomemeanstoperformI/O.File-systemmanipulation

–programcapabilitytoread,write,create,anddeletefiles.Communications

–exchangeofinformationbetweenprocessesexecutingeitheronthesamecomputerorondifferentsystemstiedtogetherbyanetwork.Implementedviasharedmemoryormessagepassing.Errordetection

–ensurecorrectcomputingbydetectingerrorsintheCPUandmemoryhardware,inI/Odevices,orinuserprograms.OperatingSystemServicesProgr14AdditionalOperatingSystemFunctionsAdditionalfunctionsexistnotforhelpingtheuser,butratherforensuringefficientsystemoperations.Resourceallocation

–allocatingresourcestomultipleusersormultiplejobsrunningatthesametime.Accounting

–keeptrackofandrecordwhichusersusehowmuchandwhatkindsofcomputerresourcesforaccountbillingorforaccumulatingusagestatistics.Protection

–ensuringthatallaccesstosystemresourcesiscontrolled.AdditionalOperatingSystemFu15SystemCallsSystemcallsprovidetheinterfacebetweenarunningprogramandtheoperatingsystem.Generallyavailableasassembly-languageinstructions.LanguagesdefinedtoreplaceassemblylanguageforsystemsprogrammingallowsystemcallstobemadedirectlyThreegeneralmethodsareusedtopassparametersbetweenarunningprogramandtheoperatingsystem.Passparametersinregisters.Storetheparametersinatableinmemory,andthetableaddressispassedasaparameterinaregister.Push(store)theparametersontothestackbytheprogram,andpopoffthestackbyoperatingsystem.SystemCallsSystemcallsprovi16PassingofParametersAsATable

表格方式的參數傳遞PassingofParametersAsATab17Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst18SystemCalls(Cont.)ProcesscontrolFilemanagementDevicemanagementInformationmaintenanceCommunicationsSystemCalls(Cont.)Processco19SystemCall

——processcontrolend,abortload,executecreateprocess,terminateprocessgetprocessattributes,setprocessattributeswaitfortimewaitevent,signaleventAllocateandfreememorySystemCall

20MS-DOSExecutionAtSystemStart-up系統啟動RunningaProgram運行程序MS-DOSExecutionAtSystemStar21UNIXRunningMultipleProgramsUNIXRunningMultiplePrograms22SystemCall

——filemanagementcreatefile,deletefileopen,closeread,write,repositiongetfileattributes,setfileattributesSystemCall

23SystemCall

——devicemanagementrequestdevice,releasedeviceread,write,repositiongetdeviceattributes,setdeviceattributeslogicallyattachordetachdevicesSystemCall

—24SystemCall

——informationmanagementgettimeordate,settimeordategetsystemdata,setsystemdatagetprocess,file,ordeviceattributessetprocess,file,ordeviceattributesSystemCall

——inform25SystemCall

——communicationscreate,deletecommunicationconnectionsend,receivemessagestransferstatusinformationattachordetachremotedevicesSystemCall

26CommunicationModelsMsgPassingSharedMemoryCommunicationModelsMsgPassin27Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst28SystemProgramsSystemprogramsprovideaconvenientenvironmentforprogramdevelopmentandexecution.Theycanbedividedinto:FilemanipulationStatusinformationFilemodificationProgramminglanguagesupportProgramloadingandexecutionCommunicationsApplicationprogramsSystemProgramsSystemprograms29Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst30SystemStructure–LayeredApproachTheoperatingsystemisdividedintoanumberoflayers(levels),eachbuiltontopoflowerlayers.Thebottomlayer(layer0),isthehardware;thehighest(layerN)istheuserinterface.Withmodularity,layersareselectedsuchthateachusesfunctions(operations)andservicesofonlylower-levellayers.SystemStructure–LayeredApp31AnOperatingSystemLayerAnOperatingSystemLayer32LayeredStructureoftheTHEOSAlayereddesignwasfirstusedinTHEoperatingsystem.

Itssixlayersareasfollows:LayeredStructureoftheTHEO33MicrokernelsWindowsNTClient-ServerStructureMicrokernelsWindowsNTClient-34Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst35VirtualMachinesAvirtualmachinetakesthelayeredapproachtoitslogicalconclusion.Ittreatshardwareandtheoperatingsystemkernelasthoughtheywereallhardware.虛擬機是層次化的邏輯結果Avirtualmachineprovidesaninterfaceidenticaltotheunderlyingbarehardware.Theoperatingsystemcreatestheillusionofmultipleprocesses,eachexecutingonitsownprocessorwithitsown(virtual)memory.操作系統創建了多個進程,每個進程在其處理器和(虛擬)內存執行VirtualMachinesAvirtualmach36VirtualMachines(Cont.)Theresourcesofthephysicalcomputeraresharedtocreatethevirtualmachines.CPUschedulingcancreatetheappearancethatusershavetheirownprocessor.Spoolingandafilesystemcanprovidevirtualcardreadersandvirtuallineprinters.Anormalusertime-sharingterminalservesasthevirtualmachineoperator’sconsole.

普通用戶終端成為虛擬機操作員的控制臺VirtualMachines(Cont.)There37SystemModelsNon-virtualMachineVirtualMachineSystemModelsNon-virtualMachi38Advantages/DisadvantagesofVirtualMachinesThevirtual-machineconceptprovidescompleteprotectionofsystemresourcessinceeachvirtualmachineisisolatedfromallothervirtualmachines.Avirtual-machinesystemisaperfectvehicleforoperating-systemsresearchanddevelopment.Systemdevelopmentisdoneonthevirtualmachine,insteadofonaphysicalmachineandsodoesnotdisruptnormalsystemoperation.Thevirtualmachineconceptisdifficulttoimplementduetotheeffortrequiredtoprovideanexact

duplicatetotheunderlyingmachine.Advantages/DisadvantagesofVi39TheJavaVirtualMachineTheJavaVirtualMachine40Java.classFileonCrossPlatforms

跨平臺的Java.class文件Java.classFileonCrossPlat41JavaDevelopmentEnvironmentJavaDevelopmentEnvironment42Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst43SystemDesignGoalsUsergoals–operatingsystemshouldbeconvenienttouse,easytolearn,reliable,safe,andfast.Systemgoals–operatingsystemshouldbeeasytodesign,implement,andmaintain,aswellasflexible,reliable,error-free,andefficient.SystemDesignGoalsUsergoals44MechanismsandPoliciesMechanismsdeterminehowtodosomething,policiesdecidewhatwillbedone.

機制確定怎樣做,策略決定要做什么Theseparationofpolicyfrommechanismisaveryimportantprinciple,itallowsmaximumflexibilityifpolicydecisionsaretobechangedlater.MechanismsandPoliciesMechani45SystemImplementationTraditionallywritteninassemblylanguage,operatingsystemscannowbewritteninhigher-levellanguages.Codewritteninahigh-levellanguage:canbewrittenfaster.ismorecompact.iseasiertounderstandanddebug.Anoperatingsystemisfareasiertoport(movetosomeotherhardware)ifitiswritteninahigh-levellanguage.SystemImplementationTradition46HomeworkP83

33.15HomeworkP8347Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst48Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst49CommonSystemComponentsProcessManagementMainMemoryManagementSecondary-StorageManagementI/OSystemManagementFileManagementProtectionSystemNetworkingCommand-InterpreterSystemCommonSystemComponentsProces50ProcessManagementAprocessisaprograminexecution.Aprocessneedscertainresources,includingCPUtime,memory,files,andI/Odevices,toaccomplishitstask.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionwithprocessmanagement.

在同進程管理有關的活動中,操作系統負責下列事務Pcesssuspensionandresumption.

Provisionofmechanismsfor

processsynchronizationprocesscommunicationProcessManagementAprocessis51Main-MemoryManagementMemoryisalargearrayofwordsorbytes,eachwithitsownaddress.Itisarepository

ofquicklyaccessibledatasharedbytheCPUandI/Odevices.Mainmemoryisavolatile

storagedevice.Itlosesitscontentsinthecaseofsystemfailure.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswithmemorymanagement:Keeptrackofwhichpartsofmemoryarecurrentlybeingusedandbywhom.Decidewhichprocessestoloadwhenmemoryspacebecomesavailable.Allocateanddeallocatememoryspaceasneeded.Main-MemoryManagementMemoryi52Secondary-StorageManagementSincemainmemory(primarystorage)isvolatileandtoosmalltoaccommodatealldataandprogramspermanently,thecomputersystemmustprovidesecondarystoragetobackupmainmemory.Mostmoderncomputersystemsusedisksastheprincipleon-linestoragemedium,forbothprogramsanddata.TheoperatingsystemisresponsibleforthefollowingactivitiesinconnectionwithdiskmanagementFreespacemanagementStorageallocationDiskschedulingSecondary-StorageManagementSi53I/OSystemManagementTheI/Osystemconsistsof:Abuffer-cachingsystemAgeneraldevice-driverinterfaceDriversforspecifichardwaredevicesI/OSystemManagementTheI/Os54FileManagementAfileisacollectionofrelatedinformationdefinedbyitscreator.Commonly,filesrepresentprograms(bothsourceandobjectforms)anddata.Theoperatingsystemisresponsibleforthefollowingactivitiesinconnectionswithfilemanagement:Filecreationanddeletion.Directorycreationanddeletion.Supportofprimitives原語formanipulatingfilesanddirectories.Mappingfilesontosecondarystorage.Filebackuponstable(nonvolatile)storagemedia.FileManagementAfileisacol55ProtectionSystemProtectionreferstoamechanismforcontrollingaccessbyprograms,processes,oruserstobothsystemanduserresources.Tvideameansofenforcement.

ProtectionSystemProtectionre56Networking(DistributedSystems)Adistributedsystemisacollectionprocessorsthatdonotsharememoryoraclock.Eachprocessorhasitsownlocalmemory.Theprocessorsinthesystemareconnectedthroughacommunicationnetwork.Adistributedsystemprovidesuseraccesstovarioussystemresources.Accesstoasharedresourceallows:Computationspeed-up加速運算Increaseddataavailability提高數據利用性Enhancedreliability增強可靠性Networking(DistributedSystem57Command-InterpreterSystemManycommandsaregiventotheoperatingsystembycontrolstatementswhichdealwith:processcreationandmanagementI/Ohandlingsecondary-storagemanagementmain-memorymanagementfile-systemaccessprotectionnetworkingCommand-InterpreterSystemMany58Command-InterpreterSystem(Cont.)Theprogramthatreadsandinterpretscontrolstatementsiscalledvariously:control-cardinterpreter

command-lineinterpreter

shell(inUNIX)Itsfunctionistogetandexecutethenextcommandstatement.Command-InterpreterSystem(Co59Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst60OperatingSystemServicesProgramexecution

–systemcapabilitytoloadaprogramintomemoryandtorunit.I/Ooperations

–sinceuserprogramscannotexecuteI/Ooperationsdirectly,theoperatingsystemmustprovidesomemeanstoperformI/O.File-systemmanipulation

–programcapabilitytoread,write,create,anddeletefiles.Communications

–exchangeofinformationbetweenprocessesexecutingeitheronthesamecomputerorondifferentsystemstiedtogetherbyanetwork.Implementedviasharedmemoryormessagepassing.Errordetection

–ensurecorrectcomputingbydetectingerrorsintheCPUandmemoryhardware,inI/Odevices,orinuserprograms.OperatingSystemServicesProgr61AdditionalOperatingSystemFunctionsAdditionalfunctionsexistnotforhelpingtheuser,butratherforensuringefficientsystemoperations.Resourceallocation

–allocatingresourcestomultipleusersormultiplejobsrunningatthesametime.Accounting

–keeptrackofandrecordwhichusersusehowmuchandwhatkindsofcomputerresourcesforaccountbillingorforaccumulatingusagestatistics.Protection

–ensuringthatallaccesstosystemresourcesiscontrolled.AdditionalOperatingSystemFu62SystemCallsSystemcallsprovidetheinterfacebetweenarunningprogramandtheoperatingsystem.Generallyavailableasassembly-languageinstructions.LanguagesdefinedtoreplaceassemblylanguageforsystemsprogrammingallowsystemcallstobemadedirectlyThreegeneralmethodsareusedtopassparametersbetweenarunningprogramandtheoperatingsystem.Passparametersinregisters.Storetheparametersinatableinmemory,andthetableaddressispassedasaparameterinaregister.Push(store)theparametersontothestackbytheprogram,andpopoffthestackbyoperatingsystem.SystemCallsSystemcallsprovi63PassingofParametersAsATable

表格方式的參數傳遞PassingofParametersAsATab64Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst65SystemCalls(Cont.)ProcesscontrolFilemanagementDevicemanagementInformationmaintenanceCommunicationsSystemCalls(Cont.)Processco66SystemCall

——processcontrolend,abortload,executecreateprocess,terminateprocessgetprocessattributes,setprocessattributeswaitfortimewaitevent,signaleventAllocateandfreememorySystemCall

67MS-DOSExecutionAtSystemStart-up系統啟動RunningaProgram運行程序MS-DOSExecutionAtSystemStar68UNIXRunningMultipleProgramsUNIXRunningMultiplePrograms69SystemCall

——filemanagementcreatefile,deletefileopen,closeread,write,repositiongetfileattributes,setfileattributesSystemCall

70SystemCall

——devicemanagementrequestdevice,releasedeviceread,write,repositiongetdeviceattributes,setdeviceattributeslogicallyattachordetachdevicesSystemCall

—71SystemCall

——informationmanagementgettimeordate,settimeordategetsystemdata,setsystemdatagetprocess,file,ordeviceattributessetprocess,file,ordeviceattributesSystemCall

——inform72SystemCall

——communicationscreate,deletecommunicationconnectionsend,receivemessagestransferstatusinformationattachordetachremotedevicesSystemCall

73CommunicationModelsMsgPassingSharedMemoryCommunicationModelsMsgPassin74Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst75SystemProgramsSystemprogramsprovideaconvenientenvironmentforprogramdevelopmentandexecution.Theycanbedividedinto:FilemanipulationStatusinformationFilemodificationProgramminglanguagesupportProgramloadingandexecutionCommunicationsApplicationprogramsSystemProgramsSystemprograms76Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst77SystemStructure–LayeredApproachTheoperatingsystemisdividedintoanumberoflayers(levels),eachbuiltontopoflowerlayers.Thebottomlayer(layer0),isthehardware;thehighest(layerN)istheuserinterface.Withmodularity,layersareselectedsuchthateachusesfunctions(operations)andservicesofonlylower-levellayers.SystemStructure–LayeredApp78AnOperatingSystemLayerAnOperatingSystemLayer79LayeredStructureoftheTHEOSAlayereddesignwasfirstusedinTHEoperatingsystem.

Itssixlayersareasfollows:LayeredStructureoftheTHEO80MicrokernelsWindowsNTClient-ServerStructureMicrokernelsWindowsNTClient-81Chapter3

Operating-SystemStructuresSystemComponentsOperatingSystemServicesSystemCallsSystemProgramsSystemStructureVirtualMachinesSystemDesignandImplementationChapter3

Operating-Syst82VirtualMachinesAvirtualmachinetakesthelayeredapproachtoitslogicalconclusion.Ittreatshardwareandtheoperatingsystemkernelasthoughtheywereallhardware.虛擬機是層次化的邏輯結果Avirtualmachineprovidesaninterfaceidenticaltotheunderlyingbarehardware.Theoperatingsystemcreatestheillusionofmultipleprocesses,eachexecutingonitsownprocessorwithitsown(virtual)memory.操作系統創建了多個進程,每個進程在其處理器和(虛擬)內存執行VirtualMachinesAvirt

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論