操作系统_ppt1_第1页
操作系统_ppt1_第2页
操作系统_ppt1_第3页
操作系统_ppt1_第4页
操作系统_ppt1_第5页
已阅读5页,还剩46页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1,Computer System Overview,Chapter 1,2,Operating System,Exploits the hardware resources of one or more processors 利用硬件资源 Provides a set of services to system users 提供服务 Manages secondary memory and I/O devices 管理辅存和输入/输出设备,3,Basic Elements 基本构成,Processor 处理器 Main Memory 主存/内存 volatile 易失的 referred to as real memory or primary memory I/O modules 输入/输出模块 secondary memory devices communications equipment terminals System bus 系统总线 communication among processors, memory, and I/O modules,4,Processor,Two internal registers 两种内部寄存器 Memory address register (MAR) Specifies the address for the next read or write Memory buffer register (MBR) Contains data written into memory or receives data read from memory I/O address register I/O buffer register,5,Top-Level Components,6,Processor Registers,User-visible registers 用户可用寄存器 Enable programmer to minimize main-memory references by optimizing register use Control and status registers 控制与状态寄存器 Used by processor to control operating of the processor Used by privileged operating-system routines to control the execution of programs,7,User-Visible Registers,May be referenced by machine language Available to all programs - application programs and system programs Types of registers Data Address Index Segment pointer Stack pointer,8,User-Visible Registers,Address Registers Index Involves adding an index to a base value to get an address Segment pointer When memory is divided into segments, memory is referenced by a segment and an offset Stack pointer Points to top of stack,9,Control and Status Registers,Program Counter (PC) 程序计数器 Contains the address of an instruction to be fetched Instruction Register (IR) 指令寄存器 Contains the instruction most recently fetched Program Status Word (PSW) 程序状态字 Condition codes Interrupt enable/disable Supervisor/user mode,10,Control and Status Registers,Condition Codes or Flags Bits set by the processor hardware as a result of operations Examples Positive result Negative result Zero Overflow,11,Instruction Execution 指令执行,Two steps Processor reads instructions from memory Fetches Processor executes each instruction,12,Instruction Cycle 指令周期,13,Instruction Fetch and Execute,The processor fetches the instruction from memory 取指 Program counter (PC) holds address of the instruction to be fetched next Program counter is incremented after each fetch,14,Instruction Register,Fetched instruction is placed in the instruction register Categories Processor-memory Transfer data between processor and memory Processor-I/O Data transferred to or from a peripheral device Data processing Arithmetic or logic operation on data Control Alter sequence of execution,15,Characteristics of a Hypothetical Machine 一个例子,16,Example of Program Execution,17,Direct Memory Access (DMA) 直接内存访问,I/O exchanges occur directly with memory Processor grants I/O module authority to read from or write to memory Relieves the processor responsibility for the exchange,18,Interrupts 中断,Interrupt the normal sequencing of the processor Most I/O devices are slower than the processor Processor must pause to wait for device,19,Classes of Interrupts,20,Program Flow of Control Without Interrupts,21,Program Flow of Control With Interrupts, Short I/O Wait,22,Program Flow of Control With Interrupts; Long I/O Wait,23,Interrupt Handler 中断处理程序,Program to service a particular I/O device Generally part of the operating system,24,Interrupts,Suspends the normal sequence of execution,25,Interrupt Cycle 中断周期,26,Interrupt Cycle,Processor checks for interrupts If no interrupts fetch the next instruction for the current program If an interrupt is pending, suspend execution of the current program, and execute the interrupt-handler routine,27,Timing Diagram Based on Short I/O Wait 有无中断的比较,28,Timing Diagram Based on Short I/O Wait有无中断的比较,29,Simple Interrupt Processing,30,Changes in Memory and Registers for an Interrupt,31,Changes in Memory and Registers for an Interrupt,32,Multiple Interrupts 多个中断,Disable interrupts while an interrupt is being processed,33,Multiple Interrupts,Define priorities for interrupts,34,Multiple Interrupts,35,Multiprogramming 多道程序,Processor has more than one program to execute The sequence the programs are executed depend on their relative priority and whether they are waiting for I/O After an interrupt handler completes, control may not return to the program that was executing at the time of the interrupt,36,Memory Hierarchy 存储器等级,Faster access time, greater cost per bit Greater capacity, smaller cost per bit Greater capacity, slower access speed,37,Memory Hierarchy,38,Going Down the Hierarchy,Decreasing cost per bit Increasing capacity Increasing access time Decreasing frequency of access of the memory by the processor Locality of reference 访问局部性,39,Secondary Memory 外存,Nonvolatile 非易失 Auxiliary memory 辅助存储 Used to store program and data files,40,Disk Cache,A portion of main memory used as a buffer to temporarily to hold data for the disk Disk writes are clustered 磁盘写可以聚簇 Some data written out may be referenced again. The data are retrieved rapidly from the software cache instead of slowly from disk,41,Cache Memory,Invisible to operating system Increase the speed of memory Processor speed is faster than memory speed Exploit the principle of locality,42,Cache Memory,43,Cache Memory,Contains a copy of a portion of main memory Processor first checks cache If not found in cache, the block of memory containing the needed information is moved to the cache and delivered to the processor,44,Cache/Main Memory System,45,Cache Read Operation,46,Cache Design,Cache size Small caches have a significant impact on performance Block size The unit of data exchanged between cache and main memory Larger 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 cache,47,Cache Design,Mapping function Determines which cache location the block will occupy Replacement algorithm 置换算法 Determines which block to replace Least-Recently-Used (LRU) algorithm,48,Cache Design,Write policy 写策略 When the memory write operation takes place Can occur every time block is updated 写通 Can occur only when block is replaced 写回 Minimizes memory write op

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论