Installing Native Inferno on a PC
WARNING!! WARNING!! Try this at your own risk.
Be warned that it has been tested in only a few
restricted situations.
As with any change to the partition table, you
run the risk of blowing everything away.
Okay, disclaimer aside.
This page describes how to install Inferno on a
bare PC.
I.e. it runs natively, with its own file system rather
than being hosted.
I strongly suggest you read through all of this
before beginning.
Then decide if you want to take the risk.
This CD and procedure has been tested on the
qemu emulator and on a Compaq Presario 1279.
In the latter case, I installed in a second primary
partition, leaving a Windows partition in place.
If you are using qemu, see the qemu-specific notes
at the bottom of this page.
So without futher ado, here are the steps and
a number of caveats:
- Download the CD from here.
It contains only the Inferno part of the material
from the May 10, 2007 release.
In particular, it includes nothing of the OS source, the utilities source,
and the binaries for various host OSs.
- The CD is compressed using gzip.
The compressed image is about 20MB, and the iso file
is about 45MB after it's uncompressed.
Burn the image to a CD.
- The CD is bootable, and should work on most
PCs.
It does assume that the CD is the master drive on
the second IDE controller.
This is the most common configuration, but if that's not
true for your machine, you'll have to specify a different
place to find the kernel image.
- After Inferno boots and is initalized, you'll
be presented with a semicolon (;) prompt.
To begin the installation, issue the command
sh install.sh [-m] src dest
WARNING: Do NOT use the -m option when installing
to a disk that already has a parition table.
Doing so will erase that partition table, and you'll
lose any partitions already on that drive that you want
to keep.
The src and dest parameters should be the device
directories for the installation CD and the target
disk drive, respectively.
So, in the usual case where the CD drive is the
secondary master and you want to install on the
primary master, the command would be:
sh install.sh /dev/sdD0 /dev/sdC0
If the -m option is included, a master boot
record is installed on the target drive.
This is most often used in an emulator such as
qemu when installing to a disk image that has
not been used before.
This installation script operates as follows:
- The first step in the installation is partitioning the
drive.
Because mistakes in partitioning have the potential
to lose data, you may want to do the partitioning
with another partitioning tool you're familiar with.
The installation script runs the Inferno version of fdisk and leaves you at
a prompt.
If you haven't already created one,
you'll want to create a primary partition of the type
Plan9.
A secondary,
or extended, might work, but I haven't tested it.
This should be the only partition of that type.
If you already have Plan 9 on the system, then you'll
want to run the installation manually to ensure
that you don't reformat your existing Plan 9 partition.
- Once you quit fdisk, everything else will happen
automatically.
Be warned that this is very rough and it does not try
to handle errors intelligently.
You'll see output indicating that it is creating the subpartitions,
mounting the CD, and the directories are each are populated.
Be forewarned, it installs pretty slowly.
It took about 40 minutes on the Compaq.
(I suspect a lot of the reason is that the current version
of kfs doesn't buffer writes.)
- At the end of the process, you'll be told to remove the
CD and reboot.
After removing the CD, the easiest way to reboot is to
hit ^t^tr (that's two control-ts followed by r).
- The boot process, once installed, runs a script that
mounts the kfs file system and then calls another script
in the root of the kfs file system that binds a bunch of
the directories on the kfs file system to the root file system.
It then starts up a shell.
Once there, you'll have all the usual Inferno commands
at your disposal.
- When it comes time to shut down, issue the command
shutdown -r
or
shutdown -h
where the -r reboots and -h attempts to halt the
system.
You should get a message saying the file system is stopped,
at which time it's safe to power down or reboot.
(I've added a halt command to kfs so that we don't
have to make sure all binds are unmounted in all
name spaces.
If we don't make sure of that, then the file system
won't be left clean.)
It is possible that the CPU won't actually halt with the
-h option.
In that case, you should get the message "File system stopped"
followed by "shutdown failed:"
At this point, it is safe to shut off power or reset.
- No attempt is made to configure networking.
You can add this to the file /n/kfs/kinit.sh.
If you want to start networking with dhcp, uncomment
the following lines (from dhcp(8)) in /n/kfs/kinit.sh:
x=`{cat /net/ipifc/clone}
echo bind ether /net/ether0 > /net/ipifc/$x/ctl &&
ip/dhcp /net/ipifc/$x
- Likewise, no attempt is made to deal with graphics.
The current code is pretty far from being able to run
wm/wm on a native PC.
Hopefully, at some point the Plan 9 VESA driver will
be ported and the appropriate code for detecting and
initializing the VGA controller will be updated.
I leave that as an exercise for the reader, however...
Notes on Using Qemu
Final Words
Once again, you are doing this at your own risk.
Don't say you weren't warned.
This is rather rough at the moment, and I have
plans to change a few things, hopefully improving
the installation and use.
Also, I don't claim that the way I've got it all set
up is the best or cleanest way to do it.
But it does seem to work.
So, the only thing left to say is, "Have fun."