Input/Output Management Flashcards
What is the purpose of I/O devices?
I/O devices enable computers to receive or output information to humans or devices.
Give three examples of I/O devices.
- Human interface devices (e.g., monitors)
- Storage devices (e.g., disks)
- Transmission devices (e.g., network cards)
How are I/O devices operated?
I/O devices are operated using controllers (embedded processors).
What is the role of controller registers?
The CPU communicates with the controller by reading and writing to the controller’s registers.
What are the two types of I/O access methods?
- Port-based I/O
- Memory-mapped I/O
Which I/O access method is more common today?
Memory-mapped I/O is today much more common than port-based I/O.
What are the two approaches to control in I/O management?
- Polling
- Interrupts
Describe polling in I/O management.
The CPU repeatedly checks the controller’s status register to see whether the controller is busy. When the controller is ready and the CPU wants to give new instructions, the CPU writes to the data-out register and signals that is has done so through the control register.
What happens when the CPU receives an interrupt signal?
The CPU stops the current process and initiates a response.
Compare polling and interrupts.
With interrupts, the CPU can monitor several devices at the same time; with polling, the CPU checks each device individually in a round robin fashion.
When might polling be more efficient?
- The controller and the device are fast
- The I/O rate is high
- Some I/O data can be ignored
- The CPU has nothing better to do
What is Direct Memory Access (DMA)?
DMA allows a CPU to offload large data transfers to a DMA controller, which can perform multiple transfers via a single command.
What is a system call?
A system call is a request of a kernel service.
What are the types of system calls for I/O devices?
- Character I/O
- Block I/O
- Network I/O
What are examples of character I/O devices?
- Keyboards
- Computer mice
- Microphones
- Speakers
What is the primary characteristic of block I/O devices?
Block devices are used to transfer blocks of data and are typically non-volatile mass storage devices. They are high volume devices and include read and write operations
What is a memory-mapped interface in block I/O?
It provides access to disk storage via a location in main memory, mapping a file on the device into memory.
What operations are included in network I/O?
- Creating and connecting sockets
- Sending and receiving packets
- Checking transfer success
True or False: Network I/O devices are less prone to issues than other I/O devices.
False.
The main difference between network I/O devices and other I/O devices is that with network I/O devices things routinely go wrong (missing packets, etc.).
What is the difference between port-based and memory mapped I/O
port-based separates memory and I/O operations and address space while memory mapped does not.
Where does the CPU get an interrupt signal from
an interrupt request line
How does the DMA let the CPU know when the transfer is complete
the CPU receives an interrupt from the DMA controller
What is user mode used for
application programs; plain instructions
What is kernel mode used for
system functions; privileged instructions
How are characters I/O processed
in the order that they arrive in the stream
What are character devices
they are low volume devices
Explain memory mapped I/O
In this case, the device-control registers are mapped into the address space of the processor. The CPU executes I/O requests using the standard data-transfer instructions to read and write the device-control registers at their mapped locations in physical memory.
Explain special I/O instructions
specify the transfer of a byte or a word to an I/O port address. The I/O instruction triggers bus lines to select the proper device and to move bits into or out of a device register.
What does a DMA command block contain that has been written into memory
This block contains a pointer to the source of a transfer, a pointer to the destination of the transfer, and a count of the number of bytes to be transferred.
What does memory mapped files do
reduce the number of mode switches
What is the benefit of memory mapped I/o instruction wise
The more instructions the complex the intructions are, the more bits you need. Therefore memeory mapped i/o there are less instructions which is better
What is the bus analog for interrupts vs polling
Polling: at every stop the bus driver(cpu) has to ask every passenger if we need to stop
Interrupts: stops only when it is singaled to rather than cehcking every passenger every time. Therefore quicker
With interrupts the driver can manager all pasengers at the same time. Ther driver can focus more on driving the bus - therefore freed up to focus on other tasks.
Why is interrupts more efficient
monitor the status of several devices at the same time, and serve them based on priority.