hello friends! new(ish)!
Plan 9: Difference between revisions
>Keboler mNo edit summary |
>Keboler (Autism) |
||
Line 2: | Line 2: | ||
[[File:plan9.jpg|thumb|Glenda, the Plan 9 Mascot]] | [[File:plan9.jpg|thumb|Glenda, the Plan 9 Mascot]] | ||
'''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 | '''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. | ||
== Licensing == | == Licensing == | ||
Line 8: | Line 8: | ||
The First and Second Editions of Plan 9 were only available to universities and then for an exorbitant fee. | The First and Second Editions of Plan 9 were only available to universities and then for an exorbitant fee. | ||
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 UCB's Akaros operating system (to much dislike). | 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 UCB's Akaros operating system (to much dislike). | ||
tl,dr: '''Plan 9 is free software.''' | |||
== Distributions == | == Distributions == | ||
*[http://plan9.bell-labs.com/plan9/ Plan 9 from Bell Labs], the Fourth Edition, where development is almost | *[http://plan9.bell-labs.com/plan9/ Plan 9 from Bell Labs], the Fourth Edition, where development is almost dead. | ||
*[http://www.9legacy.org/ 9legacy], which is several patches on top of the Bell Labs distribution. | *[http://www.9legacy.org/ 9legacy], which is several patches on top of the Bell Labs distribution. | ||
Line 20: | Line 22: | ||
*[http://9front.org/ 9front] is an active, community-led fork of Plan 9, the life and breath of 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. | *[http://9front.org/ 9front] is an active, community-led fork of Plan 9, the life and breath of 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. | ||
*[https://swtch.com/plan9port/ plan9port] is not an operating system, but a port of many Plan 9 applications and utilities to UNIX-like systems such as GNU/Linux and *BSD. | |||
== Concepts == | == Concepts == | ||
Line 29: | Line 33: | ||
* CPU servers - These machines export the CPU resource and accept cpu(1) and drawterm connections. | * CPU servers - These machines export the CPU resource and accept cpu(1) and drawterm connections. | ||
* 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. | ||
Line 42: | Line 45: | ||
=== Web browser === | === Web browser === | ||
Two really feasible options for web browsing exist on Plan 9: | Two really feasible options for web browsing exist on Plan 9: | ||
* mothra | * 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. | ||
* abaco | * abaco - a web browser that looks like acme. It does a bit of CSS, but still no JavaScript. | ||
=== Text editor === | === Text editor === | ||
* [http://sam.cat-v.org sam | * [http://sam.cat-v.org sam] - a minimal text editor that makes use of Standard Regular Expressions. | ||
* [http://acme.cat-v.org acme | * [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 | * ed - a venerable text editor. | ||
Both sam and acme are available in plan9port. | |||
=== 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 === | === The rc shell === | ||
Line 59: | Line 68: | ||
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 | 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 | % disk/fdisk | ||
A better example is if you cannot wrap your head around rc, and you really want your | 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 | % ape/sh | ||
because sh is in the ape (ANSI POSIX Environment) folder. | because sh is in the ape (ANSI POSIX Environment) folder. | ||
Line 73: | Line 82: | ||
* Many programs, like the Rio terminal windows, have another menu shown by using MB2. | * 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 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. | |||
== Shutting down == | == Shutting down == | ||
Line 78: | Line 89: | ||
Simply running Plan 9 or 9front on your laptop means your system is a file server, which is where the shutdown command fshalt(8) derives it's name: | Simply running Plan 9 or 9front on your laptop means your system is a file server, which is where the shutdown command fshalt(8) derives it's name: | ||
fshalt | fshalt | ||
After you have issued fshalt, turn off your computer's power some other way (hit the switch, hold down the power button) | After you have issued fshalt, turn off your computer's power some other way (hit the switch, hold down the power button). Restarting works fine though: | ||
fshalt -r | fshalt -r | ||
If you can get ACPI to work, scram | If you can get ACPI to work, fshalt should really invoke scram and shut the machine down. To enable ACPI, you should add | ||
*acpi=1 | |||
to plan9.ini, which is on the 9fat partition mounted so: | |||
% 9fs 9fat | |||
ACPI is only supported on 9front and is not enabled by default. One could guess that it is not enabled by default (the same behaviour is found in the halt utility in OpenBSD) because ACPI sucks '''hard'''. | |||
== Further reading == | == Further reading == | ||
*[https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs Plan 9's Wikipedia page] - The history of Plan 9 and a lot of the concepts used. | *[https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs Plan 9's Wikipedia page] - The history of Plan 9 and a lot of the concepts used. |
Revision as of 21:44, 21 November 2015
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.
Licensing
The First and Second Editions of Plan 9 were only available to universities and then for an exorbitant fee. 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 UCB's Akaros operating system (to much dislike).
tl,dr: Plan 9 is free software.
Distributions
- Plan 9 from Bell Labs, the Fourth Edition, where development is almost dead.
- 9legacy, which is 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.
- 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, the life and breath of 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.
- plan9port is not an operating system, but a port of many Plan 9 applications and utilities to UNIX-like systems such as GNU/Linux and *BSD.
Concepts
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 cpu(1) and drawterm connections.
- 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.
Everything is a file
The grand abstraction of Plan 9. Absolutely everything is a file. These files use the 9P protocol, which can also be used over the network as 9P shares. Even Rio programs write to files to do graphics. Network interfaces are also files (/net). Folders are probably files as well (which is why cat loves to output folders as if nothing is wrong).
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 really 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.
- abaco - a web browser that looks like acme. It does a bit of CSS, but still no JavaScript.
Text editor
- sam - a minimal text editor that makes use of Standard Regular Expressions.
- 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.
- 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 actually bound) are executed. Acme will most likely be placed 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.
Shutting down
Simply running Plan 9 or 9front on your laptop means your system is a file server, which is where the shutdown command fshalt(8) derives it's name:
fshalt
After you have issued fshalt, turn off your computer's power some other way (hit the switch, hold down the power button). Restarting works fine though:
fshalt -r
If you can get ACPI to work, fshalt should really invoke scram and shut the machine down. To enable ACPI, you should add
*acpi=1
to plan9.ini, which is on the 9fat partition mounted so:
% 9fs 9fat
ACPI is only supported on 9front and is not enabled by default. One could guess that it is not enabled by default (the same behaviour is found in the halt utility in OpenBSD) because ACPI sucks hard.
Further reading
- Plan 9's Wikipedia page - The history of Plan 9 and a lot of the concepts used.
- 9front's Frequently Questioned Answers - A document that somewhat copies the structure of the OpenBSD FAQ that explains how to do quite a lot of things with 9front and Plan 9. A lot of this page is
plagiarisedinspired by this document. - cat-v.org - A museum dedicated to technology, philosophy and politics, formerly curated by Uriel.
- Plan 9 from Bell Labs - A mirror of the Plan 9 from Bell Labs site.
- Papers - /sys/doc. Read them with page(1).