操作系统第一章 计算机系统概述

上传人:woxinch****an2018 文档编号:44819739 上传时间:2018-06-14 格式:PPT 页数:49 大小:740KB
返回 下载 相关 举报
操作系统第一章 计算机系统概述_第1页
第1页 / 共49页
操作系统第一章 计算机系统概述_第2页
第2页 / 共49页
操作系统第一章 计算机系统概述_第3页
第3页 / 共49页
操作系统第一章 计算机系统概述_第4页
第4页 / 共49页
操作系统第一章 计算机系统概述_第5页
第5页 / 共49页
点击查看更多>>
资源描述

《操作系统第一章 计算机系统概述》由会员分享,可在线阅读,更多相关《操作系统第一章 计算机系统概述(49页珍藏版)》请在金锄头文库上搜索。

1、1Computer System OverviewChapter 12Basic Elements of ComputerqProcessorqMain MemoryVolatile(易失的),referred to as real memory or primary memoryqI/O modulessecondary memory devices(辅助存储设备)communications equipmentTerminals(终端)qSystem buscommunication among processors, memory, and I/O modules3Computer Co

2、mponents: Top-Level View4Processor Registers(寄存器)qMemory address register (MAR)Specifies the address for the next read or writeqMemory buffer register (MBR)Contains data written into memory or receives data read from memoryqI/O address registerqI/O buffer register5Processor RegistersqUser-visible re

3、gistersEnable programmer to minimize main-memory references by optimizing register useqControl and status registersUsed by processor to control operating of the processorUsed by privileged operating-system routines to control the execution of programs6User-Visible Registers (1)qMay be referenced by

4、machine languageqAvailable to all programs - application programs and system programsqTypes of registersData AddressqIndexqSegment pointerqStack pointer7User-Visible Registers (2)qAddress RegistersIndexqInvolves adding an index to a base value to get an addressSegment pointerqWhen memory is divided

5、into segments, memory is referenced by a segment and an offsetStack pointerqPoints to top of stack8Control and Status Registers (1)qProgram Counter (PC, 程序计数器)Contains the address of an instruction to be fetchedqInstruction Register (IR)Contains the instruction most recently fetchedqProgram Status W

6、ord (PSW, 程序状态字)Condition codesInterrupt enable/disableSupervisor/user mode9Control and Status Registers (2)qCondition Codes or FlagsBits set by the processor hardware as a result of operationsExample: arithmetic operationqPositive resultqNegative resultqZeroqOverflow10Instruction Execution(指令执行)qTw

7、o stepsProcessor reads instructions from memoryProcessor executes each instructionqInstruction cycle(指令周期)11Instruction Fetch and ExecuteqThe processor fetches the instruction ( 取指令) from memoryqProgram counter (PC, 程序计数器) holds address of the instruction to be fetched nextqProgram counter is increm

8、ented after each fetch12Instruction RegisterqFetched instruction is placed in the instruction register (指令寄存器)qCategories of actions:Processor-memory (处理器和内存之间)qTransfer data between processor and memoryProcessor-I/O (处理器和I/O设备之间)qData transferred to or from a peripheral device(外部设备 )Data processing

9、qArithmetic(算术) or logic operation on dataControlqAlter sequence (顺序) of execution13Characteristics of a Hypothetical Machine14Example of Program Execution15Interrupts (中断)qMost I/O devices are slower than the processorProcessor must pause to wait for deviceqInterrupt the normal sequencing of the pr

10、ocessorqInterrupts are provided primarily as a way to improve processor utilization16Classes of Interrupts17Program Flow of Control Without Interrupts18Program Flow of Control With Interrupts, Short I/O Wait19Program Flow of Control With Interrupts, Long I/O Wait20Interrupt Handler(中断服务程序)qProgram t

11、o service a particular I/O deviceqGenerally part of the operating systemqInterrupt Service Routine(ISR, 中断服务 程序)21InterruptsqSuspends (挂起) the normal sequence of execution22Interrupt Cycle23Interrupt CycleqProcessor checks for interruptsqIf no interrupts fetch the next instruction for the current pr

12、ogramqIf an interrupt is pending, suspend execution of the current program, and execute the interrupt-handler routine24Timing Diagram Based on Short I/O Wait25Timing Diagram Based on Short I/O Wait26Simple Interrupt Processing27Changes in Memory and Registers for an Interrupt28Changes in Memory and

13、Registers for an Interrupt29Multiple InterruptsqDisable interrupts while an interrupt is being processed30Multiple InterruptsqDefine priorities (优先级) for interrupts31Multiple Interrupts32Multiprogramming (多道)qProcessor has more than one program to executeqThe sequence the programs are executed depen

14、d on their relative priority and whether they are waiting for I/OqAfter an interrupt handler completes, control may not return to the program that was executing at the time of the interrupt33Memory Hierarchy (存储层次)qFaster access time, greater cost per bitqGreater capacity, smaller cost per bitqGreat

15、er capacity, slower access speed34Memory Hierarchy35Going Down the HierarchyqDecreasing cost per bitqIncreasing capacityqIncreasing access timeqDecreasing frequency of access of the memory by the processorLocality of reference36Secondary Memory (辅助存储器)qUsed to store program and data filesqNonvolatil

16、e (非易失的)qAuxiliary memory (辅助存储)37Disk Cache (磁盘高速缓存)qA portion of main memory used as a buffer to temporarily to hold data for the diskqDisk writes are clusteredSome data written out may be referenced again. The data are retrieved rapidly from the software cache instead of slowly from disk38Cache Memory (高速缓存)qInvisible to operating systemqIncrease the speed of memoryqProcessor speed is faster than memory speedqExploit t

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

当前位置:首页 > 高等教育 > 其它相关文档

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号