《实战整合营销学》完整讲稿Title课件.pptx
FANG Dingyi(Department of Networking&Communication Eng.TEL:88308273(lab);88308114(O)Email:销售信 Words before the Course:Textbook:Operating SystemsInternals and Design Principles(3ird or 4th edition),William Stalling,Prentice Hall/清华大学出版社清华大学出版社;魏迎梅等译,电子工业出版社出版魏迎梅等译,电子工业出版社出版Words before the Course:Grade:30%(10%presentation+10%homewwork+10%project)+30%(mid term exam)+40%(final exam)Claim of the exam:all question are in EnglishWords before the Course:Reference boobs(in Chinese):1.计算机操作系统计算机操作系统,骆斌等著,高等教育出版社;骆斌等著,高等教育出版社;2.计算机操作系统计算机操作系统,孙雅如、房鼎益著,西电出版社;孙雅如、房鼎益著,西电出版社;3.计算机操作系统计算机操作系统,汤子赢等著,西电出版社;汤子赢等著,西电出版社;4.计算机操作系统计算机操作系统,何炎祥等著,清华大学出版社;何炎祥等著,清华大学出版社;Computer System OverviewChapter 16 6网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Operating SystemExploits the hardware resources of one or more processors(充分利用处理机资源充分利用处理机资源)Provides a set of services to system users(提供方便用户使用的服务提供方便用户使用的服务)Manages secondary memory and I/O devices(管理外存与外设管理外存与外设)7 7网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Basic ElementsProcessorMain Memoryreferred to as real memory or primary memoryVolatile(易挥发的易挥发的掉电后内容丢失掉电后内容丢失)I/O modulessecondary memory devicescommunications equipmentterminalsSystem buscommunication among processors,memory,and I/O modules8 8网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Top-Level Components9 9网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Processor RegistersUser-visible registersEnable programmer to minimize main-memory references by optimizing register useControl and status registersUsed by processor to control operating of the processorUsed by operating-system routines to control the execution of programs1010网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5User-Visible RegistersMay be referenced by machine languageAvailable to all programs-application programs and system programsTypes of registersData AddressIndexSegment pointerStack pointer1111网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5User-Visible RegistersAddress RegistersIndexinvolves adding an index to a base value to get an addressSegment pointerwhen memory is divided into segments,memory is referenced by a segment and an offsetStack pointerpoints to top of stack1212网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Control and Status RegistersProgram Counter(PC)Contains the address of an instruction to be fetchedInstruction Register(IR)Contains the instruction most recently fetchedProgram Status Word(PSW)condition codesInterrupt enable/disableSupervisor/user mode1313网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Control and Status RegistersCondition Codes or FlagsBits set by the processor hardware as a result of operationsCan be accessed by a program but not alteredExamplespositive resultnegative resultzeroOverflow1414网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Instruction ExecutionTwo stepsProcessor reads instructions from memoryFetchesProcessor executes each instruction1515网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Instruction Cycle1616网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Instruction Fetch and ExecuteThe processor fetches the instruction from memoryProgram counter(PC)holds address of the instruction to be fetched nextProgram counter is incremented after each fetch1717网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Instruction RegisterFetched instruction is placed in the instruction registerTypes of instructionsProcessor-memorytransfer data between processor and memoryProcessor-I/Odata transferred to or from a peripheral deviceData processingarithmetic or logic operation on dataControlalter sequence of execution1818网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Characteristics of a Hypothetical Machine1919网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Example of Program Execution2020网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Direct Memory Access(DMA)I/O exchanges occur directly with memoryProcessor grants I/O module authority to read from or write to memoryRelieves the processor responsibility for the exchangeProcessor is free to do other things2121网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5InterruptsAn interruption of the normal sequence of executionImproves processing efficiencyAllows the processor to execute other instructions while an I/O operation is in progressA suspension of a process caused by an event external to that process and performed in such a way that the process can be resumed2222网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Classes of Interrupts2323网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Program Flow of Control Without Interrupts2424网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Program Flow of Control With Interrupts,Short I/O Wait2525网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Program Flow of Control With Interrupts;Long I/O Wait2626网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Interrupt HandlerA program that determines nature of the interrupt and performs whatever actions are neededControl is transferred to this programGenerally part of the operating system2727网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5InterruptsSuspends the normal sequence of execution2828网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Interrupt Cycle2929网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Interrupt CycleProcessor checks for interruptsIf no interrupts fetch the next instruction for the current programIf an interrupt is pending(待解决的待解决的),suspend execution of the current program,and execute the interrupt-handler routine3030网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Timing Diagram Based on Short I/O Wait3131网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Timing Diagram Based on Short I/O Wait3232网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Simple Interrupt Processing3333网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Changes in Memory and Registers for an Interrupt3434网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Changes in Memory and Registers for an Interrupt3535网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Multiple InterruptsDisable interrupts while an interrupt is being processed3636网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Multiple InterruptsDefine priorities for interrupts3737网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Multiple Interrupts3838网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5MultiprogrammingProcessor has more than one program to executeThe sequence the programs are executed depend on their relative priority and whether they are waiting for I/OAfter an interrupt handler completes,control may not return to the program that was executing at the time of the interrupt3939网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Memory HierarchyFaster access time,greater cost per bitGreater capacity,smaller cost per bitGreater capacity,slower access speed4040网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Memory Hierarchy4141网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Going Down the HierarchyDecreasing cost per bitIncreasing capacityIncreasing access timeDecreasing frequency of access of the memory by the processorLocality of reference4242网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Secondary MemoryNonvolatileAuxiliary memoryUsed to store program and data files4343网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Disk CacheA portion of main memory used as a buffer to temporarily to hold data for the diskDisk writes are clusteredSome data written out may be referenced again.The data are retrieved rapidly from the software cache instead of slowly from disk4444网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache MemoryInvisible to operating systemIncrease the speed of memoryProcessor speed is faster than memory speedExploit the principle of locality4545网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache Memory4646网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache MemoryContains a copy of a portion of main memoryProcessor first checks cacheIf not found in cache,the block of memory containing the needed information is moved to the cache and delivered to the processor4747网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache/Main Memory System4848网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache Read Operation4949网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache DesignCache sizeSmall caches have a significant impact on performanceBlock sizeThe unit of data exchanged between cache and main memoryLarger block size more hits until probability of using newly fetched data becomes less than the probability of reusing data that have to be moved out of cache5050网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache DesignMapping functionDetermines which cache location the block will occupyReplacement algorithmDetermines which block to replaceLeast-Recently-Used(LRU)algorithm5151网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Cache DesignWrite policyWhen the memory write operation takes placeCan occur every time block is updatedCan occur only when block is replacedMinimizes memory write operationsLeaves main memory in an obsolete state5252网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Programmed I/OI/O module performs the action,not the processorSets appropriate bits in the I/O status registerNo interrupts occurProcessor checks status until operation is complete5353网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Interrupt-Driven I/OProcessor is interrupted when I/O module ready to exchange dataProcessor saves context of program executing and begins executing interrupt-handlerNo needless waitingConsumes a lot of processor time because every word read or written passes through the processor5454网络与分布式系统研究室网络与分布式系统研究室(DisNet Lab of NWU)2023/3/52023/3/5Direct Memory AccessTransfers a block of data directly to or from memoryAn interrupt is sent when the transfer is completeProcessor continues with other work1、有时候读书是一种巧妙地避开思考的方法。3月-233月-23Sunday,March 5,20232、阅读一切好书如同和过去最杰出的人谈话。23:28:5923:28:5923:283/5/2023 11:28:59 PM3、越是没有本领的就越加自命不凡。3月-2323:28:5923:28Mar-2305-Mar-234、越是无能的人,越喜欢挑剔别人的错儿。23:28:5923:28:5923:28Sunday,March 5,20235、知人者智,自知者明。胜人者有力,自胜者强。3月-233月-2323:28:5923:28:59March 5,20236、意志坚强的人能把世界放在手中像泥块一样任意揉捏。05三月202311:28:59下午23:28:593月-237、最具挑战性的挑战莫过于提升自我。三月2311:28下午3月-2323:28March 5,20238、业余生活要有意义,不要越轨。2023/3/523:28:5923:28:5905 March 20239、一个人即使已登上顶峰,也仍要自强不息。11:28:59下午11:28下午23:28:593月-2310、你要做多大的事情,就该承受多大的压力。3/5/2023 11:28:59 PM23:28:5905-3月-2311、自己要先看得起自己,别人才会看得起你。3/5/2023 11:28 PM3/5/2023 11:28 PM3月-233月-2312、这一秒不放弃,下一秒就会有希望。05-Mar-2305 March 20233月-2313、无论才能知识多么卓著,如果缺乏热情,则无异纸上画饼充饥,无补于事。Sunday,March 5,202305-Mar-233月-2314、我只是自己不放过自己而已,现在我不会再逼自己眷恋了。3月-2323:28:5905 March 202323:28谢谢大家谢谢大家