版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
計算機(jī)操作系統(tǒng)OperatingSystemOverviewContentsOperatingSystemObjectivesandFunctionsTheEvolutionofOperatingSystemMajorAchievementsCharacteristicsofModernOSExamples(NT、UNIX)1.1ObjectivesandFunctions(p45)1.1.1Overview1.1.2TheOperatingSystemasaUser/ComputerInterface1.1.3TheOperatingSystemasResourceManager1.1.4EaseofEvolutionofanOperatingSystemAnoperatingsystemisaprogramthatmanagesthecomputer,controlstheexecutionofapplicationprogramsandactsasaninterface(接口)betweentheuserofacomputerandthecomputerhardware.ObjectivesConvenience(方便)Efficiency(有效)Abilitytoevolve(易擴(kuò)展)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)存保護(hù)):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(復(fù)雜性)ofMultiprogramming(p57)MemorymanagementSchedulingAlgorithm(算法):Theprocessor(處理器)mustdecidewhichonetorun.1.2.4Time-SharingSystemsMultipleuserssimultaneously(同時)accessthesystemthroughterminals(終端)Concepts:timeslice(時間片):qusernum(用戶數(shù)):nresponsetime(響應(yīng)時間):tt=n×qMode:multi-terminals、multi-windowsBatchMultiprogrammingvsTimerSharingBatchMultiprogramming
TimeSharing
Principalobjective
Maximizeprocessoruse
Minimizeresponsetime
Sourceofinstructiontooperatingsystem
Jobcontrollanguagecommandsprovidedwiththejob
Commandsenteredattheterminal
ReducingtheSwappingLoadsbyPartialSwapping(p59)Reducingthespendingforaccessingdisk1.3MajorAchievements(p60)1.3.1Processes(進(jìn)程)1.3.2Memorymanagement1.3.3Informationprotectionandsecurity1.3.4Schedulingandresourcemanagement1.3.5Systemstructure1.3.1ProcessesAprograminexecutionTheanimatedspirit(活動精靈)ofaprogramTheentity(實體)thatcanbeassigned(分派)toandexecutedonaprocessorThreemajortypesofcomputersystemMultiprogrammingbatchoperationTimesharingReal-timetransaction(處理)systemsErrorsMayHappeninMultiprogrammingImpropersynchronization(同步):Signalsbeinglostorduplicate(重復(fù))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(認(rèn)證)1.3.4SchedulingandResourceManagement(p66)ThreefactorsmustbeconsiderFairnessDifferentialresponsiveness(區(qū)分服務(wù)):e.g.IfaprocessiswaitingfortheuseofanI/Odevice,theoperatingsystemmaywishtoschedulethatprocessforexecutionassoonaspossibleinordertofreeupthedeviceforlaterdemandsfromotherprocesses.Efficiency:Maximizethroughput(吞吐量),minimizeresponsetime,accommodate(容納)asmanyusersaspossibleShort-termqueueAlgorithmusedtouse:roundrobin(輪轉(zhuǎn))Long-termqueueAlgorithmusedtouse:FIFOInterrupthandler:themethodforgetthecontrolServicecallhandler(系統(tǒng)服務(wù)處理):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(對象設(shè)計)1.4CharacteristicsofModernOS(p71)Assignsonlyafewessential(必要的)functionstothekernel,includingaddressspaces,interprocesscommunication(IPC)(進(jìn)程間通信),andbasicscheduling.Simplifiesimpl
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年股票互換協(xié)議
- 2025年度綠色建筑節(jié)能改造工程承包合同模板2篇
- 2025年度電影院場地租賃合同及觀影安全保障與服務(wù)標(biāo)準(zhǔn)協(xié)議3篇
- 2024版移動網(wǎng)絡(luò)業(yè)務(wù)伙伴合同版B版
- 2025年度婚禮場地借用與策劃服務(wù)合同3篇
- 2025年度訴訟保全擔(dān)保流程規(guī)范細(xì)則合同3篇
- 2025年度池塘休閑漁業(yè)項目租賃協(xié)議3篇
- 2025年水土保持監(jiān)測技術(shù)咨詢與旅游開發(fā)合同3篇
- 二零二五年空調(diào)清洗保養(yǎng)及節(jié)能效益分析合同3篇
- 2025年版健康養(yǎng)老服務(wù)合同4篇
- 定額〔2025〕1號文-關(guān)于發(fā)布2018版電力建設(shè)工程概預(yù)算定額2024年度價格水平調(diào)整的通知
- 公共政策學(xué)-陳振明課件
- SHSG0522023年石油化工裝置工藝設(shè)計包(成套技術(shù))內(nèi)容規(guī)定
- 《運(yùn)營管理》案例庫
- 醫(yī)院安全保衛(wèi)部署方案和管理制度
- 我的自我針灸記錄摘錄
- 中醫(yī)學(xué)-五臟-心-課件
- 《駱駝祥子》閱讀記錄卡
- 教育學(xué)原理完整版課件全套ppt教程(最新)
- 醫(yī)療安全不良事件報告培訓(xùn)PPT培訓(xùn)課件
- 膽管癌的護(hù)理查房
評論
0/150
提交評論