FAQ: What is OS Inferno and why is it needed?
The information in the
previous post was outdated by almost 4 years, and I was asked to update it. They also asked not to mix the installation with the setting in one post, so there will only be the installation, and
the inferno setting is described in a separate post.
Update: Description of the installation for Windows updated in June 2014.
So, we will install the
distributed OS Inferno . The
official website has
installation instructions , but they are not entirely correct and are also a bit outdated. Inferno can work in two modes -
native (on bare hardware or in qemu / etc. Like all normal OS) and
hosted (as usual application under * NIX / Win).
Instructions for installing native Inferno can be found in the
Russian wiki . In addition, there are other options - for example,
installing Inferno on Android (Eng.) . Personally, I don’t see any sense in using native Inferno on ordinary computers, so I’ll describe the installation of hosted Inferno under Gentoo, Ubuntu, FreeBSD, MacOSX and Windows.
Content
Installation Features
OS Inferno Versions
Theoretically, the latest official version of the Fourth Edition was released around 2004. The current version is in the Mercurial repository on Google Code, and calls itself "New Edition". Practically, there is no point in using anything other than the current version from the repository - it is absolutely stable and has always been stable. And we will put it.
')
Single or multi-user installation style
Inferno can be installed system-wide (for example, in
/usr/inferno/
) so that all users can use it. Inferno supports everything that is required for this - work with user rights, individual home directories, etc. On the other hand, an inferno can be put just in your home directory (for example in
~/inferno/
), which is even more convenient. I have over-complicated the previous article by describing both methods at the same time, but now I decided that it would be easier to describe only the single-user installation option. If someone from the readers of this article has a server on which there is more than one infferno user - he hardly needs my instructions for installing inferno. ;-) So, we will install in
~/inferno/
on * NIX systems, and in
C:\inferno\
on Windows.
32/64 bits
OS Inferno 32-bit. Therefore, to install and run in 64-bit OS, support of 32-bit applications in these OS is required. Unfortunately, under 64-bit FreeBSD-9.0, I was not able to start the inferno.
Hardened / PaX / SeLinux / etc.
Inferno runs the code in the virtual machine, plus it supports JIT, so it has the same problems with various protections as Java, etc. In the previous article I paid more attention to this topic, if there are any questions - look there.
Time and place
The installed inferno is approximately 200MB. But installing compilers can take up to more than 3 gigabytes (for example, on Xcode or Visual Studio). Inferno is compiled in just a couple of minutes on an average system.
Location
When installing inferno in the home directory should be borne in mind that the inferno does not like special. characters in file / directory names, so if the path to the home directory contains, for example, a space, then difficulties that I have not taken into account may arise.
Installation
In (Hardened) Gentoo Linux 32/64-bit everything is trivial - there is a package that installs inferno system-wide in
/usr/inferno/
:
layman -a powerman emerge inferno
And we will deal now with the rest of the operating systems.
Mercurial, compilers and everything are all everything
... Ubuntu 12.04 32-bit
sudo apt-get install -y mercurial sudo apt-get install -y libxext-dev
... Ubuntu 12.04 64-bit
sudo apt-get install -y mercurial sudo apt-get install -y libc6-dev-i386 sudo apt-get install -y libxext-dev:i386
... FreeBSD 8.0 32-bit
pkg_add -r mercurial
... Mac OS X 10.6.8 Snow Leopard 32-bit
I already had Xcode (3.2.2) and Mercurial (1.7.1) installed.
... Mac OS X 10.7.4 Lion 64-bit
Install Xcode (4.3.2) via the App Store.
Launch Xcode, go to the Xcode menu - Preferences - Downloads and click Install for the Command Line Tools.
Go to
mercurial.berkwood.com and download / install the current version (Mercurial 2.2.2 for OS X 10.7).
... Windows (XP 32-bit, Seven 32-bit, Seven 64-bit)
Go to
mercurial.selenic.com/downloads and download / install the current version (3.0.1).
But with the compiler there are options. The obvious option with installing Visual Studio Express will cost more than 3 gig on the screw. An alternative option - to put WinSDK - will cost about 800 megabytes. I will describe both options, choose yourself.
First option. Go to
www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express and download / install / update (according to Russian custom - three times :) otherwise not all updates will be installed) "Visual C ++ 2010 Express ".
The second option. First, go to
go.microsoft.com/fwlink/?LinkId=187668 and download / set the full ".NET Framework 4". Then we go to
www.microsoft.com/en-us/download/details.aspx?id=8279 and download / install “Windows SDK 7.1”. At installation it is enough to be limited to these points:
(In 2014, my SDK refused to install until I took down all of Visual C ++ 2010 Redistributable - they turned out to be too new for it.) Then we update it too. In fact, updating, probably, is not necessary, it has just become a habit.
Download and update the source of inferno
Despite the fact that the official website offers a separate archive for Windows, and separate binaries for Macs, we don’t need all this and it’s even harmful (the archive for Windows isn’t updated normally from the repository - conflicts arise). So under all OS we will be installed from inferno-20100120.tgz. The point of using this archive instead of simply cloning the repository is that the archive includes some files (mostly fonts) that the license prohibits to upload to Google Code, so they are not in the repository.
... * NIX
wget http://www.vitanuova.com/dist/4e/inferno-20100120.tgz tar xzf inferno-20100120.tgz cd inferno/ hg pull -uv
... Win
Download
www.vitanuova.com/dist/4e/inferno.zip (it is recommended on the site, but you can take .tgz - I have both the one and the other going).
We unpack in
C:\inferno\
. I do not know what is needed to unpack .tgz under Windows - I had Far and 7Zip, I unpacked Far.
Run
cmd
.
cd \inferno hg pull -uv
We leave from
cmd
.
Configuring Environment Variables
The only really necessary variable is
PATH
. In
EMU
, the default parameters are set to start the inferno, it is needed just for convenience. As for
INFERNO_ROOT
the inferno does not know about it at all, we need this variable just for convenience. In addition to setting variables in the current session, we will write them into the start scripts.
... Ubuntu
export INFERNO_ROOT=$(pwd) export PATH=$INFERNO_ROOT/Linux/386/bin:$PATH export EMU=-r$INFERNO_ROOT echo "export INFERNO_ROOT=$INFERNO_ROOT" >> ~/.bashrc echo "export PATH=\$INFERNO_ROOT/Linux/386/bin:\$PATH" >> ~/.bashrc echo "export EMU=-r\$INFERNO_ROOT" >> ~/.bashrc
... FreeBSD
export INFERNO_ROOT=$(pwd) export PATH=$INFERNO_ROOT/FreeBSD/386/bin:$PATH export EMU=-r$INFERNO_ROOT echo "export INFERNO_ROOT=$INFERNO_ROOT" >> ~/.bash_profile echo "export PATH=\$INFERNO_ROOT/FreeBSD/386/bin:\$PATH" >> ~/.bash_profile echo "export EMU=-r\$INFERNO_ROOT" >> ~/.bash_profile
... Mac OS X
export INFERNO_ROOT=$(pwd) export PATH=$INFERNO_ROOT/MacOSX/386/bin:$PATH export EMU=-r$INFERNO_ROOT echo "export INFERNO_ROOT=$INFERNO_ROOT" >> ~/.bash_profile echo "export PATH=\$INFERNO_ROOT/MacOSX/386/bin:\$PATH" >> ~/.bash_profile echo "export EMU=-r\$INFERNO_ROOT" >> ~/.bash_profile
... Win
Go to: Control Panel -> System -> Advanced System Settings (in XP just “Advanced”) -> Environment Variables.
Add to the end Path:;
;C:\inferno\Nt\386\bin
Create a new variable: INFERNO_ROOT:
C:\inferno
Create a new variable: EMU:
-rC:\inferno
Configure build options
You can edit the
mkconfig
file manually in all operating systems, but for simplicity, I will, where possible, give the commands automatically changing the config.
... Ubuntu
perl -i -pe 's/^ROOT=.*/ROOT=$ENV{INFERNO_ROOT}/m' mkconfig perl -i -pe 's/^SYSHOST=.*/SYSHOST=Linux/m' mkconfig perl -i -pe 's/^OBJTYPE=.*/OBJTYPE=386/m' mkconfig
In linux, Inferno supports IPv6. Moreover, this IPv6 is used by default. It suits you or not - decide for yourself. I personally turn it off:
perl -i -pe 's/ipif6/ipif/g' emu/Linux/emu emu/Linux/emu-g
... FreeBSD
perl -i -pe 's/^ROOT=.*/ROOT=$ENV{INFERNO_ROOT}/m' mkconfig perl -i -pe 's/^SYSHOST=.*/SYSHOST=FreeBSD/m' mkconfig perl -i -pe 's/^OBJTYPE=.*/OBJTYPE=386/m' mkconfig
... Mac OS X
perl -i -pe 's/^ROOT=.*/ROOT=$ENV{INFERNO_ROOT}/m' mkconfig perl -i -pe 's/^SYSHOST=.*/SYSHOST=MacOSX/m' mkconfig perl -i -pe 's/^OBJTYPE=.*/OBJTYPE=386/m' mkconfig
... Win
Editing
mkconfig
:
ROOT=c:/inferno SYSHOST=Nt OBJTYPE=386
Assembly
... * NIX
sh makemk.sh mk nuke mk install
... Win Seven 64-bit
If you installed WinSDK, then you need to make a new shortcut to “Windows SDK 7.1 Command Prompt”, go into its properties and add the
/x86
parameter - to make it like this:
C:\Windows\System32\cmd.exe /E:ON /V:ON /T:0E /K "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x86
If you put Visual C ++ 2010, then I don’t know how to run a 32-bit compiler (but maybe this is done in about the same way).
What to do next is described in the next paragraph for all versions of Windows.
... Win
Run the “Windows SDK 7.1 Command Prompt” (or “Visual Studio Command Prompt (2010)” - depending on what you installed).
cd \inferno mk nuke mk install
Launch
Actually, that's all. Now you can start an inferno with the
emu
or
emu-g
command (the second one is different because it does not support the graphical mode, but it will work on servers without Xs and is very convenient for running different network services). The graphical environment can be seen by running the
wm/wm
command inside the emu:
$ emu ; wm/wm
useful links
For those who do not stop installing the system, it may be interesting to read my
description of Limbo in Russian , the
current version of the man-documentation in html , look at
my inferno modules and applications, and a
large archive of applications for inferno from mjl . The English-speaking community lives on the
maillist and on IRC
#inferno
on the freenode network.
PS
I answer in advance the traditional question "who needs it and why." In hosted mode, inferno is used in much the same way as Erlang, Java or Go - for developing applications in a cool programming language that runs in a very pleasant environment, which are simple and comfortable to write and that work at least as good as similar applications in other languages . Unlike Erlang, Inferno doesn’t have many out-of-the-box things (but they are easily implemented with handles if necessary), but this is a general-purpose system suitable for solving any tasks (well, except for low-level drivers, etc., as usual). Unlike Java, we have full-fledged lightweight threads and the ability to write simple multi-threaded applications in the style of CSP. Unlike Go, we have a virtualized and simplified environment, identical under any OS. In general, the inferno is a really great system for a long time ready to be used in production on commercial projects (we use it there) and deserves much more popularity than it has.