




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
計算機操作系統(tǒng)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(內(nèi)核):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(內(nèi)存保護):Userspaceandsystemspaceareindependent.E.g.Hardwarecandetectoutsideaccessingerror.Timerinterrupt(時鐘中斷):Whenthetimerexpires,aninterruptoccurs.Privilegedinstructions(特權(quán)指令):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(用戶數(shù)):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(區(qū)分服務):e.g.IfaprocessiswaitingfortheuseofanI/Odevice,theoperatingsystemmaywishtoschedulethatprocessforexecutionassoonaspossibleinordertofreeupthedeviceforlaterdemandsfromotherprocesses.Efficiency:Maximizethroughput(吞吐量),minimizeresponsetime,accommodate(容納)asmanyusersaspossibleShort-termqueueAlgorithmusedtouse:roundrobin(輪轉(zhuǎn))Long-termqueueAlgorithmusedtouse:FIFOInterrupthandler:themethodforgetthecontrolServicecallhandler(系統(tǒng)服務處理):theentrypointintotheoperatingsystemSomeConcepts(p67)Fig2.11KeyelementsofanOperatingSystemforMultiprogrammingServiceCallHandlerInterruptHandlerLong-termQueueShort-termQueueShort-TermSchedulerI/OqueueOSModules(模塊化)structure:onlysuitableforsmallsystem;forcomplexsystem,difficultfordebugHierarchical(層)structureLevelnprovidesserviceforleveln+1SystemStructure(p68系統(tǒng)結(jié)構(gòu))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(微內(nèi)核結(jié)構(gòu))1.4.2Multithreading(多線程)1.4.3Symmetricmultiprocess(對稱多處理)1.4.4Distributedoperatingsystems(分布式系統(tǒng))1.4.5Object-orienteddesign(對象設計)1.4CharacteristicsofModernOS(p71)Assignsonlyafewessential(必要的)functionstothekernel,includingaddressspaces,interprocesscommunication(IPC)(進程間通信),andbasicscheduling.Simplifiesimpl
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2020-2021深圳育才中學(初中)小學三年級數(shù)學下期末一模試卷帶答案
- 安裝鐵塔施工方案
- 2024年黑龍江大慶中考滿分作文《詩中誦出赤子心》
- 個人購銷合同范例范例
- 修路個人勞務合同范例
- 合伙餐廳合同范本
- 跨部門合作的工作計劃實例
- 鄉(xiāng)村樹苗銷售合同范例
- 學生自我管理與目標追蹤計劃
- 培養(yǎng)員工潛能與激勵方式計劃
- 勞務派遣勞務外包項目方案投標文件(技術(shù)方案)
- 2025年安全員C證(專職安全員)考試題庫
- 地理-天一大聯(lián)考2025屆高三四省聯(lián)考(陜晉青寧)試題和解析
- 2025年廣州市公安局招考聘用交通輔警200人高頻重點模擬試卷提升(共500題附帶答案詳解)
- 貴州省貴陽市2024-2025學年九年級上學期期末語文試題(含答案)
- 2025年江蘇海事職業(yè)技術(shù)學院高職單招職業(yè)適應性測試近5年??及鎱⒖碱}庫含答案解析
- 2024年尖葉菠菜種子項目可行性研究報告
- 計件工資計算表格模板
- 兩癌防治知識培訓
- 《moldflow學習資料》課件
- 2025中國移動安徽分公司春季社會招聘高頻重點提升(共500題)附帶答案詳解
評論
0/150
提交評論