next up previous
Next: XINU I/O Primitives Up: Input/Output Primitives Previous: Input/Output Primitives

Issues

There are several similarities between process-device communication and process-process communication. Therefore some of the issues we see here are reminiscent of those we saw in interprocess communication.

Synchronous vs Asynchronous

An I/O primitive is synchronous if it delays the process until the operation completes. Some other process may, however, utilize the CPU. It is asynchronous if it only initiates the operation and lets the process continue execution while the device performs the operation.

The arguments for and against these two kinds of primitives are similar to the ones we saw in interprocess communication. Synchronous communication is normally preferred because of its ease of use.

Device Dependent/Independent

Another issue is whether a general set of primitives be provided that may be used for all devices or if each device should be associated with its own set of primitives. Device Independent I/O promotes uniformity and allows one device to be substituted for another. Its disadvantage is that a general set of primitives may not fit the needs of a current or future device. For instance the operation seek is applicable to disks but not to terminals.

Binding Time Issues

A process refers to a device through a device descriptor. This descriptor needs to be bound to an actual device. This binding may take place at:

program writing time, if device descriptors are device addresses

system generation time, if device addresses refer to devices indirectly (via a table) that is initialized at system generation time

program start time, if the command interpreter does the binding

execution time, if the program or the operating system can change the binding at run time.

Early binding is efficient whereas late binding is flexible.

Pseudo Devices

An operating system often provides pseudo devices that are built on top of actual devices. For instance Unix-inspired operating systems provide files, which are pseudo devices built on top of a disk. NT also defines as pseudo devices filters that intercept I/O and network redirectors and servers. Supporting pseudo devices has the advantage that resources other than real devices can be accessed through a device-independent interface.

When pseudo devices are provided, device descriptors refer to both actual and pseudo devices.

Size of Data

When device independent I/O is provided, it is important to decide the increment of data transferred: byte or block. Some devices work with single bytes while others work with blocks. A general purpose OS will need to provide both kinds of sizes.


next up previous
Next: XINU I/O Primitives Up: Input/Output Primitives Previous: Input/Output Primitives



Prasun Dewan
Tue Feb 12 13:32:55 EST 2002