計算機(jī)操作系統(tǒng)OperatingSystemOverview_第1頁
計算機(jī)操作系統(tǒng)OperatingSystemOverview_第2頁
計算機(jī)操作系統(tǒng)OperatingSystemOverview_第3頁
計算機(jī)操作系統(tǒng)OperatingSystemOverview_第4頁
計算機(jī)操作系統(tǒng)OperatingSystemOverview_第5頁
已閱讀5頁,還剩46頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(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(實(shí)體)thatcanbeassigned(分派)toandexecutedonaprocessorThreemajortypesofcomputersystemMultiprogrammingbatchoperationTimesharingReal-timetransaction(處理)systemsErrorsMayHappeninMultiprogrammingImpropersynchronization(同步):Signalsbeinglostorduplicate(重復(fù))signalsbeingreceived.Failedmutualexclusion(失敗的互斥)Nondeterminate(不確定)programoperation:TheresultisnotuniqueDeadlocks(死鎖)Tosolutetheseproblems,introduceprocessconcept

Processentity(實(shí)體)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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論