基本构成
- CPU
- PC
- IR
- Execution unit
- MAR: Memory address register
- MBR: Memory buffer register
- I/O AR
- I/O BR
- I/O Module
- Buffers
- Main Memory
- Instruction
- Data
- System Bus
指令
指令周期
- Basic Instruction Cycle
- Start
- Fetch Next Instruction (Fetch Cycle)
- Execute Instruction (Execute Cycle, then goto Fetch stage)
- HALT
中断
- No interrupts
- Interrupts: short I/O wait
- Interrupts: long I/O wait
中断和指令周期
- 加入中断的指令周期
- START
- Fetch Next Instuction (fetch cycle)
- Execute Instruction (execute cycle)
- if interrupts disabled, jump to 2
- if interrupts enabled, jump to 4
- or HALT
- Check for interrupt; Service interrupt (interrupt cycle)
中断处理
- 中断的典型处理顺序,
- 涉及软硬件协作,硬件负责处理 PC 和 PSW;
- Hardware
- Device controller or other system hardware issues an interrupt
- Processor finishes execution of current instruction
- Processor signals acknowledgment of interrupt
- Processor pushes PSW and PC onto control stack
- Processor loads new PC value based on interrupt
- Software
- Save remainder of process state infomation
- Process interrupt
- Restore process state information
- Restore old PSW and PC
- Hardware
多中断处理
- 顺序处理和嵌套处理;
存储器层次结构
- Processor
- CPU: processor register
- Cache: L1, L2, L3
- SD-RAM DDR-SDRAM
- Physical memory: RAM
- Solid State Drives
- Non-volatile flash-based memory
- Mechanical Hard Drives (Virtual Memory)
- File-based memory
高速缓存
高速缓存结构
高速缓存读操作
高速缓存设计考虑因素
高速缓存大小
块大小
映射函数
置换算法
写策略
高速缓存级数
直接内存存取(DMA)
Transclude of 60-IO管理与磁盘#dma-工作流程