We are still actively working on the spam issue.

Difference between revisions of "Plan 9"

From InstallGentoo Wiki
Jump to: navigation, search
(Add new section: History and philosophy, Add new subsection Concepts/Graphical Shell and subsection Concepts/Graphical Shell/But what if I want to run a Headless Server, add new subsection Concepts/Ch)
(updated Licensing section)
 
(14 intermediate revisions by 7 users not shown)
Line 1: Line 1:
  
 
[[File:plan9.jpg|thumb|Glenda, the Plan 9 Mascot]]
 
[[File:plan9.jpg|thumb|Glenda, the Plan 9 Mascot]]
 +
(''For the popular fork, see [[9front]]'')
  
'''Plan 9 from Bell Labs''' is a research OS family, created at Bell Labs by many of the same people who created Unix, like Ken Thompson, Dennis Ritchie and Rob Pike. It's distinguishing features include the use of files with the 9P protocol for most, if not all resources in the operating system (including graphics), and private namespaces, where each process can have a different view of the file system. Interest in Plan 9 stems out of curiosity, admiration and idealism. If you thought that the BSD community was horribly elitist and autistic, you ain't seen nothing yet son.
+
'''Plan 9 from Bell Labs''' is a research OS family, created at Bell Labs by many of the same people who created Unix, like Ken Thompson, Dennis Ritchie and Rob Pike. Its distinguishing features include the use of files with the 9P protocol for most, if not all resources in the operating system (including graphics), and private namespaces, where each process can have a different view of the file system. Interest in Plan 9 stems out of curiosity, admiration and idealism.
  
 
== History and philosophy ==
 
== History and philosophy ==
  
Plan 9 is fundamentally an Operating System created to address the Practical use of the [[UNIX]] system since it left Bell Labs, especially in the Commercial setting. A *lot* of changes had occurred in UNIX since the first Research UNIX systems were developed.
+
Plan 9 is fundamentally an operating system created to address the practical use of the [[Unix]] system since it left Bell Labs, especially in the commercial setting. The world had changed since the days of Research Unix, and graphics and networking had become monumentally important in the computer space. Organisations outside Bell Labs shaped the development of Unix, with the adoption of sockets from BSD and the X Window System from MIT that bent and twisted the "Unix philosophy".
 
 
For example, a large amount of commercial enterprises were migrating away from the dumb-terminal approach (previously a standard for Computer Use) and were instead deciding to use the UNIX Workstation
 
(what you usually see today). Furthermore, Graphics and Networking were taking over the entire field of computing.
 
 
 
Some of the problems posed in Commercial UNIX were that bloatware designed by third-parties was implemented to better serve the problems of workstations, networking, and graphics. There is no need for these bloated things in Plan 9.
 
 
 
Plan 9 is not UNIX, but it is UNIX-like. It was made by the exact same individuals famous for making the UNIX system. Plan 9 is superior to traditional UNIX systems. While graphics and networking came later to UNIX, and were never fully implemented in a satisfactory way (see X11, BSD TC/IP stack) Plan 9 implements them at its very core, providing new base sub-directories such as /net and graphic handlers such as /dev/draw.
 
  
 +
The developers of Plan 9, then, set out to develop a new operating system for research, exploring areas such as distributed computing, naturally graphics and networking, and heterogenous access to system resources. While Plan 9 is not Unix, it is to an extent Unix-like, and feels rather like the later versions of Research Unix after the flight of Unix outside of Bell Labs (and even has some of the features of those later Research Unix releases).
  
 
== Licensing ==
 
== Licensing ==
  
The First and Second Editions of Plan 9 were only available to universities and then for an exorbitant fee in book and CD form.
+
The first and second editions of Plan 9 were only available to universities, for an exorbitant fee in book and CD form. The third edition of Plan 9 was released under the Plan 9 Licence in 2000, which Richard Stallman considered [http://www.linuxtoday.com/developer/2000070200704OPLFSW non-free]. The fourth edition was released under the Lucent Public Licence in 2002 which the FSF does consider free but not GPL-compatible, along with the distribution becoming openly developed and updated daily. In 2014, Plan 9 was relicenced under GPLv2 for the University of California, Berkeley's Akaros operating system (to much distaste).
The Third Edition of Plan 9 was released under the Plan 9 Licence in 2000, which Richard Stallman considered [http://www.linuxtoday.com/developer/2000070200704OPLFSW non-free]. The Fourth Edition was released under the Lucent Public Licence in 2002 which the FSF does consider free but not GPL-compatible, along with the distribution becoming openly developed and updated daily. In 2014 Plan 9 was relicenced under GPLv2 for the University of California, Berkeley's Akaros operating system (to much distaste).
 
  
 
This author interprets the licence situation of Plan 9 to be dual licensing under both the Lucent Public License 1.02 and the GNU General Public License 2. You may be able to guess which license the community prefers.
 
This author interprets the licence situation of Plan 9 to be dual licensing under both the Lucent Public License 1.02 and the GNU General Public License 2. You may be able to guess which license the community prefers.
  
It is somewhat believed in the Plan 9 community that it was due to the variety of licenses that Plan 9 never got far in the UNIX groups.
+
There is a perception in the Plan 9 pommunity that it was due to the prohibitive cost and later licence confusion that Plan 9 made much ground commercially.
 +
 
 +
after [[Bell Labs]] gave rights of Plan 9 to the Plan 9 Foundation, the Plan 9 foundation re-releasesd all historical Plan 9 releases under MIT in March 23, 2021.
  
 
== Distributions ==
 
== Distributions ==
  
*[http://plan9.bell-labs.com/plan9/ Plan 9 from Bell Labs], the Fourth Edition, where development is all but dead.
+
*[http://plan9.bell-labs.com/plan9/ Plan 9 from Bell Labs], the fourth edition of Plan 9. Dead.
  
*[http://www.9legacy.org/ 9legacy], which is several patches on top of the Bell Labs distribution.
+
*[http://www.9legacy.org/ 9legacy], a distribution of several patches on top of the Bell Labs distribution.
  
*[http://www.9atom.org/ 9atom] is Erik Quanstrom's personal fork of Plan 9. It augments the Plan 9 distribution with the addition of a 386 PAE kernel, an amd64 cpu and terminal kernel, nupas, extra PC hardware support, IL and Ken's fs.  
+
*[http://www.9atom.org/ 9atom] is Erik Quanstrom's personal fork of Plan 9. It augments the Plan 9 distribution with the addition of a 386 PAE kernel, an amd64 CPU and terminal kernel, nupas, extra PC hardware support, IL and Ken's fs, most of which have been incorporated into or available for 9front.  
  
*[http://www.vitanuova.com/inferno/ Inferno] is a distributed operating system started at Bell Labs, but is now developed and maintained by Vita Nuova Holdings as free software.
+
*[http://www.vitanuova.com/inferno/ Inferno] is a distributed operating system started at Bell Labs, but is now <s>developed and maintained</s> by Vita Nuova Holdings as free software.
  
*[[9front]] is an active, community-led fork of Plan 9, from the People's Front of Cat -V, after the front fell off. You might be legitimately surprised when you find out that most of these seemingly-elitest people yelling at your dumb questions in their IRC channel are actually Bell Labs employees.
+
*[[9front]] is an active, community-led fork of Plan 9 from the People's Front of Cat -V, after the front fell off.
  
*[https://swtch.com/plan9port/ plan9port] is not an operating system, but a port of many Plan 9 applications, utilities and libraries to Unix-like operating systems such as GNU/Linux and *BSD.
+
*[https://swtch.com/plan9port/ plan9port] is not an operating system, but a port of many Plan 9 applications, utilities and libraries to Unix-like operating systems such as GNU/Linux and BSD.
  
This author regards 9front to be the very life and breath of present Plan 9 development, including new advancements such as better hardware support, audio, wireless networking and new programs like NES, SNES, Game Boy, GBA and Genesis emulators and a paint program. If you want to run Plan 9, this is probably the way to go. Most of this article assumes you are using 9front.
+
9front is at the forefront of Plan 9 Ontologically-Oriented Technology, including new advancements such as better hardware support, audio, wireless networking and new programs like NES, SNES, Game Boy, GBA and Genesis emulators and a paint program. If you want to run Plan 9, this is probably the way to go. Most of this article assumes you are using 9front.
  
 
== Concepts ==
 
== Concepts ==
  
=== Graphical Shell ===
+
=== Graphics ===
 
 
The graphics system in Plan 9 is such an ingrained part of the system that there is little you can do without a graphical shell. Plan 9 comes with a text shell as all other UNIX systems do, with the traditional UNIX core command set (grep, awk, cat, etc) but the real programs people use (and the system's real power) comes from the graphical environment.
 
 
 
==== But what if I want to run a Headless Server? ====
 
 
 
You're still thinking of it as UNIX. When you think of Plan 9 as UNIX, you're confused, scared, and irritated. Plan 9 SUCKS! When you think of Plan 9 as Plan 9, you're amazed and your life is one big Rainbow Orgy of ponies and sunshine. Plan 9 brings you to orgasm.
 
  
Commonly-used programs provided as a part of the base system (technically a part of its common toolset, like UNIX) include Acme, Catclock, Mothra, and etc. These programs REQUIRE the graphical shell.
+
Graphics is considered ubiquitous in Plan 9, and while Plan 9 features the ancient and revered Unix toolkit (awk, grep, cat), it is therefore not plausible to use without graphics.
  
[[#rio|Rio]] is the graphical shell for all Plan 9 systems. Formerly it was 8 1/2, but 8 1/2 was weird and broken. [[#The_rc_shell|RC]] is the shell that comes with Plan 9. Rio and RC are both inspired by the first mainstream
+
Plan 9's graphical shell is called Rio. (How to use Rio follows shortly.) The way Plan 9 abstracts graphics hardware is through offering drawing surfaces as character files. Applications write to this file with drawing commands usually using libdraw. Rio uses the top-level surface to draw to the whole screen, and each new Rio window creates a new drawing surface, and using private namespaces, provides that surface to applications in the same way. You can test this by running a graphical program when Rio is not active, which draws to the entire screen, and by running Rio inside a Rio window.
Graphical Shell for UNIX (developed by Rob Pike), the Blit. These Plan 9 window managers are all made by him as well.
 
  
Using Rio may be difficult at first, especially since you yourself may be stuck either in point and click desktop metaphors (like LXDE or Windows 9x) or perhaps in the minimalist phase, using key-bound
+
=== Mouse cording ===
windowing systems like i3 or dwm. If it is the former, you are not ready for Plan 9. If it is the Latter consider the mouse as computer keys. This may help.
 
  
=== Mouse Chording ===
+
Mouse cording is common to Rio and Acme, the development environment. Mouse Chording was first introduced in the NLX System used in [[Wikipedia:The Mother of All Demos|The Mother of All Demos]]. Mouse Cording works by pressing various keys on the mouse to form a cord (like a Guitar), which produces various commands. It is simpler than the NLX version which used a binary format.
 
 
Plan 9 re-implements a forgotten technique of professional computer efficiency. That is the act of Chording. Simply clicking more than one mouse button at a time does a different action than the individual click-press. (For optimal efficiency, you will need a three button mouse. For god-tier efficiency, you will need a three button mouse and a three button device used for the chording). Chording can be used to copy, paste, and preform a variety of other user actions.
 
  
 
=== The distributed Plan 9 environment ===
 
=== The distributed Plan 9 environment ===
Line 67: Line 53:
 
Plan 9 networks generally consist of three classes of machine:
 
Plan 9 networks generally consist of three classes of machine:
  
* CPU servers - These machines export the CPU resource and accept <tt>cpu(1)</tt> and <tt>drawterm</tt> connections.
+
* CPU servers - These machines export the CPU resource and accept remote connections from terminals.
 
* File servers - Machines with disks. A standalone 9front or Plan 9 installation is most likely one of these.
 
* File servers - Machines with disks. A standalone 9front or Plan 9 installation is most likely one of these.
 
* Terminals - Not necessarily running Plan 9, these machines connect to the CPU server.
 
* Terminals - Not necessarily running Plan 9, these machines connect to the CPU server.
  
The concept of network transparency was one of the most important factors in the design of Plan 9. You should be able to feel as if your terminal and the CPU server you have just logged into are the same machine and are accessing the exact same resources, instead of being completely abstract environments as happens in Unix-like operating systems with SSH.
+
''Note: 9front adds a fourth class, the auth server. This is where security keys and user account information (not files) are stored.''
 +
 
 +
The concept of network transparency was one of the most important factors in the design of Plan 9. You should be able to feel as if your terminal and the CPU server you have just logged into are the same machine and are accessing the exact same resources, instead of being completely abstract environments as happens in Unix-like operating systems with SSH. Usually however most single Plan 9 installations are a combination of file server and terminal.
 +
 
 +
If you wanted to use Plan 9 as a server (bearing in mind that performance will be a lot worse than Linux or BSD) the closest analogue would be a file server or CPU server backed by a file server.
  
 
=== Everything is a file ===
 
=== Everything is a file ===
  
The grand abstraction of Plan 9 is that everything is shown as a file. Files are written to using the 9P protocol that is network-transparent, meaning also that all file I/O is network-transparent. 9P is also the protocol for <tt>cpu(1)</tt> connections.
+
The grand abstraction of Plan 9 is that everything is shown as a file. Files are written to using the 9P protocol that is network-transparent, meaning also that all file I/O is network-transparent. 9P is also the protocol for remote connections.
  
 
== Programs ==
 
== Programs ==
Line 89: Line 79:
 
* [http://sam.cat-v.org sam] - a minimal text editor that makes use of Standard Regular Expressions and an ed-like command syntax.
 
* [http://sam.cat-v.org sam] - a minimal text editor that makes use of Standard Regular Expressions and an ed-like command syntax.
 
* [http://acme.cat-v.org acme] - Emacs done right, a programming environment that makes heavy use of the mouse and that can be used as a mail client with upas.
 
* [http://acme.cat-v.org acme] - Emacs done right, a programming environment that makes heavy use of the mouse and that can be used as a mail client with upas.
* ed - a venerable text editor.
+
* [[ed]] - a venerable text editor.
 
Both sam and acme are available in plan9port. A port of Vim to Plan 9 and Rio may be found in the <tt>contrib</tt> tree.
 
Both sam and acme are available in plan9port. A port of Vim to Plan 9 and Rio may be found in the <tt>contrib</tt> tree.
  
Line 112: Line 102:
 
== rio ==
 
== rio ==
  
Rio is the Plan 9 windowing system. New users are often confused by Rio's spartan design, grey default background and sometimes the lack of window titles (although if they have used something like cwm or dwm before, they should be fine). Here is a quick list of things you should know so that you can survive in Rio.
+
Rio is the Plan 9 windowing system. New users are often confused by Rio's spartan design, grey default background and sometimes the lack of window titles (although if they have used something like cwm or dwm before, they should be fine). Here is a quick list of things you should know so that you can survive in Rio:
 +
 
 
* The mouse buttons are referred to in manual pages as 1, 2 and 3, 1 being left, 2 being middle and 3 being right. A 3 button mouse is '''strongly''' desired for using Plan 9, although if you have a laptop touchpad or a shitty Apple mouse, then you can substitute with the use of Shift + MB1.
 
* The mouse buttons are referred to in manual pages as 1, 2 and 3, 1 being left, 2 being middle and 3 being right. A 3 button mouse is '''strongly''' desired for using Plan 9, although if you have a laptop touchpad or a shitty Apple mouse, then you can substitute with the use of Shift + MB1.
 
* Right click the desktop to bring up Rio's menu. New creates a new terminal window and Del deletes windows. The right mouse button should be used again when clicking (or more specifically, the same mouse button used to bring up the menu.
 
* Right click the desktop to bring up Rio's menu. New creates a new terminal window and Del deletes windows. The right mouse button should be used again when clicking (or more specifically, the same mouse button used to bring up the menu.
Line 128: Line 119:
 
After you have issued <tt>fshalt</tt>, turn off your computer's power some other way (hit the switch or hold down the power button), unless you have ACPI enabled as shown below, in which case the machine should shut down. Restarting does work on presumably all machines.
 
After you have issued <tt>fshalt</tt>, turn off your computer's power some other way (hit the switch or hold down the power button), unless you have ACPI enabled as shown below, in which case the machine should shut down. Restarting does work on presumably all machines.
 
  % fshalt -r
 
  % fshalt -r
 +
 
=== Edit boot configuration ===
 
=== Edit boot configuration ===
 
On x86-like processors, the Plan 9 bootloader reads instructions on how to boot up from the 9fat partition at the start of the disk. In the 9fat partition is a file called <tt>plan9.ini</tt> which contains these instructions. An example <tt>plan9.ini</tt> could look like this:
 
On x86-like processors, the Plan 9 bootloader reads instructions on how to boot up from the 9fat partition at the start of the disk. In the 9fat partition is a file called <tt>plan9.ini</tt> which contains these instructions. An example <tt>plan9.ini</tt> could look like this:
Line 141: Line 133:
 
The 9fat partition will be mounted under <tt>/n/9fat/</tt> in the namespace of the shell you ran <tt>9fs</tt> in. Simply edit <tt>/n/9fat/plan9.ini
 
The 9fat partition will be mounted under <tt>/n/9fat/</tt> in the namespace of the shell you ran <tt>9fs</tt> in. Simply edit <tt>/n/9fat/plan9.ini
 
</tt> with your preferred editor. Remember that it must end with a blank new line.
 
</tt> with your preferred editor. Remember that it must end with a blank new line.
 +
 
=== ACPI ===
 
=== ACPI ===
 
ACPI is supported only by 9front and is not enabled by default. To enable it, add <tt>*acpi=1</tt> to <tt>plan9.ini</tt> as shown above, and reboot. When <tt>fshalt</tt> is run, <tt>scram(8)</tt> should also be invoked and shut the machine down cleanly.
 
ACPI is supported only by 9front and is not enabled by default. To enable it, add <tt>*acpi=1</tt> to <tt>plan9.ini</tt> as shown above, and reboot. When <tt>fshalt</tt> is run, <tt>scram(8)</tt> should also be invoked and shut the machine down cleanly.
 +
 
== Further reading ==
 
== Further reading ==
 
*[[Wikipedia:Plan_9_from_Bell_Labs]] - The history of Plan 9 and a lot of the concepts used.
 
*[[Wikipedia:Plan_9_from_Bell_Labs]] - The history of Plan 9 and a lot of the concepts used.
Line 148: Line 142:
 
*[http://cat-v.org cat-v.org] - A museum dedicated to technology, philosophy and politics, formerly curated by [[Uriel]].
 
*[http://cat-v.org cat-v.org] - A museum dedicated to technology, philosophy and politics, formerly curated by [[Uriel]].
 
*[http://http://9p.io/plan9/ Plan 9 from Bell Labs] - A mirror of the Plan 9 from Bell Labs site.
 
*[http://http://9p.io/plan9/ Plan 9 from Bell Labs] - A mirror of the Plan 9 from Bell Labs site.
 +
*[https://0x0.st/ehp.pdf ''Introduction to Operating System Abstractions using Plan 9 from Bell Labs'' by Fransisco J. Ballesteros'']
 
*Papers - /sys/doc. Read them with page(1).
 
*Papers - /sys/doc. Read them with page(1).
  
 
== External links ==
 
== External links ==
  
[https://www.youtube.com/watch?v=SoGLU1l7LwY A Narrated Short Demonstration of the Plan 9 system]
+
* [https://vimeo.com/7748726 A Narrated Short Demonstration of the Plan 9 system]
 
 
[https://0x0.st/ehp.pdf ''Introduction to Operating System Abstractions using Plan 9 from Bell Labs'' by Fransisco J. Ballesteros'']
 
  
 
[[Category:Software]]
 
[[Category:Software]]
 
[[Category:Operating systems]]
 
[[Category:Operating systems]]

Latest revision as of 13:41, 25 July 2023

Glenda, the Plan 9 Mascot

(For the popular fork, see 9front)

Plan 9 from Bell Labs is a research OS family, created at Bell Labs by many of the same people who created Unix, like Ken Thompson, Dennis Ritchie and Rob Pike. Its distinguishing features include the use of files with the 9P protocol for most, if not all resources in the operating system (including graphics), and private namespaces, where each process can have a different view of the file system. Interest in Plan 9 stems out of curiosity, admiration and idealism.

History and philosophy

Plan 9 is fundamentally an operating system created to address the practical use of the Unix system since it left Bell Labs, especially in the commercial setting. The world had changed since the days of Research Unix, and graphics and networking had become monumentally important in the computer space. Organisations outside Bell Labs shaped the development of Unix, with the adoption of sockets from BSD and the X Window System from MIT that bent and twisted the "Unix philosophy".

The developers of Plan 9, then, set out to develop a new operating system for research, exploring areas such as distributed computing, naturally graphics and networking, and heterogenous access to system resources. While Plan 9 is not Unix, it is to an extent Unix-like, and feels rather like the later versions of Research Unix after the flight of Unix outside of Bell Labs (and even has some of the features of those later Research Unix releases).

Licensing

The first and second editions of Plan 9 were only available to universities, for an exorbitant fee in book and CD form. The third edition of Plan 9 was released under the Plan 9 Licence in 2000, which Richard Stallman considered non-free. The fourth edition was released under the Lucent Public Licence in 2002 which the FSF does consider free but not GPL-compatible, along with the distribution becoming openly developed and updated daily. In 2014, Plan 9 was relicenced under GPLv2 for the University of California, Berkeley's Akaros operating system (to much distaste).

This author interprets the licence situation of Plan 9 to be dual licensing under both the Lucent Public License 1.02 and the GNU General Public License 2. You may be able to guess which license the community prefers.

There is a perception in the Plan 9 pommunity that it was due to the prohibitive cost and later licence confusion that Plan 9 made much ground commercially.

after Bell Labs gave rights of Plan 9 to the Plan 9 Foundation, the Plan 9 foundation re-releasesd all historical Plan 9 releases under MIT in March 23, 2021.

Distributions

  • 9legacy, a distribution of several patches on top of the Bell Labs distribution.
  • 9atom is Erik Quanstrom's personal fork of Plan 9. It augments the Plan 9 distribution with the addition of a 386 PAE kernel, an amd64 CPU and terminal kernel, nupas, extra PC hardware support, IL and Ken's fs, most of which have been incorporated into or available for 9front.
  • Inferno is a distributed operating system started at Bell Labs, but is now developed and maintained by Vita Nuova Holdings as free software.
  • 9front is an active, community-led fork of Plan 9 from the People's Front of Cat -V, after the front fell off.
  • plan9port is not an operating system, but a port of many Plan 9 applications, utilities and libraries to Unix-like operating systems such as GNU/Linux and BSD.

9front is at the forefront of Plan 9 Ontologically-Oriented Technology, including new advancements such as better hardware support, audio, wireless networking and new programs like NES, SNES, Game Boy, GBA and Genesis emulators and a paint program. If you want to run Plan 9, this is probably the way to go. Most of this article assumes you are using 9front.

Concepts

Graphics

Graphics is considered ubiquitous in Plan 9, and while Plan 9 features the ancient and revered Unix toolkit (awk, grep, cat), it is therefore not plausible to use without graphics.

Plan 9's graphical shell is called Rio. (How to use Rio follows shortly.) The way Plan 9 abstracts graphics hardware is through offering drawing surfaces as character files. Applications write to this file with drawing commands usually using libdraw. Rio uses the top-level surface to draw to the whole screen, and each new Rio window creates a new drawing surface, and using private namespaces, provides that surface to applications in the same way. You can test this by running a graphical program when Rio is not active, which draws to the entire screen, and by running Rio inside a Rio window.

Mouse cording

Mouse cording is common to Rio and Acme, the development environment. Mouse Chording was first introduced in the NLX System used in The Mother of All Demos. Mouse Cording works by pressing various keys on the mouse to form a cord (like a Guitar), which produces various commands. It is simpler than the NLX version which used a binary format.

The distributed Plan 9 environment

Plan 9 networks generally consist of three classes of machine:

  • CPU servers - These machines export the CPU resource and accept remote connections from terminals.
  • File servers - Machines with disks. A standalone 9front or Plan 9 installation is most likely one of these.
  • Terminals - Not necessarily running Plan 9, these machines connect to the CPU server.

Note: 9front adds a fourth class, the auth server. This is where security keys and user account information (not files) are stored.

The concept of network transparency was one of the most important factors in the design of Plan 9. You should be able to feel as if your terminal and the CPU server you have just logged into are the same machine and are accessing the exact same resources, instead of being completely abstract environments as happens in Unix-like operating systems with SSH. Usually however most single Plan 9 installations are a combination of file server and terminal.

If you wanted to use Plan 9 as a server (bearing in mind that performance will be a lot worse than Linux or BSD) the closest analogue would be a file server or CPU server backed by a file server.

Everything is a file

The grand abstraction of Plan 9 is that everything is shown as a file. Files are written to using the 9P protocol that is network-transparent, meaning also that all file I/O is network-transparent. 9P is also the protocol for remote connections.

Programs

It should be noted there are few choices of software for Plan 9, maybe owing to lack of users but also to how good the software actually is.

Web browser

Two feasible options for web browsing exist on Plan 9:

  • mothra - a very fast and simple web browser (or rather, a web document reader). Under the hood it uses the webfs interface. It supports only HTML and images. Included in 9front and available as a contrib package for other distributions.
  • abaco - no. People will make fun of you for using this. abaco is a web browser designed to run in the modual acme editor, with support for Javascript and css

Text editor

  • sam - a minimal text editor that makes use of Standard Regular Expressions and an ed-like command syntax.
  • acme - Emacs done right, a programming environment that makes heavy use of the mouse and that can be used as a mail client with upas.
  • ed - a venerable text editor.

Both sam and acme are available in plan9port. A port of Vim to Plan 9 and Rio may be found in the contrib tree.

E-mail

  • upas - the network mail file system.
  • nupas - the network mail file system. Instead of loading your entire mailbox into memory, nupas loads it into an index file on disk and does the operations on that file.

Use nedmail or acme mail to read your e-mails from upas.

The rc shell

Plan 9's default shell is the rc shell, designed by Tom Duff. It's constructs are similar to Unix's Bourne shell but are somewhat syntactically different. The most important thing to get around in your head is how programs in subdirectories of /bin (where many different directories are bound, making the use of a $PATH variable redundant) are executed. The programming environment Acme is placed directly in /bin, so a simple

% acme

will do. Now, this is a rather contrived example, but let's assume we have a new disk and we want to run fdisk(8) on it.

% fdisk

won't work, because fdisk is actually in /bin/disk/fdisk (it's probably really in /386/bin/disk/fdisk). So you would need to run

% disk/fdisk

A better example is if you cannot wrap your head around rc, and you really want your curmudgeonly Unix-like shell, you should run

% ape/sh

because sh is in the ape (ANSI POSIX Environment) folder.

rio

Rio is the Plan 9 windowing system. New users are often confused by Rio's spartan design, grey default background and sometimes the lack of window titles (although if they have used something like cwm or dwm before, they should be fine). Here is a quick list of things you should know so that you can survive in Rio:

  • The mouse buttons are referred to in manual pages as 1, 2 and 3, 1 being left, 2 being middle and 3 being right. A 3 button mouse is strongly desired for using Plan 9, although if you have a laptop touchpad or a shitty Apple mouse, then you can substitute with the use of Shift + MB1.
  • Right click the desktop to bring up Rio's menu. New creates a new terminal window and Del deletes windows. The right mouse button should be used again when clicking (or more specifically, the same mouse button used to bring up the menu.
  • When you start a graphical program in a Rio window, it replaces the terminal window, unlike X11 and UNIX where a new window is spawned.
  • To resize windows, use MB1 and drag on the window borders.
  • To move windows, use MB3 and drag on the window borders.
  • Many programs, like the Rio terminal windows, have another menu shown by using MB2.
  • Rio terminal windows don't scroll with the output by default and therefore block execution of the program. If you are compiling or in an IRC client, this will probably be a bad thing, so use the MB2 menu to select scroll. As well, you can edit your profile and pass Rio the -s option, so all new windows are in scroll mode.

Rio has been imitated by an X11 window manager of the same name, which is included in plan9port.

How to

Shut down

Shut down the file server, which in practice should be the machine Plan 9 is running on, using the fshalt(8) command. After you have issued fshalt, turn off your computer's power some other way (hit the switch or hold down the power button), unless you have ACPI enabled as shown below, in which case the machine should shut down. Restarting does work on presumably all machines.

% fshalt -r

Edit boot configuration

On x86-like processors, the Plan 9 bootloader reads instructions on how to boot up from the 9fat partition at the start of the disk. In the 9fat partition is a file called plan9.ini which contains these instructions. An example plan9.ini could look like this:

bootfile=/386/9pcf
bootargs=/dev/sdE0/fscache -C
monitor=vesa
vgasize=1024x768x32
mouseport=ps2

These should be mostly self-descriptive. For more information, see plan9.ini(8)

To mount 9fat and edit plan9.ini, mount it using the 9fs utility.

% 9fs 9fat

The 9fat partition will be mounted under /n/9fat/ in the namespace of the shell you ran 9fs in. Simply edit /n/9fat/plan9.ini with your preferred editor. Remember that it must end with a blank new line.

ACPI

ACPI is supported only by 9front and is not enabled by default. To enable it, add *acpi=1 to plan9.ini as shown above, and reboot. When fshalt is run, scram(8) should also be invoked and shut the machine down cleanly.

Further reading

External links