Professional Documents
Culture Documents
CS 219
Computer Organization
TR 11:30 ~ 12:45 PM @ WRI C303 Fall 2006
Speed
Access time = Seek + Latency
Seek time
Moving head to correct track Under 10ms
(Rotational) latency
Disk rotates at constant speed Waiting for data to rotate under head At 15,000 RPM (=250 RPS), 4ms for one rotation, so 2ms average delay
Transfer time
Time required for data transfer
October 3, 2006 CS 219 Computer Organization and Architecture Page 2
Timing Comparison
Characteristics
Average seek time = 4ms RPM = 15,000 (average latency = 2ms) File = 5 tracks x 500 sectors/ track = 2500 sectors
1. If sequential
First track = seek + latency + full track = 4 + 2 + 4 ms = 10 ms Subsequent tracks = (little seek time) + latency + full track = 2 + 4 = 6 ms Total = 10 + 6 + 6 + 6 + 6 = 34 ms
2. If randomly distributed
Each sector = seek + latency + sector = 4 + 2 + 0.008 ms = 6.008 ms Total = 2500 * 6.008 = 15.02 sec
Need disk scheduling
October 3, 2006 CS 219 Computer Organization and Architecture Page 3
CD-ROM
Since 1983 Originally for audio
650Mbytes giving over 70 minutes audio
CD Operation
10~20 micron
1.2mm
0.9~3.3 micron
0.12 micron deep (~1/6 of WL) 0.5 micron wide Pitch = 1.6 micron to next track
CD-RW
Erasable (500,000 ~1,000,000 erase cycles) More reliable and longer life than magnetic disks Getting cheaper Mostly CD-ROM drive compatible Phase change of material by laser light
Material has two different reflectivities in different phase states, one poor reflection and the other good reflection
October 3, 2006
Page 6
Minimum distance between pits The combination = 7-fold increase Uses 650 nm laser 2. Second layer (~ x2) 8.5GB 3. Two-sides (x2) 17 GB
October 3, 2006 CS 219 Computer Organization and Architecture Page 7
4.7 GB
Input/Output Module
Communication between peripheral and the bus
Interface to CPU and Memory Interface to one or more peripherals
October 3, 2006
Page 8
October 3, 2006
Page 9
Announcements
Midterm exam
Oct. 17 (Tue) Midterm review session on Oct. 12 (Thu) The exam will be mixture of multiple choice and short answers Range: Chapter 1 ~ 8
Final exam range: chapter 9 and beyond
Chap 7. Continued
I/O techniques
Programmed
I/O occurs under the direct and continuous control of the requesting program
2.
Interrupt driven
Program issues I/O command and forgets until it gets interrupt for completion of the I/O
3.
October 3, 2006
Page 12
I/O Techniques I
Programmed I/O
CPU requests I/O operation I/O module performs operation I/O module sets status bits CPU checks status bits periodically I/O module does not inform CPU directly I/O module does not interrupt CPU CPU may wait or come back later
October 3, 2006
Page 14
Programmed I/O
CPU has direct control over I/O
Sensing status Read/write commands Transferring data
CPU waits for I/O module to complete operation Wastes CPU time
October 3, 2006
Page 15
I/O Commands
CPU issues address
Identifies module (& device if >1 per module)
October 3, 2006
Page 16
I/O Address
Two types
October 3, 2006
Page 17
Advantages
No special commands for I/O wide range of memory commands available programming CPU logic is simpler and cheaper more efficient
Disadvantages
memory address is used up by I/O (not that big a deal nowadays with 64 bit address)
October 3, 2006 CS 219 Computer Organization and Architecture Page 18
Memory Read/write lines + I/O command lines Special commands for I/O Limited set, e.g., IN, OUT Easy to identify from assembly program
Generally found on Intel processors Both Memory-mapped and Isolated I/O are in common use
October 3, 2006 CS 219 Computer Organization and Architecture Page 19
memory
I/O
1023
1023
October 3, 2006
Page 20
I/O Techniques II
Interrupt-Driven I/O
October 3, 2006
Page 22
October 3, 2006
Page 23
peripheral whilst CPU does other work 3. I/O module interrupts CPU (then wait) 4. CPU requests data 5. I/O module transfers data (by data bus)
October 3, 2006
Page 24
However, Interrupt-driven I/O still consumes a lot of CPU time Every data word must pass through the processor
October 3, 2006 CS 219 Computer Organization and Architecture Page 25
Slow
October 3, 2006 CS 219 Computer Organization and Architecture Page 27
Interrupt ACK
Uses vectored interrupt, too Module must claim the bus before it can raise interrupt
Only one module can raise the interrupt request line
After CPU ACKs, it places its vector on data line e.g. PCI & SCSI
October 3, 2006
Page 29
Multiple Interrupts
All the above 4 techniques can be also used for prioritizing multiple interrupts
Multiple lines: Each interrupt line has a priority. Processor picks one with highest priority. Software polling: by the polling order Daisy chain: order of chaining Bus arbitration: discussed in 3.4
Centralized vs. Distributed
October 3, 2006
Page 30
Example of I/O
Example - PC
Intel 80x86 has one interrupt line
Single Interrupt Request (INTR) Single Interrupt ACK (INTA)
For handling multiple devices, 80x86 based systems use a 8259A interrupt controller
Introduced in 1980, now part of Southbridge chipset 8259A has 8 interrupt lines For more than 8 modules: cascade of 8 chips for up to 64 modules
8259A accepts interrupts 8259A determines priority 8259A signals 80x86 (raises INTR line) CPU Acknowledges 8259A puts correct vector on data bus CPU processes interrupt
October 3, 2006 CS 219 Computer Organization and Architecture Page 33
Modes
Fully nested: fixed priority from 0 to 7 Rotating: same priority. Serve them in rotation Special mask: inhibit interrupt from certain devices
October 3, 2006
Page 34
October 3, 2006
Page 35
October 3, 2006
Page 36
DMA
October 3, 2006
Page 38
DMA Operation
1. CPU tells DMA controller: 1. Read or Write? 2. I/O Device address 3. Starting address of memory block for data 4. Amount of data to be transferred 2. CPU carries on with other work 3. DMA controller deals with transfer 4. DMA controller sends interrupt when
finished
October 3, 2006
Page 39
October 3, 2006
Page 40
DMA Function
Additional Module (hardware) on bus
Mimicking CPU Memory wouldnt notice the difference
October 3, 2006
Page 42
October 3, 2006
Page 43
DMA modes
Previous = Single-cycle mode
Bus REQ / ACK overhead for each word, resulting in performance drop.
October 3, 2006
Page 44
Page 45
Next class
More on I/O Chap 8. Operating System Support
October 3, 2006
Page 46