1/40
seems ok
What is an I/O port?
A connection point between a machine and a device, where the port number is an I/O address
What is an I/O controller?
Something that operates a port, a bus, and/or an I/O device, typically acting as an interface between the bus and the device
What is a chipset?
A set of components in an integrated circuit that manages data flow between the CPU, memory, and peripherals
Where is a chipset usually found?
On the motherboard
What is port-mapped I/O?
I/O that uses special in and out instructions and requires the port number of the I/O device
What is memory-mapped I/O?
I/O that uses lw and sw instructions, with I/O devices mapped to memory addresses
What are the four types of I/O commands?
Control, Test, Read, and Write
What does the Control I/O command do?
Tells a device to do something
What does the Test I/O command do?
Checks the status of a device
What does the Read I/O command do?
Gets data from the device
What does the Write I/O command do?
Sends data to the device
Why can displaying a single character involve several I/O commands?
Because the program may need to check status, send control information, and write the character data
What is the typical I/O programming call chain?
User program calls an I/O library routine, which calls an OS system call, which calls the appropriate device driver routine
Why does the OS control access to I/O devices?
To prevent misuse of I/O devices
What is a device driver?
A routine provided by the I/O device vendor that the OS calls to interact with the device
Who needs to know the internal details of interacting with an I/O device?
Only the device vendor, while the OS defines the interface
What are the two general ways to control I/O?
Polling and interrupts
What is polling?
The CPU constantly checks the status of the I/O device
When polling for input, what is the CPU looking for?
When data is ready
When polling for output or other commands, what is the CPU looking for?
A transition from busy to available
What is a disadvantage of polling?
The CPU is busy waiting and is not doing useful work while constantly checking the device
What is an interrupt?
A change in the flow of execution that is external to the program, typically related to an I/O event
What is the INT line?
A CPU input line that allows I/O devices to interrupt the CPU
What is the INTA line?
A CPU output line that acknowledges interrupts
When can an I/O device interrupt the processor?
When data is available to transfer or when an I/O request is complete
What is the basic interrupt flow?
An I/O device triggers an interrupt request, the CPU receives it, the CPU suspends the current program to handle the interrupt, and then resumes the program where it left off
What happens after the CPU acknowledges an interrupt?
The device controller puts a small integer called the interrupt vector on the system bus data lines
What is an interrupt vector?
A small integer that corresponds to the type of interrupt
What does the CPU save on the stack when handling an interrupt?
The current values of the PC and other inaccessible system registers such as the status word
What is an interrupt vector table?
A table stored in memory that stores the starting addresses of interrupt service routines
How does the CPU use the interrupt vector?
The CPU uses the interrupt vector as an index into the interrupt vector table
What is a bottleneck?
A component or resource that limits overall system performance
What are three strategies for improving performance?
Improving inefficient implementations, optimizing for the common case, and reducing sharing delays
What does improving inefficient implementations mean?
Replacing poor algorithms or code with more efficient approaches to reduce wasted work and overhead
What does optimizing for the common case mean?
Making the most frequent path fast rather than spending effort equally on rare cases
What does reducing sharing delays mean?
Reducing waiting caused by contention for shared resources so that work spends less time blocked
What is Amdahl's law?
Speedup is limited by the fraction of execution time that can be improved, using speedup = 1 / ((1 - f) + f/s)
In Amdahl's law, what does f represent?
The fraction of execution time that can be improved
In Amdahl's law, what does s represent?
The speedup of the improved portion
According to Amdahl's law, what is the maximum speedup as s becomes very large?
1 / (1 - f)
Why is Amdahl's law important for performance work?
It shows that improving only a small part of execution cannot produce unlimited overall speedup