Input and Output

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/17

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards

Input/Output System

Enables the attachment of input and output devices to the processor

2
New cards

Examples of Input Devices

  • keyboards

  • mice

  • track balls

  • touch screens

  • musical instruments

  • cameras

  • environmental sensors

3
New cards

Examples of Output Devices

  • displays

  • printers

  • speakers

  • environmental actuators

4
New cards

Examples of Input-and-Output Devices

  • network interfaces

    • ethernet

    • WIFI

    • bluetooth

  • disks

  • audio cards

  • MIDI devices

5
New cards

Connecting I/O Devices

<p></p>
6
New cards

I/O Challenge 1 - Speed-Gap Challenge

I/O devices are often mechanical, and therefore run orders of magnitude slower than the CPU

So how can we ensure that the CPU is not slowed down when it interacts with I/O devices (e.g. when fetching data from the hard disk)?

  • We can’t afford to waste CPU cycles

(with very slow CPUs and very fast devices the problem can be reversed - any difference in performance is a problem)

7
New cards

I/O Challenge 2 - Device Diversity Challenge

Devices are extremely diverse, e.g

  • Diversity of data-access modes

  • Device-specific operations

  • I/O protocol

8
New cards

Diversity of Data-Access Models

  • Read-only or write-only or read-and-write

  • Access by the individual byte or by the block/ by the stream

  • Access randomly (like a disk) or sequentially (like a tape)

9
New cards

Device-Specific Operations

Change the resolution (only for screens), set the time (only for clocks), focus (only for cameras)

10
New cards

I/O Protocol

  • We may need to be concerned with potential data transfer errors (e.g. from electrical noise, wireless transmission errors)

  • Synchronous or asynchronous

11
New cards

Device Drivers

These are software plug-ins inside the operating system 

Their job is to abstract over device diversity by “grouping” sets of “somewhat similar” types of device; e.g.

  • Many devices can be made to “look like a mouse” to software 

  • All hard disks are “essentially the same”

12
New cards

Example Functions of Device Drivers

  • Registering a device with the OS and initialising it

  • Initiating data transfers to or from a device

  • Monitoring status events from a device

  • Managing device/ system shutdown

    • Ensuring that the OS doesn’t “stop” until all unwritten data is stored, and the device is left in a safe state)

13
New cards

Traditional Two-Fold classification of Device Types (and Device Driver Types)

  • character devices

  • block devices

14
New cards

Character Devices

Send and receive one byte at a time 

Classic example: the keyboard

15
New cards

Block Devices

Send and receive a multi-byte block at a time

Classic example: the hard disk:

<p>Send and receive a multi-byte block at a time</p><p>Classic example: the hard disk:</p>
16
New cards

Traditional Two-Fold Classification of Processor Support for I/O

  • Isolated I/O

  • Memory-Mapped I/O

17
New cards

Isolated I/O

  • The processor provides:

  • Dedicated physical pins for the connection of I/O devices, and

  • And dedicated instructions for doing I/O operations

  • Suited to simple devices

    • Having only a fixed set of special I/O instructions does not help much with device diversity

  • Example Intel x86 instructions

    • IN destination_register, port_address

    • OUT source_register, port_address

  • Port addresses are typically 8 bits: narrower than main memory addresses

<ul><li><p>The processor provides:</p></li></ul><ul><li><p>Dedicated physical pins for the connection of I/O devices, and</p></li><li><p>And dedicated instructions for doing I/O operations</p></li></ul><ul><li><p>Suited to simple devices</p><ul><li><p>Having only a fixed set of special I/O instructions does not help much with device diversity</p></li></ul></li></ul><ul><li><p>Example Intel x86 instructions</p><ul><li><p>IN destination_register, port_address</p></li><li><p>OUT source_register, port_address</p></li></ul></li><li><p>Port addresses are typically 8 bits: narrower than main memory addresses</p></li></ul><p></p>
18
New cards

Memory-Mapped I/O

  • Here, devices sit within the CPU’s linear memory address space

    • E.g. we might access the next keyboard character by reading from memory address 0x40000040

  • Simple, flexible programming model

  • Downside is that it adds complexity to devices

    • They need to understand larger addresses and to work at memory speeds

<ul><li><p>Here, devices sit within the CPU’s linear memory address space</p><ul><li><p>E.g. we might access the next keyboard character by reading from memory address 0x40000040</p></li></ul></li><li><p>Simple, flexible programming model</p></li><li><p>Downside is that it adds complexity to devices</p><ul><li><p>They need to understand larger addresses and to work at memory speeds</p></li></ul></li></ul><p></p>