2006-08-25

Plan 9

I've been reading about "Plan 9 from Bell Labs" (Pike et al.)

Plan 9 was an operating system developed in the mid 1980s by members of the Computing Science Research Center at Bell Labs. This is the same group that developed UNIX and the C and C++ languages. In essence, the project is radical redesign of UNIX. "The problems of UNIX were too deep to fix," Pike writes. "But some of its ideas could be brought along..."

The filesystem is the heart and soul of Plan 9. Most system resources are accessed and controlled through the filesystem-- even things that have not traditionally been thought of as files. For example, to get information about a process, you look under its "/proc" directory. An application can control its terminal by reading and writing its "/dev/cons" file. The graphical windowing system itself is can be viewed as a file server.

Furthermore, unlike in conventional operating systems, where all processes share the same file system, under Plan 9, each application has its own view of what is going on. When process A reads /dev/cons, it is not reading the same /dev/cons that process B is reading. As Pike writes, "the disjoint hierarchies provided by different services are joined together into a single private hierarchical namespace."

Plan 9 has a single protocol for dealing with filesystems, called 9P. This has been extended to allow network filesystems, which make files on a remote computer look exactly like local ones. Since the window system itself is simply a file server, there is no need to implement anything like an "X server"-- 9P fills this function!

Plan 9 abolishes the old distinction between processes and threads, opting instead to give users more options about what resources processes can share. There are also some other new things in the OS, like a new shell called RC, which tries to improve on the Bourne Shell.

As an engineer, I feel a little bit sad that Plan 9 has not had more influence. I am typing this from a linux system. Most of my friends use UNIX in one way or another, but nobody uses Plan 9, and few have heard of it. Perhaps the problems in UNIX were not as deep as Pike thought. And here's another thought: at the time this paper was published, around the mid nineties, a very different operating system was taking root-- an operating system named Windows 95. What would the folks at Bell Labs, in their quiet, meticulous academic environment, have thought about this one?

There are some other Plan 9 innovations that have found their way into linux, and perhaps other operating systems, over the years. For example, linux has the /proc filesystem for getting information about processes, and the /sys filesystem for digging up stuff about the system. NFS, the network filesystem, and SAMBA, are distributed filesystems that may not be as clean as 9P, but which get the job done.

Ironically, the main Plan 9 invention that is in use today is a UTF-8, a way of representing unicode text. Ken Thompson created UTF-8 to be the native character encoding for Plan 9-- and it is used throughout the whole operating system. UTF-8 is popular because it is somewhat backwards-compatible with existing C string libraries, and because it sidesteps endianness issues.

As bold as Plan 9 was, it still stopped short of a full design of UNIX. I would like to see an operating system that has a strongly-typed shell, and is based on capabilities rather than on privileges. But I guess change comes slowly sometimes.

0 Comments:

Post a Comment

<< Home