Using Inferno

Back To Mike's WebToys Page!

Inferno is a new, small, fast, embeddable OS from Lucent that looks pretty cool, but has virtually no documentation available on it. The first thing to keep in mind is that Inferno was written by the same company that produced UNIX and Plan9, and seems to inherit most of the structure from those OSs. For example, Inferno borrows a lot of shell commands from UNIX(not necc. all of them, though - but if you're looking for help, try these), as well as the idea that everything can be looked at as a file - files, network devices, even programs. All communication is through an interface that looks like a file. From Plan9 it borrows the idea of exploiting the file interface to transparantly send communcation across a network. Within Inferno, that the "file" your program is talking to isn't necessarily on the same machine. Inferno takes care of marshalling your input/output from your local machine to the file interface on the server machine, which presents a much more simple model for creating network-aware applications. The actual protocol for this 'network file system'-esque communication is called Styx, and what I'm primarily interested in.

The value added that Inferno brings to the game is that it's based on a virtual machine, much like Java. Thus, code that's written to the Inferno VM (called "Dis") can be run on any platform that has an Inferno VM either emulated (Windows, Unix), or native (Dis can actually be run on hardware w/o another OS below it). Indeed, there's even a special language ("Limbo") to write programs for it.

Since I'm interested in distributed system, Styx is what holds most of my attention. Interestingly enough, Styx itself is a pretty small protocol, with 13 types of messages, all used to support the 'file interface'. Styx is assumed to run an a reliable (ie, TCP-reliable: no message reordering,etc) network connection, but itself does not provide such services.

The following is a collection of errata about using Inferno, either from a user's point of view, or a programmer's.

Users

The easiest way to create users is to do: cp -r inferno <NewUserName>, which does a recursive copy of the default Inferno user to whomever you want. At this point, you can then cd to the new directory, and adjust settings. When wm starts up, it'll look in this directory for a user's settings. This is also a good place to store the....

Namespace file

These are analagous to .profile, or .cshrc files in UNIX, except that these aren't automatically executed, and they don't have any naming restrictions in particular. You use the command nsbuild to execute this, which consists (mainly) of lots of calls to bind. For example, you could put bind '#I' /net in one the file /usr/Inferno/namespace, and invoke nsbuild /usr/Inferno/namespace when you start Inferno to load the IP device. Or you could put the file in one of the other user directories.

Using the web browser

First up, it's a good idea to up the memory of the emulator, so add the command line option -piimage=16384000 to whatever shortcut you use, or on the command line if you're using DOS/linux/etc. Then start the emulator up & you're in the Inferno command interpreter.

Next, make sure that you've got the IP networking stuff set up - you'll want to bind the IP device using the command bind '#I' /net. Note that the #I has to be escaped/protected with the single quotes on either side of it when typed at the prompt, but can be left out of namespace files. You'll need to start the connection server by typing lib/cs. What you're actually telling Inferno to do is to look in the /dis/lib directory, and run cs.dis (".dis" == ".exe", pretty much). If you're interested in seeing what other command are available with Inferno, you can look in the /dis directory. If you've already started a connection server, the second instance will complain when started, then exit w/o harming anything

To start the window manager, you then type wm/logon (Ie, look in /dis/wm for the logon program), which will bring up wm. If you're created a user already, you can log in as that, otherwise you can log in as "Inferno". At this point, you can use the "Start" menu to pull up the web browser.