Plan 9 from Bell Labs
Installation of Plan 9
|Written in||Dialect of ANSI C|
|Source model||Open source|
|Initial release||1992 (universities) / 1995 (general public)|
|Latest release||Fourth Edition / daily|
|Platforms||x86 / Vx32, x86-64, MIPS, DEC Alpha, SPARC, PowerPC, ARM|
|Kernel type||Hybrid kernel|
|Influenced by||(Research) Unix, Cambridge Distributed Computing System|
|Default user interface||rio / rc|
|License||dual license (GNU GPLv2 and Lucent Public License)|
Plan 9 from Bell Labs is a free distributed operating system. It was developed primarily for research purposes as the successor to Unix by the Computing Sciences Research Center at Bell Labs between the mid-1980s and 2002. Plan 9 continues to be used and developed by operating system researchers and hobbyists.
Plan 9 has novel features such as the 9P protocol for accessing local and remote resources as files, union mounts, an improved proc file system, and native Unicode support throughout the system. In Plan 9, all system interfaces, including those required for networking and the user interface, are represented through the file system rather than specialized interfaces.
The name Plan 9 from Bell Labs is a reference to the Ed Wood 1959 cult science fiction Z-movie Plan 9 from Outer Space. Also, Glenda, the Plan 9 Bunny, is presumably a reference to Wood's film Glen or Glenda.
- 1 History
- 2 Design concepts
- 3 Software for Plan 9
- 4 Impact
- 5 License
- 6 See also
- 7 References
- 8 External links
Plan 9 from Bell Labs was originally developed, starting mid-1980s, by members of the Computing Science Research Center at Bell Labs, the same group that originally developed Unix and C. The Plan 9 team was initially led by Rob Pike, Ken Thompson, Dave Presotto and Phil Winterbottom, with support from Dennis Ritchie as head of the Computing Techniques Research Department. Over the years, many notable developers have contributed to the project including Brian Kernighan, Tom Duff, Doug McIlroy, Bjarne Stroustrup and Bruce Ellis.
Plan 9 replaced Unix as Bell Labs's primary platform for operating systems research. It explored several changes to the original Unix model that facilitate the use and programming of the system, notably in distributed multi-user environments. After several years of development and internal use, Bell Labs shipped the operating system to universities in 1992. Three years later, in 1995, Plan 9 was made available for commercial parties by AT&T via the book publisher Harcourt Brace. With source licenses costing $350, AT&T targeted the embedded systems market rather than the computer market at large; Ritchie commented that the developers did not expect to do "much displacement" given how established other operating systems had become.
As of early 1996, the Plan 9 project had been "put on the back burner" by AT&T in favor of Inferno, intended to be a rival to Sun Microsystems' Java platform. In the late 1990s, Lucent Technologies, having inherited Bell Labs, dropped commercial support for the project and in 2000, a non-commercial third release was distributed under an open source license. A fourth release under a new free software license occurred in 2002.
A user and development community, including current and former Bell Labs members and Massachusetts Institute of Technology personnel, continues to produce minor daily releases in form of ISO images. Bell Labs still hosts the development. The development source tree is accessible over the 9P and HTTP protocols and is used to update existing installations. In addition to the official components of the OS included in the ISOs, Bell Labs also hosts a repository of externally developed applications and tools.
|1992||Plan 9 1st edition||Released by Bell Labs to universities|
|1995||Plan 9 2nd edition||Released by Bell Labs for non-commercial purposes|
|2000||Plan 9 3rd ed. (Brazil)||Released by Lucent Tech. under a gratis license for non-commercial use|
|2002||Plan 9 4th edition||Released by Lucent Technologies under a new free software license|
Plan 9 is a distributed operating system, designed to make a network of heterogeneous and geographically separated computers function as a single system. In a typical Plan 9 installation, users work at terminals running the window system rio, and they access CPU servers which handle computation-intensive processes. Permanent data storage is provided by additional network hosts acting as file servers and archival storage.
Its designers state that
[t]he foundations of the system are built on two ideas: a per-process name space and a simple message-oriented file system protocol.—Pike et al.
The first idea means that, unlike on most operating systems, processes (running programs) each have their own view of the filesystem: a single path name may refer to different resources for different processes. The potential complexity of this setup is controlled by a set of conventional locations for common resources.
The second idea means that processes can offer their services to other processes by providing virtual files that appear in the other processes' namespace, and I/O on these files becomes inter-process communication between the former process (acting as a server) and the latter (the clients). This way, Plan 9 generalizes the Unix notion of the filesystem as the central point of access to computing resources. It carries over Unix's idea of device files to provide access to peripheral devices (mice, removable media, etc.) and the possibility to mount filesystems residing on physically distinct filesystems into a hierarchical namespace, but adds the possibility to mount a connection to a server program that speaks the standard protocol and treat its services as a filesystem.
For example, the original window system, called 8½, exploited these possibilities as follows. Plan 9 represents the user interface on a terminal by means of three pseudo-files: mouse, which can be read by a program to get notification of mouse movements and button clicks, cons, which can be read and written to perform textual input/output, and bitblt, writing to which enacts graphics operations (see bit blit). The window system multiplexes these devices: when creating a new window to run some program in, it first sets up a new namespace in which mouse, cons and bitblt are connected to itself, hiding the actual device files. The window system thus receives all input and output commands from the program and handles these appropriately, by sending output to the actual screen device and giving the currently focused program the keyboard and mouse input. The program does not need to know if it is communicating with the kernel via device files, or with the window system; it only has to assume that its namespace is set up so that these special files are tied to the right devices in its namespace.
Plan 9's distributed operation relies on the per-process namespaces as well: the cpu command starts a remote session on a compute server. The command exports part of its local namespace, including the user's terminal's devices, to the server, so that remote programs can perform input/output using the terminal's mouse, keyboard and display, combining the effects of remote login and a shared network filesystem.
All programs that wish to provide services-as-files to other programs speak a unified protocol, called 9P. Compared to other systems, this reduces the number of custom APIs and system calls. 9P is a generic, medium-agnostic, byte-oriented protocol that provides for messages delivered between a server and a client. The protocol is used to refer to and communicate with processes, programs, and data, including both the user interface and the network. With the release of the 4th edition, it was modified and renamed 9P2000.
Unlike most other operating systems, Plan 9 does not provide special application programming interfaces (such as Berkeley sockets, X resources or ioctl system calls) to access devices. Instead, Plan 9 device drivers implement their control interface as a file system, so that the hardware can be accessed by the ordinary file input/output operations read and write. Consequently, sharing the device across the network can be accomplished by mounting the corresponding directory tree to the target machine.
Union directories and namespaces
Plan 9 allows the user to collect the files (called names) from different directory trees in a single location. The name resolution is then performed from top to bottom: If the name doesn't exist in the top directory, it is looked up in lower ones until found. The same name in lower directories will be shown in the directory listing, but will not be accessible; thus, the merging of subdirectories is not handled.
A union directory can be created by using the bind command:
; bind /arm/bin /bin ; bind -a /usr/inferno/Plan9/arm/bin /bin ; bind -b /usr/alice/bin /bin
In the example above, /arm/bin is mounted at /bin, the contents of /arm/bin replacing the previous contents of /bin. Inferno's bin directory is then union mounted after /bin, and Alice's personal bin directory is union mounted before. When a file is requested from /bin, it is first looked for in /usr/alice/bin, then in /arm/bin, and then finally in /usr/inferno/Plan9/arm/bin.
The separate-namespaces-for-separate-processes thus replaces the notion of a search path in the shell. Where Unix shells have a list of directories to search for programs when given a command, the Plan 9 shell only looks in the directory /bin; adding commands is done by binding several directories together to appear as a single /bin.
Furthermore, the kernel can keep separate mount tables for each process, and can thus provide each process with its own file system namespace. Processes' namespaces can be constructed independently, and the user may work simultaneously with programs that have heterogeneous namespaces. Namespaces may be used to create an isolated environment similar to chroot, but in a more secure way.
Special virtual filesystems
Instead of having system calls specifically for process management, Plan 9 provides the /proc file system. Each process appears as a directory containing information and control files which can be manipulated by the ordinary file IO system calls.
Plan 9 does not have specialised system calls or ioctls for accessing the networking stack or networking hardware. Instead, the /net file system is used. Network connections are controlled by reading and writing control messages to control files. Sub-directories such as /net/tcp and /net/udp are used as an interface to their respective protocols.
To reduce the complexity of managing character encodings, Plan 9 uses Unicode throughout the system. The initial Unicode implementation was ISO 10646. Ken Thompson invented UTF-8, which became the native encoding in Plan 9. The entire system was converted to general use in 1992. UTF-8 preserves backwards compatibility with traditional null terminated strings, enabling more reliable information processing and the chaining of multilingual string data with Unix pipes between multiple processes. Using a single UTF-8 encoding with characters for all cultures and regions eliminates the need for switching between code sets.
Comparison to contemporary operating systems
In 1991, Plan 9's designers compared their system to other early nineties operating systems in terms of size, showing that the source code for a minimal ("working, albeit not very useful") version was less than one-fifth the size of a Mach microkernel without any device drivers (5899 or 4622 lines of code for Plan 9, depending on metric, vs. 25530 lines). The complete kernel comprised 18000 lines of code. (According to a 2006 count, the kernel was then some 150,000 lines, but this was compared against more than 4.8 million in Linux.)
Within the operating systems research community, as well as the commercial Unix world, other attempts at achieving distributed computing and remote filesystem access were made concurrently with the Plan 9 design effort. These included the Network File System and the associated vnode architecture developed at Sun Microsystems, and more radical departures from the Unix model such as the Sprite OS from UC Berkeley. Sprite developer Welch points out that the SunOS vnode architecture is limited compared to Plan 9's capabilities in that it does not support remote device access and remote inter-process communication cleanly, even though it could have:
UNIX domain sockets are communication channels (pipes) that have names in the file system, so they can essentially be used to name user-level servers. However, both of these mechanisms predate the vnode architecture, and they were not extended to provide transparent remote access to devices and servers. (...) If the vnode architecture included a general way to export the vnode interface to user-level then these projects might have been even easier, and others, such as remote device access, could have been added.—Brent Welch
One critique of the "everything is a file", communication-by-textual-message design of Plan 9 pointed out limitations of this paradigm compared to typed interfaces of Sun's object-oriented operating system, Spring:
Plan 9 constrains everything to look like a file. In most cases the real interface type comprises the protocol of messages that must be written to, and read from, a file descriptor. This is difficult to specify and document, and prohibits any automatic type checking at all, except for file errors at run time. (...) [A] path name relative to a process' implicit root context is the only way to name a service. Binding a name to an object can only be done by giving an existing name for the object, in the same context as the new name. As such, interface references simply cannot be passed between processes, much less across networks. Instead, communication has to rely on conventions, which are prone to error and do not scale.—Roscoe; emphasis in the original.
A later retrospective comparison of Plan 9, Sprite and a third contemporary distributed research operating systems, Amoeba, found that
the environments they [Amoeba and Sprite] build are tightly coupled within the OS, making communication with external services difficult. Such systems suffer from the radical departure from the UNIX model, which also discourages portability of already existing software to the platform or in the case of Sprite, evolve into a file system running on top of UNIX kernels. The lack of developers, the very small range of supported hardware and the small, even compared to Plan 9, user base have also significantly slowed the adoption of those systems outside of their research communities. In retrospect, Plan 9 was the only research distributed OS from that time which managed to attract developers and be used in commercial projects long enough to warrant its survival to this day.—Mirtchovski, Simmonds and Minnich
Combining the design concepts
Though interesting on their own, the design concepts of Plan 9 were supposed to be most useful when combined together. For example, to implement a network address translation (NAT) server, a union directory can be created, overlaying the router's /net directory tree with its own /net. Similarly, a virtual private network (VPN) can be implemented by overlaying in a union directory a /net hierarchy from a remote gateway, using secured 9P over the public Internet. A union directory with the /net hierarchy and filters can be used to sandbox an untrusted application or to implement a firewall. In the same manner, a distributed computing network can be composed with a union directory of /proc hierarchies from remote hosts, which allows interacting with them as if they are local.
When used together, these features allow for assembling a complex distributed computing environment by reusing the existing hierarchical name system.
Software for Plan 9
The distribution package for Plan 9 includes special compiler variants and programming languages, and provides a tailored set of libraries along with a windowing user interface system specific to Plan 9. Its compiler is a dialect of C with some extensions and restrictions.
Factotum is an authentication and key management server for Plan 9. It handles authentication on behalf of other programs such that both secret keys and implementation details need only be known to Factotum.
Unlike Unix, Plan 9 was designed with graphics in mind. After booting, a Plan 9 terminal will run the rio windowing system, in which the user can create new windows displaying rc. Graphical programs invoked from this shell replace it in its window.
Plan 9 supports the Kfs, Paq, Cwfs, FAT, and Fossil file systems. The latter was designed at Bell Labs specifically for Plan 9 and provides snapshot storage capability. It can be used directly with a hard drive or backed with Venti—an archival file system and permanent data storage system.
Though Plan 9 was supposed to be a further development of Unix concepts, compatibility with preexisting Unix software was never the goal for the project. Many command line utilities of Plan 9 share the names of Unix counterparts, but work differently.
Plan 9 can support POSIX applications and can emulate the Berkeley socket interface through the ANSI/POSIX Environment (APE) that implements an interface close to ANSI C and POSIX, with some common extensions (the native Plan 9 C interfaces conform to neither standard). It also includes a POSIX-compatible shell. APE's authors claim to have used it to port the X Window System (X11) to Plan 9, although they do not ship X11 "because supporting it properly is too big a job". Some Linux binaries can be used with the help of a "linuxemu" (Linux emulator) application; however, it is still a work in progress.
Plan 9 demonstrated that an integral concept of Unix—that every system interface could be represented as a set of files—could be successfully implemented in a modern distributed system. Some features from Plan 9, like the UTF-8 character encoding of Unicode, have been implemented in other operating systems. Unix-like operating systems such as Linux have implemented 9P, Plan 9's file system, and limited forms of rfork-like system calls. Additionally, in Plan 9 from User Space, several of Plan 9's applications and tools, including the sam and acme editors, have been ported to Unix and Linux systems and have achieved some level of popularity. Several projects seek to replace the GNU operating system programs surrounding the Linux kernel with the Plan 9 operating system programs. The 9wm window manager was inspired by 8½, the older windowing system of Plan 9; wmii is also heavily influenced by Plan 9. In computer science research, Plan 9 has been used as a grid computing platform and as a vehicle for research into ubiquitous computing without middleware.
However, Plan 9 has never approached Unix in popularity, and has been primarily a research tool:
[I]t looks like Plan 9 failed simply because it fell short of being a compelling enough improvement on Unix to displace its ancestor. Compared to Plan 9, Unix creaks and clanks and has obvious rust spots, but it gets the job done well enough to hold its position. There is a lesson here for ambitious system architects: the most dangerous enemy of a better solution is an existing codebase that is just good enough.
Plan 9 proponents and developers claim that the problems hindering its adoption have been solved, that its original goals as a distributed system, development environment, and research platform have been met, and that it enjoys moderate but growing popularity. Inferno, through its hosted capabilities, has been a vehicle for bringing Plan 9 technologies to other systems as a hosted part of heterogeneous computing grids.
Several projects actively work to extend Plan 9, including 9atom and 9front. These forks augment Plan 9 with additional hardware drivers and software, including nupas (an improved version of the Upas e-mail system), the go compiler, Mercurial version control system support, and other programs. Plan 9 was ported to the Raspberry Pi single-board computer.
Starting with the release of Fourth edition on April 2002, the full source code of Plan 9 from Bell Labs was freely available under Lucent Public License 1.02, which is considered to be open source license by the Open Source Initiative (OSI), free software license by the Free Software Foundation, and it passes the Debian Free Software Guidelines.
In February 2014 the University of California, Berkeley, has been authorised by the current Plan 9 copyright holder – Alcatel-Lucent – to release all Plan 9 software previously governed by the Lucent Public License, Version 1.02 under the GNU General Public License, Version 2.
- Lucent Technologies (2006). "Glenda, the Plan 9 Bunny". Retrieved 2008-12-02.
- Pike, R.; Presotto, D.; Dorward, S.; Flandrena, B.; Thompson, K.; Trickey, H.; Winterbottom, P. "Plan 9 from Bell Labs". Bell Labs. Lucent Technologies. Retrieved 2011-12-02.
- Robertson, James (2011-07-16). "Plan 9 Forked, Continues as 9front". OSNews. Retrieved 2011-12-31.
- "9atom". Retrieved 2011-11-11.
- Raymond, Eric S. (2003-09-17). "Plan 9: The Way the Future Was". The Art of UNIX Programming. Addison-Wesley. ISBN 0-13-142901-9. Retrieved 2007-05-07.
- "From the inventors of UNIX system comes Plan 9 from Bell Labs" (Press release). Lucent Technologies. 1995-07-18. Archived from the original on 2006-02-09.
- McIlroy, Doug (Mar 1995). "Sys". Bell Labs (2nd ed.). Lucent Technologies. Retrieved 2006-04-02.
- Lee, Yvonne L. (24 July 1995). "AT&T Bell Labs ships Plan 9 OS for embedded systems". InfoWorld.
- Pontin, Jason (19 February 1996). "AT&T reveals plans for Java competitor". InfoWorld. p. 3.
- Loli-Queru, Eugenia (2002-04-29). "Bell Labs Releases New Version of Plan 9". OSNews. Retrieved 2011-12-31.
- "How to contribute". Bell Labs. Lucent Technologies. Retrieved 2011-11-30.
- "Staying up to date". Bell Labs. Lucent Technologies. Retrieved 2006-04-27.
- "Announcement of the first release to general public". 9 fans. 1995-07-16.
- Mullender, Sape J.; Janson, Pierre G. (2004-02-26). "Real Time in a Real Operating System". In Herbert, Andrew J.; Spärck Jones, Karen. Computer systems: theory, technology, and applications: a tribute to Roger Needham. Springer Science+Business Media. p. 211. ISBN 978-0-387-20170-2. Retrieved 2011-12-24.
- Hancock, Brian (2003). "Reinventing Unix: an introduction to the Plan 9 operating system". Library Hi Tech (MCB UP) 21 (4): 471–76. doi:10.1108/07378830310509772.
- Presotto, Dave; Pike, Rob; Thompson, Ken; Trickey, Howard. Plan 9, A Distributed System. Proc. Spring 1991 EurOpen Conference. CiteSeerX: 10
.1 .1 .41 .9192.
- Pike, R.; Presotto, D.; Thompson, K.; Trickey, H.; Winterbottom, P. "The Use of Name Spaces in Plan 9". Bell Labs. cat-v.org. Retrieved 2011-12-05.
- Welch, Brent (1994). "A comparison of three distributed file system architectures: Vnode, Sprite, and Plan 9". Computing Systems 7 (2): 175–199. CiteSeerX: 10
.1 .1 .46 .2817.
- – Plan 9 Programmer's Manual, Volume 1
- Pereira, Uriel M. (2006). The Unix Spirit set Free: Plan 9 from Bell Labs (AVI). FOSDEM. Retrieved 2011-12-02. Lay summary (PDF).
- Minnich, Ron (2005). "Why Plan 9 is not dead yet And What we can learn from it" (PDF). Los Alamos National Laboratory. FAST-OS. Retrieved 2011-12-02.
- Ballesteros, Francisco J. (2007-09-28). "Introduction to OS abstractions using Plan 9 from Bell Labs" (PDF). Universidad Rey Juan Carlos. Archived from the original (PDF) on 2010-09-21.
- Valerie, Aurora (2009-03-25). "Union file systems: Implementations, part I". LWN.net. Retrieved 2011-12-05.
- "UNIX to Plan 9 command translation". Bell Labs. Lucent Technologies. Retrieved 2011-12-02.
- Pike, Rob (2003-04-30). "UTF-8 History". Retrieved 2006-04-27.
- Lunde, Ken (Jan 1999). CJKV information processing. O'Reilly Media. p. 466. ISBN 978-1-56592-224-2. Retrieved 2011-12-23.
- Roscoe, Timothy (1995). The Structure of a Multi-Service Operating System (PDF) (Ph.D.). University of Cambridge. pp. 22–23.
- Mirtchovski, Andrey; Simmonds, Rob; Minnich, Ron (2004). Plan 9—an integrated approach to grid computing. Proc. 18th Int'l Parallel and Distributed Processing Symp. IEEE. CiteSeerX: 10
.1 .1 .97 .122.
- Dixon, Rod (2004). Open source software law. Artech House. p. 213. ISBN 978-1-58053-719-3. Retrieved 2011-12-25.
- Thompson, Ken (February 1992). "A new C Compiler" (PDF). Australian UNIX systems User Group Newsletter (Kensington, AU: AUUG) 13 (1): 31–41. ISSN 1035-7521. Retrieved 2011-12-25.
- Cox, R.; Grosse, E.; Pike, R.; Presotto, D.; Quinlan, S. "Security in Plan 9". Bell Labs. Lucent Technologies. Retrieved 2011-12-02.
- Hudson, Andrew (2006-07-19). "Investigating the Plan 9 Operating System". OSNews. Retrieved 2011-12-31.
- "An interview with Russ Cox". The Setup. Uses this. 2011-04-09. Retrieved 2012-01-01.
- Trickey, Howard. "APE – The ANSI/POSIX Environment". Bell Labs. Lucent Technologies. Retrieved 2011-04-27.
- "Linux emulation". Bell Labs. Lucent Technologies. Retrieved 2011-12-02.
- "window manager improved 2". suckless.org. Retrieved 2012-01-02.
[wmii] has a 9p filesystem interface and supports classic and tiling (acme-like) window management.
- "Glendix: Bringing the beauty of Plan 9 to Linux". Retrieved 2011-12-01.
- "Plan 9 From Gentoo: Plan 9 Meets Gentoo". Gentoo Linux. Retrieved 2011-12-01.
- "The 9wm Window Manager". 9wm. Retrieved 2012-01-02.
9wm is an X window manager which attempts to emulate the Plan 9 window manager 8-1/2 as far as possible within the constraints imposed by X.
- "9grid". Bell Labs. Lucent Technologies. Retrieved 2006-03-28.
- Ballesteros, Francisco J.; Guardiola, Gorka; Soriano, Enrique; Leal Algara, Katia (2005). Traditional systems can work well for pervasive applications. A case study: Plan 9 from Bell Labs becomes ubiquitous. IEEE Intl' Conf. on Pervasive Computing and Communications. CiteSeerX: 10
.1 .1 .109 .8131.
- "Vita Nuova Supplies Inferno Grid to Evotec OAI" (PDF) (Press release). Vita Nuova. 2004-05-18. Retrieved 2006-03-28.
- "Rutgers University Libraries Install Inferno Data Grid" (PDF) (Press release). Vita Nuova. 2004-05-12. Retrieved 2006-03-28.
- "The University of York Department of Biology install Vita Nuova's Inferno Data Grid" (PDF) (Press release). Vita Nuova. 2004-05-04. Retrieved 2006-03-28.
- "plan9front – the front fell off". Retrieved 2011-12-01.
- Hayward, David (2013-05-09). "Raspberry Pi operating systems: 5 reviewed and rated". TechRadar. Retrieved 2014-04-20.
- "How to install Plan 9 on a Raspberry Pi". eLinux. Retrieved 2014-11-16.
- Sharwood, Simon (2014-02-14). "Plan 9 moves out from Lucent licence space". TheRegister. Retrieved 2014-04-20.
|Wikimedia Commons has media related to Plan 9 from Bell Labs.|
- Official website
- 9fans, the Plan 9 mailing list hosted by http://9fans.net
- Ninetimes Plan 9, Inferno, Unix, and Bell Labs operating systems news
- #plan9 connect, the Plan 9 IRC channel hosted by freenode
- Cat-v.org Random Contrarian Insurgent Organization, the Plan 9 user and developer community
- Glenda, the Plan 9 bunny