《计算机系统结构英》PPT课件.ppt

上传人:wuy****n92 文档编号:53636729 上传时间:2022-10-26 格式:PPT 页数:36 大小:492KB
返回 下载 相关 举报
《计算机系统结构英》PPT课件.ppt_第1页
第1页 / 共36页
《计算机系统结构英》PPT课件.ppt_第2页
第2页 / 共36页
点击查看更多>>
资源描述

《《计算机系统结构英》PPT课件.ppt》由会员分享,可在线阅读,更多相关《《计算机系统结构英》PPT课件.ppt(36页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、Chapter 2:Computer-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage Hierarchy nHardware Protection nGeneral System ArchitectureUniprocessor Computer-System ArchitecturecontrollerControllernA device controller is a part of a computer system that makes sense of the

2、signals going to,and coming from the CPU processor.Each device controller is in charge of a particular device type.nDevice controllers use binary and digital codes.Each device controller has a local buffer and a command register.I/O is from the device to local buffer of controller.nI/O devices and t

3、he CPU can execute concurrently.Device controllers communicate with the CPU by causing an interrupt.Functions of device controllersnReceiving and understanding the commands of CPUnimplementing the data exchange between CPU and devices(format conversion)nRecording the status of device to be queried b

4、y CPU(status register)nIdentifying the address of each deviceCommon Functions of InterruptsnInterrupts transfers control to the interrupt service routine generally,through the interrupt vector,which contains the addresses of all the service routines.通常中断通过中断向量把控制传给中断服务程序nInterrupt architecture must

5、save the address of the interrupted instruction.nIncoming interrupts are disabled while another interrupt is being processed to prevent a lost interrupt.nA trap is a software-generated interrupt caused either by an error or a user request.nAn operating system is interrupt driven.Interrupt HandlingnT

6、he operating system preserves the state of the CPU by storing registers and the program counter.nDetermines which type of interrupt has occurred:npolling nvectored interrupt system nSeparate segments of code determine what action should be taken for each type of interrupt Interrupt Time Line For a S

7、ingle Process Doing Output(P21)Chapter 2:Computer-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage Hierarchy nHardware Protection nGeneral System ArchitectureI/O Structure1.No channel(IOP):npollingCPU-OrientedCPURAMCCCCDisk DrivePrinterDeviceSystem BusI/O Structur

8、e2.channel(IOP):Memory-OrientedC1IOP1CPURAMIOP2C2C3C4Device1Device2Device3Device4Device5Device6Device7How to output the data in RAM?nConstruct a channel programnSubmit the channel program to the corresponding IOP via RAMnThe IOP executes the channel programnThe IOP notifies CPU by causing an interru

9、pt upon completion A channel program is a sequence of I/O instructions executed by the input/output channel processor(IOP).The channel program consists of one or more channel command words.Two I/O MethodsSynchronousAsynchronousSynchronous I/OnAfter I/O starts,control returns to user program only upo

10、n I/O completion.nwait instruction idles the CPU until the next interruptnwait loop(contention for memory access).nAt most one I/O request is outstanding at a time,no simultaneous I/O processing.Asynchronous I/OnAfter I/O starts,control returns to user program,without waiting for I/O completion.nSys

11、tem call request to the operating system to allow user to wait for I/O completion.nDevice-status table contains entry for each I/O device indicating its type,address,and state.nOperating system indexes into I/O device table to determine device status and to modify table entry to include interrupt.nT

12、he main advantage of asynchronous I/O is increased system efficiency.Device-Status TableI/O StructurenProgrammed input/output(PIO)is a method of transferring data between the CPU and a peripheral.In general,programmed I/O happens when software running on the CPU uses instructions that access I/O add

13、ress space to perform data transfers to or from an I/O device.nWith Direct Memory Access(DMA),the CPU would initiate the transfer,do other operations while the transfer is in progress,and receive an interrupt from the DMA controller once the operation has been done.Direct Memory Access(DMA)Structure

14、nUsed for high-speed I/O devices able to transmit information at close to memory speeds.nDevice controller transfers blocks of data from buffer storage directly to main memory without CPU intervention.nOnly one interrupt is generated per block,rather than the one interrupt per byte.Chapter 2:Compute

15、r-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage Hierarchy nHardware Protection nGeneral System ArchitectureStorage StructurenMain memory only large storage media that the CPU can access directly.nSecondary storage extension of main memory that provides large no

16、nvolatile storage capacity.nMagnetic disks rigid metal or glass platters covered with magnetic recording materialnDisk surface is logically divided into tracks,which are subdivided into sectors.nThe disk controller determines the logical interaction between the device and the computer.Moving-Head Di

17、sk MechanismnPositioning time(random-access time)nseek time nrotational latencyntransfer timenTo decrease mechanical delays,i.e.,the seek time and the rotational latency Disk Scheduling AlgorithmChapter 2:Computer-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage H

18、ierarchy nHardware Protection nGeneral System ArchitectureStorage HierarchynStorage systems organized in hierarchy.nSpeed ncost nvolatility nCaching copying information into faster storage system;main memory can be viewed as a fast cache for secondary storage.Storage-Device Hierarchy寄存器寄存器缓存缓存主存储器主存

19、储器电子盘电子盘磁盘磁盘光盘光盘磁带磁带Chapter 2:Computer-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage Hierarchy nHardware Protection nGeneral System ArchitectureHardware ProtectionnDual-Mode OperationnI/O ProtectionnMemory ProtectionnCPU ProtectionDual-Mode OperationnSharing sy

20、stem resources requires operating system to ensure that an incorrect program cannot cause other programs to execute incorrectly.nProvide hardware support to differentiate between at least two modes of operations.至少在两个运行模式之间提供硬件支持至少在两个运行模式之间提供硬件支持1.User mode execution done on behalf of a user.2.Monit

21、or mode(also supervisor mode or system mode)execution done on behalf of operating system.usernWhen an interrupt or fault occurs hardware switches to monitor mode.Dual-Mode Operation(Cont.)nMode bit added to computer hardware(PSW)to indicate the current mode:monitor(0)or user(1).Privileged instructio

22、ns can be issued only in monitor mode.特权指令特权指令只能在管态下执行只能在管态下执行 monitorInterrupt/faultset user modeI/O ProtectionnPrivileged instructionsnAll I/O instructions are privileged instructions.nEnable/disable interruptsnModify address registersnSet PSWnMust ensure that a user program could never gain contr

23、ol of the computer in monitor mode.Memory ProtectionnMust provide memory protection at least for the interrupt vector and the interrupt service routines.nIn order to have memory protection,add two registers that determine the range of legal addresses a program may access:nbase register holds the sma

24、llest legal physical memory address.nlimit register contains the size of the rangenMemory outside the defined range is protected.A Base And A limit Register Define A Logical Address SpaceHardware ProtectionnWhen executing in monitor mode,the operating system has unrestricted access to both monitor a

25、nd users memory.nThe load instructions for the base and limit registers are privileged instructions.CPU ProtectionnTimer interrupts computer after specified period to ensure operating system maintains control.nTimer is decremented every clock tick.nWhen timer reaches the value 0,an interrupt occurs.

26、nTimer commonly used to implement time sharing.nTimer also used to compute the current time.Load-timer is a privileged instruction.Chapter 2:Computer-System StructuresnComputer System OperationnI/O StructurenStorage Structure nStorage Hierarchy nHardware Protection nGeneral System ArchitectureGenera

27、l-System ArchitecturenGiven the I/O instructions are privileged,how does the user program perform I/O?nSystem call the method used by a process to request action by the operating system.nUsually takes the form of a trap to a specific location in the interrupt vector.nControl passes through the interrupt vector to a service routine in the OS,and the mode bit is set to monitor mode.nThe monitor verifies that the parameters are correct and legal,executes the request,and returns control to the instruction following the system call.Use of A System Call to Perform I/OHomeworknP41-P42

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 初中资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com