Chapter 7 Input/Output
来源:互联网 发布:淘宝商城天猫首页 编辑:程序博客网 时间:2024/04/30 04:20
- Keyboard and Monitor
- The most common means of computer/user is keyboard and monitor
- Keyboard working principle (A/D)
- A key → an electronic signal à bit pattern (transducer)
- Bit pattern →I/O modular
- Processed and stored as ASCⅡ in computer
- Monitor working as output (D/A)
- On the contrary
- Disk drive
- Contain two types of electronics
- One type for exchanging data, control and status signals with an I/O module
- The other for controlling the disk read/write mechanism
- Input/Output module
- Interface to CPU and Memory
- Functions of I/O module
- Control and Timing
- CPU ~ I/O communication, Device ~ I/O communication, Memory ~ I/O communication
- Command decoding
- Data exchange
- Status reporting
- Address recognition
- Data buffering: An important role of I/O modular
- Error detection
- I/O steps
- CPU checks I/O module and device status
- I/O module returns status
- If ready, CPU requests data transfer
- I/O module gets data from device
- I/O module transfers data to CPU
- Programmed-I/O
- Data are exchanged between the CPU and I/O modular
- CPU controls over I/O directly in a program
- Waste CPU time: CPU waits for I/O module to complete operation when it issues an I/O command
- I/O mapping
- Memory mapped I/O
- Devices and memory share an address space
- Use a flag bit
- Large selection of devices available
- Isolated I/O
- Separated address spaces
- Limited set
- Advantage:
- Simple
- Disadvantage:
- Polling overhead can consume a lot of CPU time
- Interrupt-driven I/O
- Characteristics:
- Overcomes CPU waiting
- No repeated CPU checking of device
- I/O module interrupts when ready
- Steps:
- CPU issues read command, and then do other things
- I/O module gets data from peripheral whilst CPU does other work
- I/O module interrupts CPU
- CPU requests data
- I/O module transfers data through bus
- At last, CPU recover previous work
- Solutions
- Hardware solution
- Multiple interrupt lines: limits number of devices
- Software solution
- Slow
- Daisy chain or Hardware poll bus
- Arbitration
- Multiple interrupts processing
- With multiple lines, each interrupt line has a priority
- Higher priority lines can interrrupt lower priority lines
- With software polling, the order in which modules are polled determines their priority
- With daisy, the order of modules on the daisy determines their priority
- DMA: a more efficient technique for large volumes of data
- In programmed I/O & Interrupted-driven I/O, data transfer must traverse CPU
- Transfer rate is limited
- CPU is tied up
- DMA controller takes over from CPU for I/O
- Transfer blocks of data to or from memory without CPU intervention
- Three modes of data transfer between CPU and DMA
- Block transfer mode(Monopolistic mode)
- An entire block of data is transferred in one contiguous sequence
- If DMA transfers data, CPU be disabled for a duration until DMA releases bus
- Cycle stealing mode: DMA controller takes over bus for a cycle(Not an interrupt(CPU does not switch context))
- DMA uses the bus only when CPU does not need it or forcing CPU to suspend operation temporarily
- DMA transfer one word of data, then release the bus
- Transparent mode(alternate mode)
- DMA and CPU use bus by division time multiplexing
- Require most time, but the most efficient
- DMA operation
- Preprocessing: CPU tells DMA controller
- Data transferring
- Postprocessing: DMA controller sends interrupt when finished
- (CPU involves only at the beginning and the end of the operation)
- DMA configurations
- Single bus, detached DMA controller
- CPU is suspended twice(Each transfer uses bus twice: I/O to DMA, DMA to memory)
- Single bus, integrated DMA controller
- CPU is suspended once
- Separate I/O bus
- I/O Channel: an I/O module with its own processor which can execute I/O program(An extension of the DMA concept)(Has the ability to execute I/O instructions and control the I/O operations)
- Functions
- Receive command from CPU
- Load I/O program from memory, send commands to device
- Buffer, control and transfer data, provide path for transferring
- Report device status or interrupt
- Types
- Selector channel(Max value)
- At any one time, only one device is selected to transfer data
- High-speed devices
- Multiplexor channel
- Byte multiplexor channel(Number of devices)
- Round robon between devices
- For a device, only one byte data is transferred
- For low-speed devices
- Block multiplexor channel(Max value)
- Round robin between devices
- For a device, K bytes data are transferred
- I/O processor
- I/O processor + local memory
- External interface
- Connecting devices together
- Point to point: dedicated line(keyboard, modem)
- Point to multi-point: external buses(CD-ROMs, video, audio)
- Serial or parallel
0 0
- Chapter 7 Input/Output
- The C programing language chapter 7 : Input and Output
- 【常规解题报告】Chapter 0 Input and Output
- 《modern operating system》 chapter 5 Input and output 笔记
- Ch.7 - Input and Output
- 7_IO(Input Output)流
- input/output
- 杭电OJ(HDU)-ACM Steps-Chapter One-《A+B for Input-Output Practice》 1至8 全解
- input and output
- Input和Output
- Redirection on input/output.
- input/output control --- ioctl
- Input和Output
- 关于input和output
- Input与Output
- Input,OutPut,Feature描述
- stand IO input & output
- IO(Input Output)流
- vivado与modelsim的关联以及器件库编译
- Chapter 6 Extern Memory
- C#常用多线程方法
- Could not get JDBC Connection
- ajaxfileupload.js+SpringMVC实现文件上传
- Chapter 7 Input/Output
- 收尾--我的2016
- Chapter 9 Computer Arithmetic
- 老罗
- Chapter 10 Instruction Set: Charateristics and Functions
- 深入分析VMware虚拟机的三种组网模式
- Java简单枚举的实现
- 简单实现一个人脸检测器(HOG+SVM实现人脸检测)
- include和merge 布局使减少布局重用