An Introduction to Plan 9


Plan 9 is a distributed computing environment assembled from separate machines acting as terminals, CPU servers, and file servers. A user works at a terminal, running a window system on a bitmapped display. Some windows are connected to CPU servers; the intent is that heavy computing should be done in those windows but it is also possible to compute on the terminal. A separate file server provides file storage for terminals and CPU servers alike.

Name Spaces

In Plan 9, almost all objects look like files. The object retrieved by a given name is determined by a mapping called the name space . A quick tour of the standard name space is in namespace(4). Every program running in Plan 9 belongs to a process group (see rfork in fork (2)), and the name space for each process group can be independently customized.

A name space is hierarchically structured. A full file name (also called a "full path name" ) has the form /e1/e2/.../en, as in Unix.

There are a number of Plan 9 services available, each of which provides a tree of files. A name space is built by binding services (or subtrees of services) to names in the name-space-so-far. Typically, a user's home file server is bound to the root of the name space, and other services are bound to conventionally named subdirectories.

Plan 9 has "union directories" : directories made of several directories all bound to the same name. The directories making up a union directory are ordered in a list. When the bindings are made (see bind (1)), flags specify whether a newly bound member goes at the head or the tail of the list or completely replaces the list. To look up a name in a union directory, each member directory is searched in list order until the name is found. A bind flag specifies whether file creation is allowed in a member directory: a file created in the union directory goes in the first member directory in list order that allows creation, if any.

The glue that holds Plan 9 together is a network protocol called 9P , described in section 5 of the manual. All Plan 9 servers read and respond to 9P requests to navigate through a file tree and to perform operations such as reading and writing files within the tree.

Last update: Jul 25, 1996