计算机操作系统--Operating-System-OverviewPPT课件_第1页
计算机操作系统--Operating-System-OverviewPPT课件_第2页
计算机操作系统--Operating-System-OverviewPPT课件_第3页
计算机操作系统--Operating-System-OverviewPPT课件_第4页
计算机操作系统--Operating-System-OverviewPPT课件_第5页
已阅读5页,还剩47页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Chapter1OperatingSystemOverview,Contents,OperatingSystemObjectivesandFunctionsTheEvolutionofOperatingSystemMajorAchievementsCharacteristicsofModernOSExamples(NT、UNIX),1.1ObjectivesandFunctions(p45),1.1.1Overview1.1.2TheOperatingSystemasaUser/ComputerInterface1.1.3TheOperatingSystemasResourceManager1.1.4EaseofEvolutionofanOperatingSystem,Anoperatingsystemisaprogramthatmanagesthecomputer,controlstheexecutionofapplicationprogramsandactsasaninterface(接口)betweentheuserofacomputerandthecomputerhardware.ObjectivesConvenience(方便)Efficiency(有效)Abilitytoevolve(易扩展),1.1.1Overview,1.1.2OSasaUser/ComputerInterface(I),Figure2.1LayersandViewsofaComputerSystem,ComputerHardware,OperatingSystem,Utilities(Compiler,Database),ApplicationsPrograms,OperatingSystemDesigner,Programmers,EndUser,Theoperatingsystemmasks(隐藏)thedetailsofthehardwarefromtheprogrammer,andprovidestheprogrammerwithaconvenientinterfaceforusingthesystem.ThetypesofsysteminterfaceCommandinterface:systemcommand(internal、external)Graphicsinterface:windowsProgrammerinterface:systemcall,c-lib,OSasaUser/ComputerInterface(II),ServicesoftheOperatingSystem(I),ProgramcreationSuchas:fork(unix)、CreateProcess(win)ProgramexecutionSuchas:execl,execpAccesstoI/OdevicesSuchas:read/writeControlledaccesstofilesSuchas:read/write,ServicesoftheOperatingSystem(II),SystemaccessProvideprotectionandauthorizedErrordetectionandresponseSuchas:errorAccounting,1.1.3OSasResourceManager(I)(p47),TypesofResource:CPU、Memory、DevicesCPU:chapter.9.10Memory:chapter7.8I/ODevices:chapter11.12,OSasResourceManager(II),AsacontrolmechanismisunusualintworespectsTheOSfunctionsinthesamewayasordinarycomputersoftware;thatis,itisaprogramexecutedbytheprocessor.TheOSfrequentlyrelinquishescontrol(释放控制)andmustdependontheprocessortoallowittoregaincontrol(获取控制).,OSasResourceManager(IIIFigure2.2),ManagementofCPUManagementofI/ODeviceManagementofMemoryManagementofFilesConcept:Kernel、Nucleus(内核):Alwaysinmainmemory,containsthemost-frequently-usedfunctions,1.1.4EaseofEvolution(p49),ReasonsforevolutionhardwareupgradesExp:supportpagingnewservicesfixesImplementssoftwareengineering:modules、layer、objectdesign,1.2TheEvolutionofOperatingSystems,1.2.1SerialProcessing1.2.2SimpleBatchSystems1.2.3Multiprogrammed(多道)BatchSystems1.2.4Time-SharingSystems,1.2.1SerialProcessing(p50串行处理),ExampleInputCalculatePrintProblemsScheduling:TheestimatedtimeisnotaccurateSetuptime:Betweenthesetupprocedure,ifanerroroccurred,thenmustgobacktothebeginningofthesetupsequenceContradictionbetweenhumanandmachine,1.2.2SimpleBatchSystem,Objectives:SolutioncontradictionbetweenhumanandmachineUsersubmitsthejoboncardsortapetoacomputeroperator(useJCL(jobcontrollanguage)Implement:Monitor,FromthePointofViewoftheMonitor(p51),MonitorisresponsiblefortherunningofeveryjobControlsaretransferredbetweenmonitorandotheruserprograms,Interruptprocessing,DeviceDrivers,JobSequencing,ControlLanguageInterpreter,UserProgramArea,monitor,Memorylayoutforaresident(驻留)monitor,FromthePointofViewoftheProcessor,WhenCPUrunscommandofmonitor,themonitorgainsthecontrol.WhenCPUrunscommandofuserprogram,theuserprogramgainsthecontrol.Transferthecontrol:Firstmonitorgainsthecontrol,whenuserprogramloadin,itgainsthecontrol,whentheuserprogramfinishorerror,themonitorregains(重获)thecontrol.,JCL(JobControlLanguage),$JOB/begin$FTN/usingFortrancompileandlinkFortran/instructions$LOAD/loadinrunablemodules$RUN/running.$END/finishdothejob,OtherHardwareFeatureDesirable(p53),Memoryprotection(内存保护):Userspaceandsystemspaceareindependent.E.g.Hardwarecandetectoutsideaccessingerror.Timerinterrupt(时钟中断):Whenthetimerexpires,aninterruptoccurs.Privilegedinstructions(特权指令):Canbeexecutedonlybythemonitor.Interrupts:ImprovementefficiencyEasyforrelinquishing(释放)andregainingcontrol,1.2.3MultiprogrammedBatchSystems,Readonerecord0.0015secondsExecute100instructions0.0001secondsWriteonerecord0.0015secondsTOTAL0.0031secondsPercentCPUUtilization=0.0001/0.0031=3.2%Figure2.4SystemUtilizationExample,Uniprogramming(单道)haslowefficiency(效率):CPU-I/Ocontradiction,Multiprogramming/Multitasking,Therearemanyuserprogramsinthememory.HardwareneedforMultiprogramming.InterruptionForexample:p55Fig2.5,ExampleofMultiprogramming,256kavailablememoryNotes:notconsidertheresourcecompetition,Table2.1SampleProgramExecutionAttributes,Analysis,Analysis,SingleProcessoruse5/(5+15+10)=17%Memoryuse=(50*5+100*15+80*10)/256/30=33%Diskuse=10/30=33%Printeruse10/30=33%Totaltime5+15+1030Throughput6job/hourMeanresponsetime(5+20+30)/3=18,Analysis,MultiprogrammingProcessoruse5/15=33%Memoryuse=(50+100+80)*5+(100+80)*5+100*5/256/15=65%Diskuse=10/15=67%Printeruse10/15=67%Totaltime15Throughout12job/hourMeanresponsetime(5+10+15)/3=10,Sophisticated(复杂性)ofMultiprogramming(p57),MemorymanagementSchedulingAlgorithm(算法):Theprocessor(处理器)mustdecidewhichonetorun.,1.2.4Time-SharingSystems,Multipleuserssimultaneously(同时)accessthesystemthroughterminals(终端)Concepts:timeslice(时间片):qusernum(用户数):nresponsetime(响应时间):tt=nqMode:multi-terminals、multi-windows,BatchMultiprogrammingvsTimerSharing,ReducingtheSwappingLoadsbyPartialSwapping(p59),Reducingthespendingforaccessingdisk,1.3MajorAchievements(p60),1.3.1Processes(进程)1.3.2Memorymanagement1.3.3Informationprotectionandsecurity1.3.4Schedulingandresourcemanagement1.3.5Systemstructure,1.3.1Processes,AprograminexecutionTheanimatedspirit(活动精灵)ofaprogramTheentity(实体)thatcanbeassigned(分派)toandexecutedonaprocessorThreemajortypesofcomputersystemMultiprogrammingbatchoperationTimesharingReal-timetransaction(处理)systems,ErrorsMayHappeninMultiprogramming,Impropersynchronization(同步):Signalsbeinglostorduplicate(重复)signalsbeingreceived.Failedmutualexclusion(失败的互斥)Nondeterminate(不确定)programoperation:TheresultisnotuniqueDeadlocks(死锁)Tosolutetheseproblems,introduceprocessconcept,Processentity(实体),AnexecutableprogramTheassociateddataneededbytheprogramTheexecutioncontext(上下文)oftheprogram,ProcessImageandProcessSwitch(切换)(p63),1.3.2MemoryManagement,Processisolation(隔离)AutomaticallocationandmanagementSupportofmodular(模块化)programmingVirtuallymemoryLong-termstorageProtectionandaccesscontrol(访问控制),Fig2.10TwoViewsofaStorageSystem,VirtualProcessor,RealProcessor,Mapper(AddressTranslate),MainMemory,AuxiliaryMemory,VirtualMemory,Files,(a)UsersView,(b)OperatingSystemDesignersView,VirtualAddress,MemoryAddress,Swapping,Read,Write,Copy,Long-termStore,1.3.3InformationProtectionandSecurity,Accesscontrol:forvariousresourcesinthesystemInformationflowcontrol(信息流控):toguaranteethedatatosendtodestinationCertification(认证),1.3.4SchedulingandResourceManagement(p66),ThreefactorsmustbeconsiderFairnessDifferentialresponsiveness(区分服务):e.g.IfaprocessiswaitingfortheuseofanI/Odevice,theoperatingsystemmaywishtoschedulethatprocessforexecutionassoonaspossibleinordertofreeupthedeviceforlaterdemandsfromotherprocesses.Efficiency:Maximizethroughput(吞吐量),minimizeresponsetime,accommodate(容纳)asmanyusersaspossible,ShorttermqueueAlgorithmusedtouse:roundrobin(轮转)LongtermqueueAlgorithmusedtouse:FIFOInterrupthandler:themethodforgetthecontrolServicecallhandler(系统服务处理):theentrypointintotheoperatingsystem,SomeConcepts(p67),Fig2.11KeyelementsofanOperatingSystemforMultiprogramming,ServiceCallHandler,InterruptHandler,Long-termQueue,Short-termQueue,Short-TermScheduler,I/Oqueue,OS,Modules(模块化)structure:onlysuitableforsmallsystem;forcomplexsystem,difficultfordebugHierarchical(层)structureLevelnprovidesserviceforleveln+1,SystemStructure(p68系统结构),Hierarchy(Table2.4),LevelNameObjectsExampleOperations13ShellUserprogrammingStatementsinshelllanguageenvironment12UserprocessesUserprocessesQuit,kill,suspend,resume11DirectoriesDirectoriesCreate,destroy,attach,detach,search,list10DevicesExternaldevicesOpen,close,asprinter,displaysread,writeandkeyboards9FilesystemFilesCreate,destroy,open,closeread,write8CommunicationsPipesCreate,destroy,open,close,read,write,Hierarchy,LevelNameObjectsExampleOperations7VirtualMemorySegments,pagesRead,write,fetch6LocalsecondaryBlocksofdata,deviceRead,write,allocate,freestorechannels5PrimitiveprocessesPrimitiveprocess,Suspend,resume,wait,semaphores,readysignallist,Hierarchy(Hardware),LevelNameObjectsExampleOperations4InterruptsInterrupt-handlingInvoke,mask,unmask,retryprogramsProceduresProcedures,callstack,Markstack,call,returndisplay2InstructionSetEvaluationstack,micro-Load,store,add,subtractprograminterpreter,branchscalarandarraydata1ElectroniccircuitsRegisters,gates,buses,Clear,transfer,activate,plement,1.4.1Microkernelarchitecture(微内核结构)1.4.2Multithreading(多线程)1.4.3Symmetricmultiprocess(对称多处理)1.4.4Distributedoperatingsystems(分布式系统)1.4.5Object-orienteddesign(对象设计),1.4CharacteristicsofModernOS(p71),Assignsonlyafewessential(必要的)functionstothekernel,includingaddressspaces,interprocesscommunication(IPC)(进程间通信),andbasicscheduling.Simplifiesimplementation,providesflexibility(伸缩性)andwellsuitedtoadistributedenvironment.,1.4.1Microkernel,1.4.2Multithreading,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论