I/O (PPT 11-12) Flashcards

1
Q

What does input/output allow you to do?

A

It allows the computer to communicate with the world outside the box:

  • receive data and instructions from programs
  • allow output of processed results
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does I/O usually involve?

A

It usually involves:

  • Copying a large block of memory to another block
  • Copying a large block of memory to one address a chunk at a time
  • Copying from one address to a large chunk of memory one chunk at a time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Have I/O speeds increased over the years?

A

Yes, but barely. The I/O chip is attached to very slow things so can barely be increased

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Where must data be to be read?

A

Data must be in main memory, so external data must be read into main memory to be used

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are four of the many areas we must account for when using I/O?

A
  • Data rate
  • Unit of Transfer
  • Data representation
  • Error conditions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What size is a chunk in a I/O transfer?

A

Each chunk is the size of the data register

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What two areas must we consider when interfacing?

A

Output:
The CPU should only place new data in the data out register of the I/O chip when I/O is ready
Input:
The CPU should only attempt to read from the data in register when new data has been completely received

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the three main ways of doing I/O?

A
  • Polling
  • Interrupt-Driven I/O
  • Direct Memory Access
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Polling?

A

Polling is when the CPU constantly checks to see if the item in use is ready. If it is, it sends/receives data. If not, it waits and checks again until the item says it is ready

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the issue with Polling?

A

Polling can cause problems where multiple I/O channels are available, meaning it could miss some events while checking others

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the advantages and disadvantages with Polling?

A

Adv:

  • needs no hardware support
  • simple, easy to implement
  • easy to debug

Disadv:

  • very wasteful of CPU time
  • possible problems with multiple events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Interrupt Driven I/O?

A

An interrupt is a suspension of a process caused by an event outside of the process. The suspension is in such a way that the process can be resumed at a later point.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How does Interrupting work?

A

The CPU issues an I/O command then continues on executing other instructions. When the I/O device requires attention, it interrupts the CPU. The code for an interrupt is a special subroutine called an interrupt handler.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a multi-level interrupt?

A

This means that low priority interrupts can be interrupted themselves by higher level interrupts, such as by the disk drive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the advantages and disadvantages of Interrupt Driven I/O?

A

Adv:

  • more time efficient than polling, avoids the CPU having to repeatedly loop to test the status of a register
  • powerful way of handling multiple I/O devices

Disadv:
-overhead in handling interrupts, need to save an restore CPU status, this may take longer than handling the interrupt itself
-hardware needed to support interrupts
-difficult to debug an interrupt scheme
still requires the active intervention of the CPU to do the actual data transfer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is Direct Memory Access?

A

DMA are essentially single purpose processors which can only read/write. They can access buses but are not programmable and are cheaper than a CPU.

17
Q

What happens when a CPU wants to read/write when using a DMA?

A
  • I/O operation is delegated to DMA
  • DMA is initialised with details of the transfer
  • DMA device moves data directly to or from memory, without going to the CPU
  • The CPU can continue with other processes
  • When transfer is complete, CPU is interrupted by the DMA to close the transfer
18
Q

What data does the DMA need to be delegated to?

A
  • whether it is a read or write which is required
  • the starting location in memory to write to or read from
  • the amount of data to be written or read
  • the address of the I/O device involved
19
Q

What is cycle stealing?

A

This is when the DMA module takes control of the system bus every so often. This is because the DMA is given a higher priority for taking control of the bus than the CPU. During this stolen cycle, the DMA module transfers one word of data

20
Q

What are the effects of cycle stealing?

A

There is a minor effect to CPU performance as the CPU gets most of what it needs from its own memory caches. Also, for most stolen cycles, the CPU doesn’t need the system bus anyway and the DMA transfer is faster than the CPU and interrupts method

21
Q

What are the advantages and disadvantages of DMA?

A

Adv:

  • very efficient at transferring a larger block of data to or from memory
  • the CPU’s time is not wasted - it is only involved at the beginning and end of the transfer

Disadv:

  • additional hardware chips are required
  • not efficient when transferring only a few bytes of data
22
Q

What is I/O Buffering?

A

This is a way that the I/O of a process can be performed at the same time as the computations of that process. It performs tasks in parallel and smooths out fluctuations in I/O demand

23
Q

How does I/O Buffering work?

A

The OS sets aside an area of main memory called a buffer. During I/O, data can be temporarily stored in the buffer. For input, after the process gets the data from the buffer and starts processing it, the I/O device can start filling it again straight away.

24
Q

What are the effects of I/O buffering?

A
  • Both I/O and CPU are working at full capacity
  • As work is done at the same time, I/O and the process wait less
  • Either the process or I/O device can run ahead of the other, smoothing out the fluctuations in I/O demand
25
Q

What is Double Buffering?

A

This is when two buffers are used per data transfer. The “Read from buffer” and the “fill buffer” operations switch between the two buffers alternately. This technique is better for block oriented data transfer

26
Q

Can read and write processes overlap?

A

Yes they can, leading to an increased overall time to do the two processes

27
Q

What could vary when actually processing a block?

A

Process may have different processes to run on each block

The OS will be running many processes so actual time to process may vary depending on loads on the OS and I/O systems