3 intro \- introduction to Plan 9
5 Plan 9 is a distributed computing environment assembled from
6 separate machines acting as terminals,
7 CPU servers, and file servers.
8 A user works at a terminal, running a window system on a raster display.
9 Some windows are connected to CPU servers; the intent is that heavy computing
10 should be done in those windows but it is also possible to compute on the terminal.
11 A separate file server provides file storage for terminals and
14 In Plan 9, almost all objects look like files.
15 The object retrieved by a given name is determined by a mapping called the
17 A quick tour of the standard name space is in
19 Every program running in Plan 9 belongs to a
25 and the name space for each process group can be independently
28 A name space is hierarchically structured.
29 A full file name (also called a
30 .IR "full path name" )
33 .RI / e1 / e2 /.../ en
35 This represents an object in a tree of files: the tree has a root,
36 represented by the first
38 the root has a child file named
40 which in turn has child
42 and so on; the descendent
44 is the object represented by the path name.
46 There are a number of Plan 9
48 available, each of which provides a tree of files.
49 A name space is built by
51 services (or subtrees of services) to names in the name-space-so-far.
52 Typically, a user's home file server is bound to the root of the name space,
53 and other services are bound to conventionally named subdirectories.
54 For example, there is a service resident in the operating system for accessing
55 hardware devices and that is bound to
58 Kernel services have names (outside the name space) that are a
60 sign followed by a single letter;
63 is conventionally bound to
67 .IR "union directories" :
68 directories made of several directories all bound to the
70 The directories making up a union directory are ordered in a list.
71 When the bindings are made
74 flags specify whether a newly bound member goes at the head or the tail of the list
75 or completely replaces the list.
76 To look up a name in a union directory, each member directory is searched
77 in list order until the name is found.
79 flag specifies whether file creation is allowed in a member directory:
80 a file created in the union directory goes in
81 the first member directory in list order that allows creation, if any.
83 The glue that holds Plan 9 together is a network protocol called
85 described in section 5 of this manual.
86 All Plan 9 servers read and respond to 9P requests to navigate through
87 a file tree and to perform operations such as reading and writing
88 files within the tree.
90 When a terminal is powered on or reset,
91 it must be told the name of a file server to boot from,
92 the operating system kernel to boot,
93 and a user name and password.
94 How this dialog proceeds is environment- and machine-dependent.
96 the terminal loads a Plan 9 kernel,
97 which sets some environment variables (see
99 and builds an initial name space.
105 for details, but some important aspects of the initial name space are:
107 The environment variable
109 is set to the name of the kernel's CPU's architecture: one of
115 (386, 486, Pentium, ...)
117 The environment variable
119 is initially the same as
122 The environment variable
124 is set to a description of the machine running the kernel,
127 Sometimes the middle word of
129 encodes the file from which the kernel is booted.
131 The environment variable
135 (Other ways of accessing Plan 9 may set
143 The environment variable
145 is set to the name of the user who booted the terminal.
146 The environment variable
148 is set to that user's home directory.
157 After booting, the terminal runs the command interpreter,
160 .B /usr/$user/lib/profile
161 after moving to the user's home directory.
163 Here is a typical profile:
166 bind -a $home/bin/rc /bin
167 bind -a $home/bin/$cputype /bin
168 bind -c $home/tmp /tmp
169 font = /lib/font/bit/pelm/euro.9.font
174 prompt=('term% ' ' ')
177 bind /mnt/term/dev/cons /dev/cons
178 bind /mnt/term/dev/consctl /dev/consctl
179 bind -a /mnt/term/mnt/wsys /dev
189 The first three lines replace
193 in the user's home directory
198 to be searched after the standard
201 The next starts the mail file system; see
203 Then different things happen, depending on the
205 environment variable,
206 such as running the window system
210 To do heavy work such as compiling, the
212 command connects a window to a CPU server;
213 the same environment variables are set (to different values)
214 and the same profile is run.
215 The initial directory is the current directory in the terminal window
223 so the second arm of the profile switch is executed.
224 The root of the terminal's name space is accessible through
228 is a way of making the window system's graphics interface (see
230 available to programs running on the CPU server.
233 command reports current Plan 9 affairs.
235 The third possible service type,
237 is set when the CPU server is called from a non-Plan-9 machine,
243 The user commands of Plan 9 are reminiscent of those in Research Unix, version 10.
244 There are a number of differences, however.
246 The standard shell is
248 not the Bourne shell.
249 The most noticeable differences appear only when programming and macro processing.
251 The character-delete character is backspace, and the line-kill character is
252 control-U; these cannot be changed.
254 DEL is the interrupt character: typing it sends an interrupt to processes running in that window.
257 for instructions on typing characters like DEL on the various keyboards.
259 If a program dies with something like an address error, it enters a `Broken'
260 state. It lingers, available for debugging with
267 cleans up broken processes.
269 The standard editor is one of
273 There is a variant of
275 that permits running the file-manipulating part of
277 on a non-Plan-9 system:
283 For historical reasons,
285 uses a tab stop setting of 8 spaces, while the other editors and window systems use 4 spaces.
286 These defaults can be overridden by setting the value of the environment variable
288 to the desired number of spaces per tab.
290 Machine names may be prefixed by the network name,
295 for the system default.
297 Login connections and remote execution on non-Plan-9 machines are usually
298 done by saying, for example,
314 connects to file systems of remote systems
323 sets things up so that the root of
325 file tree is visible locally in
329 gives graphical notification of arriving mail.
331 The Plan 9 file server has an integrated backup facility.
340 a tree containing the daily backups on the file server.
341 The dump tree has years as top level file names, and month-day
342 as next level file names.
345 is the root of the file system as it appeared at dump time on
347 If more than one dump is taken on the same day, dumps after
348 the first have an extra digit.
349 To recover the version of this file as it was on June 15, 1999,
352 cp /n/dump/1999/0615/sys/man/1/0intro .
358 This section for general publicly accessible commands.
360 Section (2) for library functions, including system calls.
362 Section (3) for kernel devices (accessed via
365 Section (4) for file services (accessed via
368 Section (5) for the Plan 9 file protocol.
370 Section (6) for file formats.
372 Section (7) for databases and database access programs.
374 Section (8) for things related to administering Plan 9.
377 for copies of papers referenced in this manual.
379 The back of this volume has a permuted index to aid searches.
381 Upon termination each program returns a string called the
383 It was either supplied by a call to
385 or was written to the command's
390 causing an abnormal termination.
391 The empty string is customary for successful execution;
392 a non-empty string gives a clue to the failure of the command.