P3L5 - I/O Management Flashcards
T/F: The execution of applications doesn’t rely ONLY On CPU and Memory
True! It relies on other hardware components as well
List some examples of I/O devices
Keyboards Microphones Displays Speakers Mice NIC Cards (Network Interface)
T/F: The device space is extremely diverse?
True
List the types of registers traditionally found within a device
- Command Registers
- Data Registers
- Status Registers
What is the purpose of command registers within a device?
CPU uses these to control the device
What is the purpose of the data registers in a device?
These are used by the CPU to transfer data in and out of the device
What is the purpose of the status registers in a device?
These are used by the CPU to understand what is happening on the device
_____ is basically the device’s CPU
microcontroller
How do devices interface with the rest of a system?
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
What does PCI stand for
Peripheral Component Interconnect
What is the purpose of PCI?
To connect all controllers of devices to the rest of the system
T/F: The PCI bus is the only possible interconnect that can be present in a system
False!
Operating systems support devices via ___ ___
device drivers
Device drivers are ___ ___ software components
device specific
Who is responsible for making drivers available for all the operating systems where a device will be used?
The device manufacturer!
List the high level groups of devices
- Block Devices
- Character Devices
- Network Devices
What types of devices are encompassed within block devices?
Disks – which operate at the granularity of blocks of data that are delivered to and from the device via the CPU
What types of devices are encompassed in character devices?
Keyboards – devices which work with a serial sequence of characters and support a get/put character interface
What types of devices are encompassed in network devices?
Devices which work with more of a stream of data chunks as opposed to blocks over network
On Unix-like systems, where do all devices appear as files?
/dev directory
Device registers appear to the CPU as ____ ____
Memory Locations
What is responsible for routing accesses to devices
The PCI controller
What is the portion of physical memory on the system dedicated for device interactions controlled by ?
Base Address Registers (BAR)
What is it called when a portion of physical memory on the system is dedicated for device interactions?
memory-mapped I/O
What is it called when CPU can access device via special instructions
I/O Port Model
What are the two routes that can be taken on the path from the device to the CPU
- 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
What is the downside of using interrupts when communicating between device/CPU
Interrupt handlers and the associated overhead
What is the pro of using interrupts when communicating between device/CPU
Interrupts can be triggered by the device as soon as the device has information for the CPU
What is the downside of using polling when communicating between device/CPU
Delay can be introduced based on when/how frequently the CPU polls
With just basic support from an interconnect like PCI, CPU can request operation from an I/O device using ______
programmed I/O (PIO)
When using PIO how does the CPU issue instructions to a device?
By writing into the command registers of the device
Name an alternative to PIO based communication
Direct Memory Access (DMA)
Describe how Direct Memory Access (DMA) works
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
T/F: Memory access takes more cycles than DMA configuration
False! DMA configuration takes many more cycles
List the steps of typical device access from a user process
- Use process makes a system call specifying appropriate operation
- kernel may do some preprocessing of the data/form data
- OS will invoke the appropriate device driver for the device
- Device will then perform action
Result is returned in the reverse order of events
T/F: It is not necessary to go through the the kernel to get to a device?
True! Known as Operating System Bypass
What part is the OS still involved in with operating system bypass?
Making device registers available to user process on create
What do you need to leverage OS bypass?
User-level drivers (a library)
Describe the difference between sync and async access
For synchronous operations the calling thread will block
With asynchronous operations the thread is allowed to continue as soon as it issues the request
What is the purpose fo the VFS layer?
Allows the OS to hide all details regarding the underlying filesystem(s) from the higher level consumers
The _____ abstraction represents the elements on which the VFS operates
File
For each file the VFS maintains a persistent data structure called an _____
inode
What is the purpose of an inode
To maintain a list of all data blocks corresponding to the file as well as other important information for that file
To help with certain operations on directories, linux maintains a data structure called a ____
dentry (directory entry)
The _____ abstraction provides information about how a particular filesystem is laid out on some storage device
superblock
T/F: The virtual file system data structures are hardware entities
False, they are software
What was the default filesystem in Linux until it was replaced?
the ext2 filesystem
What is the benefit of using inodes?
Easy to perform both sequential and random accesses to the file
What is the downside of using inodes?
There is a limit on the file size for files that can be indexed using inodes
What was one way to solve the issue of file size limits in inodes?
Use of indirect pointers!
What is the benefit of using indirect pointers
Allows us to use relatively small inodes while being able to address larger and larger files
What is the downside of using indirect pointers?
File access is slowed down
List some techniques that filesystems employ to minimize the accesses to disk and improve the file access overheads?
- Buffer Caches
- I/O scheduling
- Prefetching
- Journaling