Skip to main content

Building a 4-node cluster for experimenting with the distributed operating system.

Main9_322100097cf216069dc786a7a96da6a8d12e3c3e.jpg

Plan 9 from Bell Labs comes from the same stable as the UNIX operating system, which of course Linux was designed after, and Apple’s OS X runs on top of a certified UNIX operating system. Just like UNIX, Plan 9 was developed as a research O/S — a vehicle for trying out new concepts — with it building on key UNIX principles and taking the idea of devices are just files even further.

In this post, we take a quick look at the Plan 9 O/S and some of the notable features, before moving on to the construction of a self-contained 4-node Raspberry Pi cluster that will provide a compact platform for experimentation.

From Outer Space!

Glenda_5040b98f1a23a46ca6bcfa61c9fd6ce81f86d267.jpg

Image: Glenda, the Plan 9 bunny, by Renée French.

The Plan 9 from Bell Labs operating system takes its name from cult science fiction film, Plan 9 from Outer Space. It also has arguably the cutest mascot of any O/S, Glenda. Fans of the Go programming language may notice some artistic similarities between its gopher mascot and Glenda, which is due to the fact that both were designed by comics writer and illustrator, Renée French.

The connections by no means end there and in fact Go builds on certain key ideas from Plan 9, with Ken Thompson — who designed and implemented UNIX — and Rob Pike being co-creators of both the programming language and the O/S, amongst many other notable achievements.

So what’s special about Plan 9? Well, it’s a distributed O/S where you have machines that are designated as file servers, CPU servers or terminals. Which might not sound that unusual, however, access to resources across these is transparent; everything is presented as a file that can be exported for use remotely, e.g. CPU, I/O devices, backup services and the window system.

Plan 9 does away with the idea of a superuser (root) and instead, the “host owner” of each system owns all of its resources and is able to manipulate CPU, disk and processes etc. Processes (including users) each have their own view of the namespace (file system) too, which facilitates distributed operation and supporting remote access as the common case.

Programs that provide services-as-files speak a common unified protocol called 9P. There is a windowing system, text editors and other commonly used applications, such as a mail client.

The 1st edition of Plan 9 was released to universities in 1992 and it subsequently went on to be released for non-commercial purposes, then under an open source licence. The last official release was made by Lucent Technologies in 2002. Despite being a research O/S, Plan 9 did find its way into some products, such as a RAID array for use in data centres. It also gained something of a dedicated following, with the original codebase and forks still being maintained today.

Cluster Construction

CluserCase_62aac3687f50d8d9f89d71bd076d0ec1543f50c8.jpg

The idea with the Pi cluster is to have a self-contained system, or rather a neatly packaged distributed system, that can be used for experimenting with Plan 9. It is housed in a custom laser cut acrylic enclosure, with parts folded so as to simplify the case design and require fewer fasteners.

Folding_fdd74de768528850e8bb4cd0e0c6291429691096.jpg

The enclosure is made from two folded pieces, with an additional disc located above vents in the top half, which if we’re honest is there mostly to give it a suitably space-age feel!

Folded_c918d4ee05d0722e4f20578b58106a4982233f89.jpg

There is also a bracket for an Ethernet switch — which avoids having a bunch of network cables sticking out of it — and a second small bracket to hold an absolutely essential LED that is there to illuminate the outline of Glenda which is etched onto the inside of the case front.

Assembling_9e923a6b480017c10c36b8d4fe001a7c65829c2c.jpg

Panel mount extension cables are used for access to USB and HDMI on the Raspberry Pi that will be configured as a terminal, along with an Ethernet connection from the switch to the outside world.

Assembled_0415eacc1a5cad0afae11d09a171d2aa2e3ef51e.jpg

Power is supplied to the stack of Pi boards plus Ethernet switch via a 3-pin XLR connector.

Enclosed_6f4f1fb50d151e939d4d36eb6f147d8cff60d53c.jpg

A number of hexagonal nylon spacers were fitted together to provide long stand-offs that could be secured to the top and bottom halves by M3 nylon screws. The disc above the vent on the top of the case was secured in place via an additional four M3 nylon screws and nuts, with 5mm circular spacers between the two acrylic parts, although M3 nylon nuts could be used here instead.

First Boot

Setup1_3b56377c1bcf5a757558f9d0997328b8b0405df3.jpg

One of the more distinctive Plan 9 forks goes by the name of 9Front and while the website is a little strange, handily for us, they also provide a Raspberry Pi image that we can simply write out to a Micro SD card.

EDIT 25/06/18: while we used a Raspberry Pi 2 Model B and at the time of writing this was the latest version support by 9Front, it turns out that the authentic Plan 9 distribution has benefited from continued updates. For example, the Pi 3 Model B+, along with its gigabit Ethernet and new WLAN module, is supported. An SD card image is available to download.

A Micro SD card was written out and inserted into the Pi at the bottom of the stack, which is the one with HDMI and USB connections brought out to the back of the enclosure.

Keyboard_14ba59ea61a8c7a34798f3b87bba7a7ab3fa9d7b.jpg

The project provided an excuse to make use of a Vortex Core 47-key keyboard, which together with a mini white HDMI monitor, provided a particularly compact and suitably futuristic feeling setup.

GlendaGlow_e9f567dd886b6ad56c254220036fe46670923a61.jpg

Upon power being applied our mascot, Glenda, was illuminated.

Booted_e210115d6dde7aae2b906d6ba514214e0047f913.jpg

The terminal booted and we were presented with a windowing system and welcome text.

Why?

You might be thinking, “but why would anyone want to build such a thing?” And the possible answers for which include, “because you can!” In any case, while Plan 9 may not be destined for world domination it is fascinating from an operating systems engineering perspective and, as previously noted, ideas taken from it have gone on to be implemented elsewhere.

If you’d like to build your own 4-node Pi cluster, to run Plan 9 or some other operating system(s), you can find the design files for the case on GitHub.

Andrew Back

Open source (hardware and software!) advocate, Treasurer and Director of the Free and Open Source Silicon Foundation, organiser of Wuthering Bytes technology festival and founder of the Open Source Hardware User Group.
DesignSpark Electrical Logolinkedin