Generalized Input/Output

Many classical operating system calls for I/O can readily be generalized into a single call, say IO, with the following in out parameters:

io-port The internal name (number or handle) of the file or device that is the target of the operation.

operation A code specifying the operation to be carried out (read, write, etc.).

address The offset from the start of the file, of the byte string affected by the operation. Or some device address.

out-buf A pointer to a buffer containing data to be output.

out-len The number of bytes to be output.

in-buf A pointer to the buffer into which data must be input.

in-len The maximum number of bytes that may be input into the buffer.

Making the operation a parameter, rather than hard-wiring it into the system call name, adds important flexibility. For example, one can add support for new devices with new operations without having to add new system calls to the operating system.

A particular operating system will accept a particular set of operations when IO operates on files, and a particular subset of the other parameters will be interpreted in a particular way for each of these particular operations. Likewise, IO can be constrained and interpreted in particular ways for particular devices.

But this is not what this article is about. Below it will be shown that I/O operations, using IO, can sensibly be carried out on processes, and in such cases amount to an efficient but general form of IPC.

To perform an I/O operation on a process, one has to be able to ``open'' the process. That is, one must be able to assign an internal name to another process much like one assigns internal names to files and devices when opening them for use. How this can be achieved will be considered in a later section. For now, assume that when processes A and B are communicating then X is A's internal name for B, and Y is B's internal name for A. Also, the term ``port'' will henceforth be used instead of ``internal name''.


next up previous

Prof Herman Venter
Thu Apr 18 12:33:57 GMT 1996