chapter 36 - I/O devices Flashcards

(14 cards)

1
Q

What are the main components of classical system architecture and how are they connected?

A
  • CPU and RAM: Connected via a high-speed memory bus
  • I/O Bus: Connects medium-speed devices
  • Peripheral Bus: Connects slow-speed devices via interfaces like USB
  • High-speed devices → closer to CPU
  • Low-speed devices → further from CPU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why is hardware organized hierarchically in a computer system?

A

Due to physical and cost constraints:

  • fast buses must be short
  • slower buses allow many low-cost devices to connect
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a canonical device in OS design?

A

device used to explain how hardware interacts with software - not a real device

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

Describe the canonical protocol between OS and device using polling.

A

status(read only) - tells the OS wether device is busy/ready/done

command(write only) - tells the device what to do

data(read/write) - allows OS to send or receive dataw

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

what are the 2 components in any device - explain

A

hardware interface - registers and protocols used by the OS to control it - how the OS talks to the hardware

internal structure - hidden by the OS - includes: small CPU, RAM

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

what is the problem with polling

A

CPU keeps checking device status in a loop - This wastes CPU cycles + no other process can run

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

what is polling

A

OS keeps checking the status register in a loop

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

what is programmed I/O (PIO)

A

the CPU itself is doing all the reading/writing

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

how can interrupts help the polling problem

A

OS sends the command → puts process to sleep → runs other tasks

When the device finishes, it raises an interrupt

invoking an ISR to resume the waiting process - Interrupt Service Routine (ISR)

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

What is Direct Memory Access (DMA) and how does it improve performance?

A

DMA transfers data between memory and device without CPU involvement

  • CPU kjører prosess 1(før I/O starter)
  • DMA starter kopi av data fra minne til disk (c c c)
  • Disk starter I/O parallelt
  • CPU er fri og kjører prosess 2 mens DMA+disk jobber
  • Når I/O er ferdig, får prosess 1 CPU igjen

se figur i notater

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

Compare Programmed I/O (PIO) with DMA

A

PIO: CPU does all the copying, wasting cycles

DMA: a dedicated engine handles the copy, allowing CPU to multitask

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

What are the two main methods the OS uses to interact with devices?

A

Explicit I/O instructions — Special CPU instructions used to interact directly with device registers

Memory-mapped I/O — uses regular memory operations (load/store) to access device registers

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

What is a device driver and why is it important?

A

software that knows how to control a specific device – OS talks to the driver, not the hardware directly

allows the OS to be device-neutral

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

ID disk interface - uses 4 types of registers

A
  • Control
  • Command Block
  • Status
  • Error
How well did you know this?
1
Not at all
2
3
4
5
Perfectly