I/O, Interrupts, and Device Drivers Flashcards

(20 cards)

1
Q

I/O overview

A

Look at I/O mechanisms
– How we implement and control access to devices
– Clocks and Timers
* Used to control and synchronise operations

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

Memory Mapped I/O

A

I/O devices visible as memory addresses
– Easily accessed using C point

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

Isolated I/O

A

Separate bus for I/O devices
– Easier interfacing: distinct from high-speed memory bus
– Accessed via special instructions
* Generally not supported by compilers (must use assembler)

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

Optimising Memory Use

A

Buffers used to smooth I/O operations.

Input/Output buffers allow CPU and devices to work asynchronously.

Status registers track readiness and availability.

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

Direct Memory Access

A
  • Alternative to programmed I/O
  • Relieves CPU of data transfer (improving speed and reducing load)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Clocks & Timers

A

RTC (Real-Time Clock): Tracks real-world date/time.

PIT (Programmable Interrupt Timer): Generates regular interrupts for periodic tasks

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

Efficient Timer Use

A

Instead of constant intervals, set timers to fire when the next task is due.

Saves CPU time, improves responsiveness.

Used in OS scheduling and simulation systems.

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

What is an Interrupt?

A

A signal to the CPU that an event needs attention.

Temporarily halts the current process, handles the event, then resumes.

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

Types of Interrupts

A

Hardware
Triggered by I/O devices (e.g., keyboard, disk)
Software
Triggered by programs (e.g., divide by zero)
Timer
From a system clock (e.g., every 10ms)
System Calls
Controlled interrupts to switch to kernel mode

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

Why Interrupts Matter

A

Efficient I/O: Devices notify CPU when ready.

Multitasking: Timer interrupts help switch processes.

Responsiveness: Quick reaction to user input or errors.

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

Maskable vs Non-Maskable

A

Maskable: Can be disabled (e.g., during critical sections).

Non-Maskable: Always handled (e.g., serious hardware failures).

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

Context Switching

A

Caused by timer or I/O interrupt.
CPU saves current process and loads another (for multitasking)

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

Polling

A

CPU repeatedly checks (polls) each device to see if it needs attention.

cons: Inefficient – wastes CPU time checking idle devices.
pros:
No need for interrupts

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

Nested Interrupts

A

A higher-priority interrupt can interrupt a currently running ISR (Interrupt Service Routine).
cons: More complex to manage.
pros:
Improves system responsiveness to critical tasks.

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

Device drivers

A

Extensible model
– Create new drivers as needed to control hardware/ devices
– Dynamically loadable modules allow run-time c

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

Unix Device Driver Interface

A

Unified, file-like interface using standard functions:

open(), read(), write(), ioctl(), mmap(), close(),

17
Q

Device Driver Table

A

Maintains function pointers for each supported operation.

Devices may leave unsupported operations as null or error.

18
Q

Tasks Performed by Drivers

A

I/O scheduling (e.g. reordering disk operations).

Buffering, spooling, caching.

Error handling.

I/O protection (prevent unauthorized access).

19
Q

Single vs Multi-instance Devices

A

Single-instance: Only one process can use the device at a time (e.g. printer); use spooling.

Multi-instance: Can serve many processes concurrently (e.g. keyboard input).

20
Q

Unix I/O System Architecture

A

Treats everything as a file: plain files, devices, sockets.

Uses cooked (processed) and raw (direct) modes:

Cooked: e.g. line-based input editing.

Raw: e.g. direct disk block access including metadata.