OSLab: Module 6 - Clients and Servers
Module 6 is an example of processes can be implemented as clients and servers in an operating system. The module also illustrates two types of interprocess communication: connection-oriented and connectionless.
Connection-oriented communications are illustrated using a simple window manager; all communications between the window manager and any process requiring window-based I/O must take place using the primitives open(), close(), read(), and write().
The call to a primitive causes a message to be created; for example, a call to open() results in an OPEN_REQUEST message being sent from the process (the client) to a server (such as the window manager). If the server can support the request, it returns a message with the response code OPEN_RESPONSE.
Communications can continue using read()s and write()s. Each message that is sent by the client is acknowledged by the server. When no further messages need be sent, the client can close() the communication channel.
Connectionless communications are those that maintain little or no state. In Module 6 this is illustrated by the time manager process, which can be called using send() with a time request. The time manager responds with the current time of day (the time manager has provision for supporting the current date, although this is not implemented).
The .H (header) files contain data structures required for this module and the devices. The .C files contain the source code for:
No changes are made to the kernel in this module, since all communications take place atop send() and receive().