i/o systems and connections

16
I/O Systems and Connections Disk, Graphics Display, Printer, Mouse, Keyboard,.... The Interface (See Chapter 8)

Upload: kishi

Post on 06-Jan-2016

29 views

Category:

Documents


0 download

DESCRIPTION

I/O Systems and Connections. Disk, Graphics Display, Printer, Mouse, Keyboard,.... The Interface (See Chapter 8). Main Memory. System Architecture. interrupts. Processor. Cache. main bus. I/O Controller. I/O Controller. I/O Controller. Graphics display. Keyboard. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: I/O Systems and Connections

I/O Systems and Connections

Disk, Graphics Display, Printer, Mouse, Keyboard,....

The Interface

(See Chapter 8)

Page 2: I/O Systems and Connections

System Architecture

Processor

Cache

I/OController

I/OController

I/OController

Main Memory

Graphicsdisplay

Keyboard

main bus

interrupts

Page 3: I/O Systems and Connections

Types of I/O Devices

Behaviour• input, output, storage

Partner• human or machine

Data rate• peak rate at which data can be sent to

main memory or to processor

Page 4: I/O Systems and Connections

Examples

Device Behaviour Partner Data Rate KB/seckeyboard input human 0.01Mouse input human 0.02LaserPrinter output human 100Graphics output human 30,000Floppy disc storage machine 50Magnetic disc storage machine 2,000

The system architecture and bus communications system must accommodate an enormous variety of “peripheral” devices, with huge differences in performance.

Page 5: I/O Systems and Connections

Magnetic Discs

Rotating platters coated with magnetic surface• 2 to 20 platters• rotation at about 5000 RPM

Divided into (~2000) concentric circles (tracks)

Each divided into sectors (32-128) The sector is like a “block” or “page” - it

is the fundamental unit of a transaction.

Page 6: I/O Systems and Connections

Disk Performance

Arms move across rotating platters, reading or writing information.

Seek time• the arm locating the proper track

rotational latency• getting to right sector

– At 5,000rpm, each rotation takes 200 microseconds (s)– In 200s a 500MHz CPU executes 100,000 cycles!

transfer time• time to transfer the sector of information

– A 2KB page might take 1 second (s)– In 1s a 500MHz CPU executes 500,000,000 cycles!

Page 7: I/O Systems and Connections

Role of the Operating System

The OS acts as an interface between the hardware and the program requesting I/O

Responsibilities of OS include• equitable sharing of i/o between many

programs using the CPU• handling “interrupts” generated by the i/o

controllers• managing the many detailed concurrent

events that must be processed consistently.

Page 8: I/O Systems and Connections

From Processor to Device

Two main methods for the processor to give commands to a device• memory mapped

– involves the processor writing information to reserved segments of memory that the i/o controller examines and interprets as commands

– good example of this is graphics display.

• special i/o instructions– communicating commands directly over the bus

Page 9: I/O Systems and Connections

From Device to Processor

Two main methods for the device to communicate requests to processor• polling

– the device places information in special registers that the processor samples at regular intervals to see if anything has changed

• interrupts– The device sends a special signal to the processor,

which can continue to execute the current instruction, and then hand control over to the OS to service the interrupt.

Page 10: I/O Systems and Connections

Memory - Device Interface

Transfer of data between memory and device can also use polling or interrupts, relying on CPU to manage this through the OS.• cost can be extremely heavy for transfers of

very large amounts of data (eg, a sector) between disk and main memory.

In practice Direct Memory Access is used.

Page 11: I/O Systems and Connections

Direct Memory Access (DMA) Data is transferred between memory and disk

directly without involving the processor.• Interrupt still tells CPU when such a transfer has

started and finished. DMA involves

• CPU tells the DMA controller operation to perform and addresses involved.

• DMA controller then carries out the operation without bothering the CPU - arbitrates for the bus.

• Informs the CPU when complete.

Page 12: I/O Systems and Connections

Buses - Connecting all together Bus is a set of wires that forms a shared

communications link between the various subsystems. (Control+data lines).

Three types of buses:• processor-memory

– short, high-speed, specialised for max. memory-processor communications

• I/O bus– long, many different types of device.

• backplane (literally built into chassis)– processor, memory, & devices coexist on a single bus.

Page 13: I/O Systems and Connections

Bus Timing

Synchronous• Controlled according to clock cycle counts in

the control lines + a fixed protocol for commands.

• Requires every device on the bus to run at same speed

Asynchronous• Not clocked• control by “handshaking”

Page 14: I/O Systems and Connections

Accessing the Bus

Many devices simultaneously competing for the bus - to send or receive data.

Bus arbitration is the means whereby a “bus master” gains control temporarily over the activities on the bus.

Several schemes whereby bus arbitration may be resolved - all based on notions of priority.

Page 15: I/O Systems and Connections

Bus Standards

Characteristic VME IPI SCSItype backplane I/O I/Odata width 16-32bits 16 8bus masters multiple single multipleClocking Asynch Asynch Eitherbandwidth 12.9 MB/s 25MB/s 5 or 1.5 MB/smax devices 21 8 7max length 0.5m 50m 25m

IPI = Intelligent Peripheral InterfaceSCSI = Small Computer Systems Interface

Page 16: I/O Systems and Connections

THE END

This is the end of the formal material Still to come:

• Recap and revision• Past papers