版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
计算机操作系统OperatingSystemOverviewContentsOperatingSystemObjectivesandFunctionsTheEvolutionofOperatingSystemMajorAchievementsCharacteristicsofModernOSExamples(NT、UNIX)1.1ObjectivesandFunctions(p45)1.1.1Overview1.1.2TheOperatingSystemasaUser/ComputerInterface1.1.3TheOperatingSystemasResourceManager1.1.4EaseofEvolutionofanOperatingSystemAnoperatingsystemisaprogramthatmanagesthecomputer,controlstheexecutionofapplicationprogramsandactsasaninterface(接口)betweentheuserofacomputerandthecomputerhardware.ObjectivesConvenience(方便)Efficiency(有效)Abilitytoevolve(易扩展)1.1.1Overview1.1.2OSasaUser/ComputerInterface(I)Figure2.1LayersandViewsofaComputerSystemComputerHardwareOperatingSystemUtilities(Compiler,Database…)ApplicationsProgramsOperatingSystemDesignerProgrammersEndUserTheoperatingsystemmasks(隐藏)thedetailsofthehardwarefromtheprogrammer,andprovidestheprogrammerwithaconvenientinterfaceforusingthesystem.ThetypesofsysteminterfaceCommandinterface:systemcommand(internal、external)Graphicsinterface:windowsProgrammerinterface:systemcall,c-libOSasaUser/ComputerInterface(II)ServicesoftheOperatingSystem(I)ProgramcreationSuchas:fork(unix)、CreateProcess(win)ProgramexecutionSuchas:execl,execpAccesstoI/OdevicesSuchas:read/writeControlledaccesstofilesSuchas:read/writeServicesoftheOperatingSystem(II)SystemaccessProvideprotectionandauthorizedErrordetectionandresponseSuchas:errorAccounting1.1.3OSasResourceManager(I)(p47)TypesofResource:CPU、Memory、DevicesOSasResourceManager(II)AsacontrolmechanismisunusualintworespectsTheOSfunctionsinthesamewayasordinarycomputersoftware;thatis,itisaprogramexecutedbytheprocessor.TheOSfrequentlyrelinquishescontrol(释放控制)andmustdependontheprocessortoallowittoregaincontrol(获取控制).OSasResourceManager(IIIFigure2.2)ManagementofCPUManagementofI/ODeviceManagementofMemoryManagementofFilesConcept:Kernel、Nucleus(内核):Alwaysinmainmemory,containsthemost-frequently-usedfunctions1.1.4EaseofEvolution(p49)ReasonsforevolutionhardwareupgradesExp:supportpagingnewservicesfixesImplementssoftwareengineering:modules、layer、objectdesign1.2TheEvolutionofOperatingSystems1.2.1SerialProcessing1.2.2SimpleBatchSystems1.2.3Multiprogrammed(多道)BatchSystems1.2.4Time-SharingSystems1.2.1SerialProcessing(p50串行处理)ExampleInputCalculatePrintProblemsScheduling:TheestimatedtimeisnotaccurateSetuptime:Betweenthesetupprocedure,ifanerroroccurred,thenmustgobacktothebeginningofthesetupsequenceContradictionbetweenhumanandmachine1.2.2SimpleBatchSystemObjectives:SolutioncontradictionbetweenhumanandmachineUsersubmitsthejoboncardsortapetoacomputeroperator(useJCL(jobcontrollanguage))Implement:MonitorFromthePointofViewoftheMonitor(p51)MonitorisresponsiblefortherunningofeveryjobControlsaretransferredbetweenmonitorandotheruserprogramsInterruptprocessingDeviceDriversJobSequencingControlLanguageInterpreterUserProgramAreamonitorMemorylayoutforaresident(驻留)monitorFromthePointofViewoftheProcessorWhenCPUrunscommandofmonitor,themonitorgainsthecontrol.WhenCPUrunscommandofuserprogram,theuserprogramgainsthecontrol.Transferthecontrol:Firstmonitorgainsthecontrol,whenuserprogramloadin,itgainsthecontrol,whentheuserprogramfinishorerror,themonitorregains(重获)thecontrol.JCL(JobControlLanguage)$JOB//begin$FTN//usingFortrancompileandlink…Fortran//instructions$LOAD//loadinrunablemodules$RUN//running.$END//finishdothejobOtherHardwareFeatureDesirable(p53)Memoryprotection(内存保护):Userspaceandsystemspaceareindependent.E.g.Hardwarecandetectoutsideaccessingerror.Timerinterrupt(时钟中断):Whenthetimerexpires,aninterruptoccurs.Privilegedinstructions(特权指令):Canbeexecutedonlybythemonitor.Interrupts:ImprovementefficiencyEasyforrelinquishing(释放)andregainingcontrol1.2.3MultiprogrammedBatchSystemsReadonerecord 0.0015secondsExecute100instructions 0.0001secondsWriteonerecord 0.0015secondsTOTAL 0.0031secondsFigure2.4SystemUtilizationExampleUniprogramming(单道)haslowefficiency(效率):CPUI/OcontradictionMultiprogramming/MultitaskingTherearemanyuserprogramsinthememory.HardwareneedforMultiprogramming.InterruptionExampleofMultiprogramming256kavailablememoryNotes:notconsidertheresourcecompetitionJOB1JOB2JOB3TypeofJOBHeavyComputerHeavyI/OHeavyI/ODuration5min15min10minMemoryrequired50k100k80kNeeddiskNoNoYesNeedterminalNoYesNoNeedprinterNoNoYesTable2.1SampleProgramExecutionAttributesAnalysisAnalysisSingleProcessoruse=5/(5+15+10)=17%Memoryuse=[(50*5+100*15+80*10)/256/30]=33%Diskuse=10/30=33%Printeruse=10/30=33%Totaltime=5+15+10=30Throughput=6job/hourMeanresponsetime=(5+20+30)/3=18AnalysisMultiprogrammingProcessoruse=5/15=33%Memoryuse=[(50+100+80)*5+(100+80)*5+100*5]/256/15=65%Diskuse=10/15=67%Printeruse=10/15=67%Totaltime=15Throughout=12job/hourMeanresponsetime=(5+10+15)/3=10Sophisticated(复杂性)ofMultiprogramming(p57)MemorymanagementSchedulingAlgorithm(算法):Theprocessor(处理器)mustdecidewhichonetorun.1.2.4Time-SharingSystemsMultipleuserssimultaneously(同时)accessthesystemthroughterminals(终端)Concepts:timeslice(时间片):qusernum(用户数):nresponsetime(响应时间):tt=n×qMode:multi-terminals、multi-windowsBatchMultiprogrammingvsTimerSharingBatchMultiprogramming
TimeSharing
Principalobjective
Maximizeprocessoruse
Minimizeresponsetime
Sourceofinstructiontooperatingsystem
Jobcontrollanguagecommandsprovidedwiththejob
Commandsenteredattheterminal
ReducingtheSwappingLoadsbyPartialSwapping(p59)Reducingthespendingforaccessingdisk1.3MajorAchievements(p60)1.3.1Processes(进程)1.3.2Memorymanagement1.3.3Informationprotectionandsecurity1.3.4Schedulingandresourcemanagement1.3.5Systemstructure1.3.1ProcessesAprograminexecutionTheanimatedspirit(活动精灵)ofaprogramTheentity(实体)thatcanbeassigned(分派)toandexecutedonaprocessorThreemajortypesofcomputersystemMultiprogrammingbatchoperationTimesharingReal-timetransaction(处理)systemsErrorsMayHappeninMultiprogrammingImpropersynchronization(同步):Signalsbeinglostorduplicate(重复)signalsbeingreceived.Failedmutualexclusion(失败的互斥)Nondeterminate(不确定)programoperation:TheresultisnotuniqueDeadlocks(死锁)Tosolutetheseproblems,introduceprocessconcept
Processentity(实体)AnexecutableprogramTheassociateddataneededbytheprogramTheexecutioncontext(上下文)oftheprogramProcessImageandProcessSwitch(切换)(p63)1.3.2MemoryManagementProcessisolation(隔离)AutomaticallocationandmanagementSupportofmodular(模块化)programmingVirtuallymemoryLong-termstorageProtectionandaccesscontrol(访问控制)Fig2.10TwoViewsofaStorageSystemVirtualProcessorRealProcessorMapper(AddressTranslate)MainMemoryAuxiliaryMemoryVirtualMemoryFiles(a)User’sView(b)OperatingSystemDesigner’sViewVirtualAddressMemoryAddressSwappingRead,WriteCopyLong-termStore1.3.3InformationProtectionandSecurityAccesscontrol:forvariousresourcesinthesystemInformationflowcontrol(信息流控):toguaranteethedatatosendtodestinationCertification(认证)1.3.4SchedulingandResourceManagement(p66)ThreefactorsmustbeconsiderFairnessDifferentialresponsiveness(区分服务):e.g.IfaprocessiswaitingfortheuseofanI/Odevice,theoperatingsystemmaywishtoschedulethatprocessforexecutionassoonaspossibleinordertofreeupthedeviceforlaterdemandsfromotherprocesses.Efficiency:Maximizethroughput(吞吐量),minimizeresponsetime,accommodate(容纳)asmanyusersaspossibleShort-termqueueAlgorithmusedtouse:roundrobin(轮转)Long-termqueueAlgorithmusedtouse:FIFOInterrupthandler:themethodforgetthecontrolServicecallhandler(系统服务处理):theentrypointintotheoperatingsystemSomeConcepts(p67)Fig2.11KeyelementsofanOperatingSystemforMultiprogrammingServiceCallHandlerInterruptHandlerLong-termQueueShort-termQueueShort-TermSchedulerI/OqueueOSModules(模块化)structure:onlysuitableforsmallsystem;forcomplexsystem,difficultfordebugHierarchical(层)structureLevelnprovidesserviceforleveln+1SystemStructure(p68系统结构)Hierarchy(Table2.4)Level Name Objects ExampleOperations13 Shell Userprogramming Statementsinshelllanguage environment12 Userprocesses Userprocesses Quit,kill,suspend,resume11 Directories Directories Create,destroy,attach,detach, search,list10 Devices Externaldevices Open,close, asprinter,displays read,write
andkeyboards9 Filesystem Files Create,destroy,open,close
read,write8 Communications Pipes Create,destroy,open,close,
read,writeHierarchyLevel Name Objects ExampleOperations7 VirtualMemory Segments,pages Read,write,fetch6 Localsecondary Blocksofdata,device Read,write,allocate,free
store channels5 PrimitiveprocessesPrimitiveprocess, Suspend,resume,wait, semaphores,ready
signal list
Hierarchy(Hardware)Level Name Objects ExampleOperations4 Interrupts Interrupt-handling Invoke,mask,unmask,retry programs
Procedures Procedures,callstack, Markstack,call,return display2 InstructionSet Evaluationstack,micro- Load,store,add,subtract programinterpreter, branch scalarandarraydata1 Electroniccircuits Registers,gates,buses, Clear,transfer,activate, etc. complement1.4.1Microkernelarchitecture(微内核结构)1.4.2Multithreading(多线程)1.4.3Symmetricmultiprocess(对称多处理)1.4.4Distributedoperatingsystems(分布式系统)1.4.5Object-orienteddesign(对象设计)1.4CharacteristicsofModernOS(p71)Assignsonlyafewessential(必要的)functionstothekernel,includingaddressspaces,interprocesscommunication(IPC)(进程间通信),andbasicscheduling.Simplifiesimpl
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 21年环境影响评价工程师考试真题7章
- 2021-2022学年吉林省高中学校物理高一下期末复习检测试题含解析
- 2021-2022学年湖南省永州市祁阳县第一中学物理高一下期末综合测试模拟试题含解析
- 2021-2022学年湖南明德中学物理高一第二学期期末监测模拟试题含解析
- 福建省龙岩市第四中学2023-2024学年高三上学期第一次质量检测数学试题(无答案)
- 外研新版七年级下册《Module 10 A holiday journey Unit 3 Language in use》同步练习卷
- 外研新版八年级下册《完阅专项中考特训》同步练习卷
- 人教新版九年级下册《第12章 化学与生活》单元测试卷(三)
- 地理中考人教版模拟题库
- 人教版鸿门宴教学设计教学反思
- 《脚背正面踢球》教学课件
- 2023学年完整公开课版月光曲教学
- 人教版四年级上册数学教学工作计划范本(2篇)
- 国开幼儿园课程与活动设计自测练习(1-6章)试题及答案
- 新疆喀什地区地直机关遴选公务员53人3511笔试题库含答案解析
- (沪科版)《因式分解》参考教案
- 简易的劳动合同范本(劳动合同范本)
- 高一音乐 人民音乐家-聂耳 上课教学设计
- IPQC巡检记录表模板
- 一年级上册《快乐读书吧:读书真快乐》教学设计
- 2023年云南交投集团招聘笔试题库及答案解析
评论
0/150
提交评论