binghamton cs-311 university
TRANSCRIPT
Binghamton
University
CS-311
Fall 2020
1
Binghamton
University
CS-311
Fall 2020
Motherboard
• The main printed circuit board in your computer
• Contains (typically)• CPU (Microprocessor Chip)
• RAM/ROM chips
• Power Management
• Cooling Fan
• Slots for Hard Drives
• Network Connection ports
• Busses to carry data between everything
• Expansion slots to add new stuff
2
Binghamton
University
CS-311
Fall 2020
What More?
3
RAM
Binghamton
University
CS-311
Fall 2020
Typical Peripheral Devices
• Persistent Memory• Paper Tape, Punch Cards, Tape Drives, Disk drives, USB drives, Cloud storage
• Input from User• Text: Punch Cards, Keyboard, Microphone (Speech to Text)• Location: Mouse, Joystick, Touchpad, Touchscreen, Video Camera• Audio/Visual: Microphone, Video Camera
• Output to User• Text: Printer, Teletype, Monitor• Audio/Visual: Graphics Printer, Monitor, Speaker, earphones, VR Goggles
• I/O to the rest of the world• Modem, ethernet, WWW, IOT (Thermostat, Refrigerator, … )
4
Binghamton
University
CS-311
Fall 2020
Categorizing Peripherals
Input From User Output to User Persistent Memory Network
Human Readable Keyboard Printer, Monitor Punch cards?, Scanned documents?
Machine Readable* Mouse, Game controller
Disk Drives, USB drives,
Modem, ethernet
5
*Textbook also has "communication", but communication is a subset of Machine Readable.
Chap 11.1
Binghamton
University
CS-311
Fall 2020
Data Rate Variance
6
Binghamton
University
CS-311
Fall 2020
Device I/O Basics: Stream I/O
• A one directional ordered list of bytes• Input Stream or Output Stream
• Ordering is almost always by time
• Timing is "Asynchronous" – independent from CPU cycles
• Transmission is typically serial – 1 bit at a time
• Need 8 bits to read or write 1 byte• Internally, use an 8-bit bus
• Extra bits may be used for control signals
• A stream may be "open" or "closed"
7
Binghamton
University
CS-311
Fall 2020
Early Peripherals: Tape Drives
8
• Required manual mounting of tape
• Good sequential access• Slow "direct" access• Origin of the "stream" of
bits/bytes concept
Binghamton
University
CS-311
Fall 2020
Early Peripherals: Teletype
9
• Two Streams:• User types – input stream• Computer types – output
stream• User data not sent until "enter"• Prototype for "terminal window"
By ArnoldReinhold - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=31105488
Binghamton
University
CS-311
Fall 2020
Device I/O Basics: Ports
• A "port" is a place where data from the outside world can be delivered to or from your computer
• Typical ports on a PC include:• VGA (Video Graphic Array) – 15 pin analog graphic interface
• Serial Port – 9 pin old interface for printers – 1 bit at a time ~100kbps
• Parallel Port – 25 pin interface – multiple bits at a time ~150kbps
• USB – Universal Serial bus port - ~14mbps, may include power
• Ethernet – 10mbps – 100mbps based on network bandwidth
• Others: Speaker/Earphone, microphone, power, etc.
10
Binghamton
University
CS-311
Fall 2020
Device I/O Basics: Block (Buffered) I/O
• A one directional ordered list of blocks of bytes• block size is a multiple of bytes
• Input or Output
• Ordering is almost always by time
• Timing is "Asynchronous" – independent from CPU cycles
• Think of as a "stream" of blocks of bytes
11
Binghamton
University
CS-311
Fall 2020
Stream to Block
12
Stream byte
64 byte buffer
Binghamton
University
CS-311
Fall 2020
Stream to Block
13
Stream
block
byte
64 byte buffer
Binghamton
University
CS-311
Fall 2020
Block to Stream
14
Streamblock
byte
byte
64 byte buffer
Binghamton
University
CS-311
Fall 2020
Hard Drive Technology
15
• Moving away from the concept of "mountable" storage
• "Direct" access – every byte is less thanone rotation away
• Almost always used to "stream" data• More reliable than tape
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 1
16
Device CPU Memorybus
data
control
Chap 11.2
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 2
17
Device CPU Memorybus
data
control
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 3
18
Device CPU Memorybusdata
control
Interrupt
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 4
19
Device CPU Memorybus
control
Interrupt
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 5
20
Device CPU Memorybus
control
Interrupt
Binghamton
University
CS-311
Fall 2020
I/O Evolution : Phase 6
21
Device CPU Memorybus
control
Interrupt
Binghamton
University
CS-311
Fall 2020
I/O Organization : Logical vs. Physical
Logical
• High level user friendly:open/close/read/write/seek
• Same for every device
• Just a few system calls
• Synchronous blocking
• Abstract dir/file concepts
Physical
• Low level physical device commands
• Different for each device
• ↑ device cmds per system call
• Asynchronous interrupts
• Concrete disk addr/block
22
Chap 11.4
Binghamton
University
CS-311
Fall 2020
Other Topics
• I/O Buffering
• Asynchronous I/O Models
• Disk Cache
• Disk Scheduling
• Files • File Management Systems• Directories• Protection/Sharing/Record blocking• File Organization / access• Secondary Storage Mgmt• UNIX/Linux inodes
• Error Detection and Correction
• RAID
23
Chap 12
Chap 11.4-9