Download presentation
Presentation is loading. Please wait.
Published byHector Holmes Modified over 8 years ago
1
ECE 456 Computer Architecture Lecture #9 – Input/Output Instructor: Dr. Honggang Wang Fall 2013
2
Lecture #9 Memory Lectures L#4-8 (Review) CPU CACHECACHE MAIN MEMORY I/O STORAGE DEVICES Registers Internal Memory External Memory OS level Not real Defer to CPU discussion VIRTUAL MEMORY Memory Hierarchy * Performance Imbalance * Principle of Locality * Error correction (SEC)
3
Lecture #9 A Computer System (Agenda) Memory Input /Output Central Processing Unit Interconnection Bus Computer history (L#1) Computer architecture = von Neumann architecture + interrupts (L#2) L#4 ~ 8 L#3 L#9, 10 L#11, 13 ~ 22 Parallel organizations: SMP, Clusters, NUMA, Vector/Array Processors L#23 ~ 24
4
Lecture #9 Topics I/O system structure Virtual I/O
5
Lecture #9 I/O System Structure (1) Problems with direct connection Wide variety of peripherals –with different operation methods –at different transfer rates (Next Slide) –in different formats Need I/O modules!!
6
Lecture #9 I/O System Structure (1): problems with direct connection Typical Peripheral Device Data Rates
7
Lecture #9 I/O System Structure (2) I/O module –interface to CPU and memory –interface to one or more peripherals –other names I/O channel I/O processor I/O controller device controller
8
Lecture #9 Agenda
9
Lecture #9 External/Peripheral Devices Human readable –suitable for communicating with users –screen/monitor, printer, keyboard Machine readable –suitable for communicating with equipments –magnetic disk and tape, CD Communication –suitable for communicating with remote devices –modem, network interface card (NIC) External Devices (1)
10
Lecture #9 External Device Block Diagram Decide function to perform: read/write report status etc. (data converter) External Devices (2) Control device’s operation in response to command from I/O module
11
Lecture #9 I/O Module Functions (1) Steps involved in the data transfer from a peripheral to the processor –CPU interrogates I/O module to check device status –I/O module returns device status status reporting –If ready, CPU requests data transfer by issuing a command to I/O module command decoding –I/O module gets data from device –I/O module transfers data to CPU Functions & Structure of the I/O Module (1)
12
Lecture #9 I/O Module Functions (2) Control & timing CPU communication –status reporting, command decoding, data, and address recognition Device communication –status, control, and data Data buffering Error detection –mechanical/electrical malfunctions reported by devices –error detecting codes Functions & Structure of the I/O Module (2)
13
Lecture #9 I/O Module Structure Functions & Structure of the I/O Module (3)
14
Lecture #9 Agenda
15
Lecture #9 External I/O Interface (1) Parallel interface –multiple lines connecting the I/O module and the peripheral –multiple bits are transferred simultaneously –requires multiple wires /connectors, shielding to prevent electrical interference; synchronization costly, short-distance communication
16
Lecture #9 External I/O Interface (2) Serial interface –only one line connecting the I/O module and the peripheral –one bit is transferred at a time –slower than parallel interfaces, but no shielding & synchronization needed low cost, long-distance communication
17
Lecture #9 External I/O Interface (3) - Examples IEEE-1394 Firewire (Ch 7.7) Infiniband (Ch 7.7)
18
Lecture #9 Agenda
19
Lecture #9 Virtual I/O (1) OS provides I/O services to user programs in the form of opening, reading, writing, and closing files -- file I/O, virtual I/O A file consists of a sequence of bytes or records written to an I/O device –each file with some particular kind of data –different files with different properties
20
Lecture #9 Virtual I/O (2): File Properties
21
Lecture #9 Virtual I/O (3) Virtual I/O (file I/O) is done by system calls –Open (name, mode): open or create a file and return a file descriptor (fd) –Close (fd): close a file indicated by fd –Read (fd, buffer, count): read count bytes of data from the file into a buffer in memory –Write (fd, buffer, count): write count bytes of data from the buffer into the file –Chmod (name, mode): change the protection mode of a file
22
Lecture #9 Virtual I/O (4) File Implementation Keeping track of which disk blocks go with a file –Continuous allocation –Linked-list allocation –Linked list allocation using an index
23
Lecture #9 Continuous Allocation Store a file as a continuous block of data on the disk Pros and cons: –simple to implement, simple block administration (the address of the first block) –excellent performance –infeasible if the maximum file size is unknown at the time of creation –fragmentation of the disk Virtual I/O (5) – File Implementation
24
Lecture #9 Linked-List Allocation Each allocation unit (block) contains the address of its successor Random access is extremely slow Virtual I/O (6) – File Implementation
25
Lecture #9 Linked-List Allocation Using an Index (1) Virtual I/O (7) – File Implementation
26
Lecture #9 Linked-List Allocation Using an Index (2) Drawback: huge tables must be maintained in main memory Example: –With a large disk, 16M 1K blocks (16 GB), the table will have 16M entries, each entry will have to be a minimum of 3 bytes. Thus the table will take up 48MB space. –So generally the OS using this mechanism uses large blocks on large disks to avoid the huge index tables. Virtual I/O (8) – File Implementation
27
Lecture #9 Bit map: each location unit has a bit indicating it is available or not –Size is constant –Easy to update –Hard to find a block of a given size Keep Track of Available Blocks Free list: contains all the holes (continuous allocation units) –Easy to find a hole of a particular length –Size is variable Virtual I/O (9) – File Implementation Track#Sector##of sectors in hole 005 062 108 211 233 271 303 0 0 0 0 0 1 0 0 1 0 0 0 11110 01001 00000 00100 54376210 3 2 1 0 Sector # Track #
28
Lecture #9 Hands-On Problem For the following Bit Map that indicates the available sectors on a disk, give the corresponding Free List format
29
Lecture #9 Directory Management Files are grouped into directories Directories are organized into hierarchy A UNIX directory tree Managed via system calls –Create: mkdir –Delete: rmdir –Open: ls –Rename: rename –Etc. Virtual I/O (10)
30
Lecture #9 Summary of Lecture #9 I/O system structure –External / peripheral devices –Function and structure of I/O modules –External I/O interface between peripheral and I/O module parallel and serial Virtual I/O –File, 3 file storage allocation policies, free list and bit map methods to keep track of available blocks –Directory management
31
Lecture #9 Things To Do Check out the class website about –lecture notes –reading assignments
32
Lecture #9 External I/O Interface (3) - Examples IEEE-1394 Firewire (Ch 7.7) Infiniband (Ch 7.7) USB (Universal Serial Bus)
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.