Consider the following I /O scenarios on a single-user PC.
For each of these I/O scenarios,would you design the operating system to use buffering,spooling,caching,or a combination? Would you use polled I /O,or interrupt-driven I /O? Give reasons for your choices.
a.A mouse used with a graphical user interface
Buffering may be needed to record mouse movement during times when higher-priority operations ane taking place.Spool-ing and caching are inappropriate.Interrupt driven I/O is most
appropriate.
b.A tape drive on a multitasking operating system (assume no device preallocation is available)
Buffering may be needed to manage throughput difference between the tape drive and the source or destination of the I /O,Caching can be used to hold copies of data that resides on the tape, for faster access. Spooling could be used to stage data to the device when multiple users desire to read from or write to it.Interrupt driven I /O is likely to allow the best performance.
c.A disk drive containing user files
Buffering can be used to hold data while in transit from user space to the disk,and visa versa.Caching can be used to hold disk-resident data for improved performance.Spooling is not necessary because disks are shared-access devices.Interrupt-driven I/O is best for devices such as disks that transfer data at slow rates.
d.A graphics card with direct bus connection, acessible through memory-mapped I/O
Buffering may be needed to control multiple access and for performance(double-buffering can be used to hold the next screen image while displaying the current one). Caching and spooling are not necessary due to the fast and shared-access natures of the device.Polling and interrupts are only useful for input and for I/O completion detection,neither of which is needed for a memory-mapped device.