P3L5 - I/O Management Flashcards

1
Q

T/F: The execution of applications doesn’t rely ONLY On CPU and Memory

A

True! It relies on other hardware components as well

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

List some examples of I/O devices

A
Keyboards
Microphones
Displays
Speakers
Mice
NIC Cards (Network Interface)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

T/F: The device space is extremely diverse?

A

True

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

List the types of registers traditionally found within a device

A
  1. Command Registers
  2. Data Registers
  3. Status Registers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the purpose of command registers within a device?

A

CPU uses these to control the device

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

What is the purpose of the data registers in a device?

A

These are used by the CPU to transfer data in and out of the device

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

What is the purpose of the status registers in a device?

A

These are used by the CPU to understand what is happening on the device

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

_____ is basically the device’s CPU

A

microcontroller

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

How do devices interface with the rest of a system?

A

Via a controller that is typically integrated as part of the device packaging that is used to connect the device with the rest of the CPU complex via some CPU/device interconnect

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

What does PCI stand for

A

Peripheral Component Interconnect

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

What is the purpose of PCI?

A

To connect all controllers of devices to the rest of the system

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

T/F: The PCI bus is the only possible interconnect that can be present in a system

A

False!

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

Operating systems support devices via ___ ___

A

device drivers

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

Device drivers are ___ ___ software components

A

device specific

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

Who is responsible for making drivers available for all the operating systems where a device will be used?

A

The device manufacturer!

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

List the high level groups of devices

A
  1. Block Devices
  2. Character Devices
  3. Network Devices
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What types of devices are encompassed within block devices?

A

Disks – which operate at the granularity of blocks of data that are delivered to and from the device via the CPU

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

What types of devices are encompassed in character devices?

A

Keyboards – devices which work with a serial sequence of characters and support a get/put character interface

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

What types of devices are encompassed in network devices?

A

Devices which work with more of a stream of data chunks as opposed to blocks over network

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

On Unix-like systems, where do all devices appear as files?

A

/dev directory

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

Device registers appear to the CPU as ____ ____

A

Memory Locations

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

What is responsible for routing accesses to devices

A

The PCI controller

23
Q

What is the portion of physical memory on the system dedicated for device interactions controlled by ?

A

Base Address Registers (BAR)

24
Q

What is it called when a portion of physical memory on the system is dedicated for device interactions?

A

memory-mapped I/O

25
Q

What is it called when CPU can access device via special instructions

A

I/O Port Model

26
Q

What are the two routes that can be taken on the path from the device to the CPU

A
  1. Devices can generate interrupts to the CPU

2. CPUs can poll devices by reading their status registers to determine if they have some response/data fro the CPU

27
Q

What is the downside of using interrupts when communicating between device/CPU

A

Interrupt handlers and the associated overhead

28
Q

What is the pro of using interrupts when communicating between device/CPU

A

Interrupts can be triggered by the device as soon as the device has information for the CPU

29
Q

What is the downside of using polling when communicating between device/CPU

A

Delay can be introduced based on when/how frequently the CPU polls

30
Q

With just basic support from an interconnect like PCI, CPU can request operation from an I/O device using ______

A

programmed I/O (PIO)

31
Q

When using PIO how does the CPU issue instructions to a device?

A

By writing into the command registers of the device

32
Q

Name an alternative to PIO based communication

A

Direct Memory Access (DMA)

33
Q

Describe how Direct Memory Access (DMA) works

A

CPU still writes commands to the command register but the data movement is controlled by configuring the DMA controller to know which data needs to be moved from memory to the device, and vice-versa

34
Q

T/F: Memory access takes more cycles than DMA configuration

A

False! DMA configuration takes many more cycles

35
Q

List the steps of typical device access from a user process

A
  1. Use process makes a system call specifying appropriate operation
  2. kernel may do some preprocessing of the data/form data
  3. OS will invoke the appropriate device driver for the device
  4. Device will then perform action

Result is returned in the reverse order of events

36
Q

T/F: It is not necessary to go through the the kernel to get to a device?

A

True! Known as Operating System Bypass

37
Q

What part is the OS still involved in with operating system bypass?

A

Making device registers available to user process on create

38
Q

What do you need to leverage OS bypass?

A

User-level drivers (a library)

39
Q

Describe the difference between sync and async access

A

For synchronous operations the calling thread will block

With asynchronous operations the thread is allowed to continue as soon as it issues the request

40
Q

What is the purpose fo the VFS layer?

A

Allows the OS to hide all details regarding the underlying filesystem(s) from the higher level consumers

41
Q

The _____ abstraction represents the elements on which the VFS operates

A

File

42
Q

For each file the VFS maintains a persistent data structure called an _____

A

inode

43
Q

What is the purpose of an inode

A

To maintain a list of all data blocks corresponding to the file as well as other important information for that file

44
Q

To help with certain operations on directories, linux maintains a data structure called a ____

A

dentry (directory entry)

45
Q

The _____ abstraction provides information about how a particular filesystem is laid out on some storage device

A

superblock

46
Q

T/F: The virtual file system data structures are hardware entities

A

False, they are software

47
Q

What was the default filesystem in Linux until it was replaced?

A

the ext2 filesystem

48
Q

What is the benefit of using inodes?

A

Easy to perform both sequential and random accesses to the file

49
Q

What is the downside of using inodes?

A

There is a limit on the file size for files that can be indexed using inodes

50
Q

What was one way to solve the issue of file size limits in inodes?

A

Use of indirect pointers!

51
Q

What is the benefit of using indirect pointers

A

Allows us to use relatively small inodes while being able to address larger and larger files

52
Q

What is the downside of using indirect pointers?

A

File access is slowed down

53
Q

List some techniques that filesystems employ to minimize the accesses to disk and improve the file access overheads?

A
  1. Buffer Caches
  2. I/O scheduling
  3. Prefetching
  4. Journaling