操作系统精髓与设计原理英汉对照th

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

Chapter1ComputerSystemOverviewDaveBremerOtagoPolytechnic,N.Z.©2008,PrenticeHallOperatingSystems:InternalsandDesignPrinciples,6/EWilliamStallingsRoadmap路标–BasicElements基本构成–ProcessorRegisters处理器寄存器–InstructionExecution指令的执行–Interrupts中断–TheMemoryHierarchy存储器的层次–CacheMemory高速缓存–I/OCommunicationTechniquesI/O通讯技术OperatingSystem操作系统•Exploitsthehardwareresourcesofoneormoreprocessors利用硬件资源的一个或多个处理器•Providesasetofservicestosystemusers为用户提供一组服务•ManagessecondarymemoryandI/Odevices管理辅助存储器和I/O设备AComputer’sBasicElements电脑的基本构成•Processor处理器•MainMemory内存•I/OModules输入输出模块•SystemBus系统总线Processor处理器•Controlsoperation,performsdataprocessing控制操作,执行数据处理•Twointernalregisters两个内部寄存器–Memoryaddressresister(MAR)地址寄存器–Memorybufferregister(MBR)缓冲寄存器•I/OaddressregisterI/O地址寄存器•I/ObufferregisterI/O缓冲寄存器MainMemory内存•Volatile易失的–Dataistypicallylostwhenpowerisremoved•Referredtoasrealmemoryorprimarymemory被称作实存储器或主存储器•Consistsofasetoflocationsdefinedbysequentiallynumbersaddresses由一组单元组成,这些单元由顺序编号的地址定义–Containingeitherdataorinstructions存放数据或指令I/OModulesI/O模块•Movesdatabetweenthecomputerandtheexternalenvironmentsuchas:–Storage(e.g.harddrive)存储器(例如硬盘)–Communicationsequipment通信设备–Terminals终端•SpecifiedbyanI/OAddressRegister由I/O地址寄存器确定–(I/OAR)(I/O地址寄存器)SystemBus•Communicationamongprocessors,mainmemory,andI/Omodules在处理器内存和I/O模块间通讯Top-LevelView顶层视图(P7)Roadmap–BasicElements–ProcessorRegisters–InstructionExecution–Interrupts–TheMemoryHierarchy–CacheMemory–I/OCommunicationTechniquesProcessorRegisters•Fasterandsmallerthanmainmemory比内存快、小•User-visibleregisters用户可见寄存器–Enableprogrammertominimizemainmemoryreferencesbyoptimizingregisteruse通过优先使用寄存器减少内存访问•Controlandstatusregisters控制和状态寄存器–Usedbyprocessortocontroloperatingoftheprocessor用以控制处理器的操作–UsedbyprivilegedOSroutinestocontroltheexecutionofprograms由特权操作系统例程使用以控制程序执行User-VisibleRegisters用户可见寄存器•Maybereferencedbymachinelanguage可以通过机器语言引用–Availabletoallprograms–applicationprogramsandsystemprograms对所有程序可用(包括应用程序和系统程序)•Typesofregisterstypicallyavailableare:通常可用的寄存器类型有:–data,–address,–conditioncoderegisters.条件码寄存器DataandAddressRegisters数据和地址寄存器•Data–Oftengeneralpurpose常常通用–Butsomerestrictionsmayapply有时会有限制•Address–IndexRegister变址寄存器–Segmentpointer堆指针–Stackpointer栈指针ControlandStatusRegisters控制和状态寄存器•Programcounter(PC)程序计数器–Containstheaddressofaninstructiontobefetched包含将取指令的地址•Instructionregister(IR)指令寄存器–Containstheinstructionmostrecentlyfetched包含最近取用的指令•Programstatusword(PSW)程序状态字–Containsstatusinformation包含状态信息Conditioncodes条件码•Usuallypartofthecontrolregister通常控制寄存器的一部分–Alsocalledflags也称为标记•Bitssetbyprocessorhardwareasaresultofoperations处理器硬件为操作结果设置的位–Readonly,intendedforfeedbackregardingtheresultsofinstructionexecution.只读,用于反馈指令执行结果Roadmap–BasicElements–ProcessorRegisters–InstructionExecution–Interrupts–TheMemoryHierarchy–CacheMemory–I/OCommunicationTechniquesInstructionExecution指令的执行•Aprogramconsistsofasetofinstructionsstoredinmemory处理器执行的程序由一组存储在内存中的指令组成•Twosteps两个步骤–Processorreads(fetches)instructionsfrommemory处理器从内存中读取指令–Processorexecuteseachinstruction处理器执行每一条指令BasicInstructionCycle基本指令周期InstructionFetchandExecute取指令和执行指令•Theprocessorfetchestheinstructionfrommemory处理器从内存中读取指令•Programcounter(PC)holdsaddressoftheinstructiontobefetchednext程序计数器保存下一条将取指令的地址–PCisincrementedaftereachfetch每次取指令后程序计数器自增InstructionRegister指令寄存器•Fetchedinstructionisloadedintoinstructionregister取到的指令载入到指令寄存器•Categories操作分类–Processor-memory,处理器-存储器–processor-I/O,处理器-I/O–Dataprocessing,数据处理–Control控制CharacteristicsofaHypotheticalMachine理想机器的特征ExampleofProgramExecution程序执行的例子Roadmap–BasicElements–ProcessorRegisters–InstructionExecution–Interrupts–TheMemoryHierarchy–CacheMemory–I/OCommunicationTechniquesInterrupts中断•Interruptthenormalsequencingoftheprocessor中断处理器正常序列•Providedtoimproveprocessorutilization用于提高处理器效率–MostI/Odevicesareslowerthantheprocessor–ProcessormustpausetowaitfordeviceCommonClassesofInterrupts中断的通常等级FlowofControlwithoutInterrupts无中断控制流程InterruptsandtheInstructionCycle终端和指令周期TransferofControlviaInterrupts通过中断的控制转移InstructionCyclewithInterrupts有中断的指令周期ShortI/OWait短I/O等待LongI/Owait长I/O等待SimpleInterruptProcessing简单的中断处理ChangesinMemoryandRegistersforanInterrupt内存和寄存器因中断而产生的变化MultipleInterrupts多中断•Supposeaninterruptoccurswhileanotherinterruptisbeingprocessed.假设当一个中断正在处理,另一个中断出现–E.g.printingdatabeingreceivedviacommunicationsline.•Twoapproaches:两个方法–Disableinterruptsduringinterruptprocessing在一个中断处理中禁止其他中断–Useapriorityscheme.使用优先级SequentialInterruptProcessing顺序中断处理NestedInterruptProcessing嵌套中断处理ExampleofNestedInterrupts嵌套中断的例子Multiprogramming多道程序设计•Processorhasmorethanoneprogramtoexecute处理器有多个程序要执行•ThesequencetheprogramsareexecuteddependontheirrelativepriorityandwhethertheyarewaitingforI/O程序的执行顺序取决于他们的相对优先级以及是否正在等待I/O•Afteraninterrupthandlercompletes,controlmaynotreturntotheprogramthatwasexecutingatthetimeoftheinterrupt一个中断处理完成后,控制权可能不会立刻返回到中断时执行到的程序(而可能转移到其他待运行的具有更高优先级的其他程序)Roadmap–BasicElements–ProcessorRegisters–InstructionExecution–Interrupts–TheMemoryHierarchy–CacheMemory–I/OCommunicationTechniquesMemoryHierarchy存储器层次•Major

1 / 63
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功