Quick Start

Several people have had trouble in getting a Glendix machine up and running. This page should help get started as quickly as possible!

The latest Glendix patches work for the kernel version 2.6.31.6. If you'd like to use a different kernel version, you must use the source files from our repository to create your own patched kernel tree.

You will need an existing Linux installation, and must be familiar with the procedure for configuring, compiling and installing new kernels (this may be specific to your distro).

Steps

  • Download a "vanilla" kernel source, version 2.6.31, from here
  • Download the latest Glendix patch from here.
  • Unpack the kernel and apply the Glendix patch on it.
  • Configure the kernel for your computer as you would normally do.
  • Don't forget to select the CONFIG_BINFMT_PLAN9 option. Either select 'Y' (it will be built into the kernel) or 'M' (in which case you have to load the module by executing modprobe binfmt_plan9). The option will appear in the main configuration menu.
  • Compile and install the kernel as you would normally do.

Usage

  • Boot into your new kernel. Check if the message "Hello, Plan9!" occurs in the kernel log (accessed using the dmesg command). If you compiled binfmt_plan9 as a module, you will need to load the module using modprobe before the message will appear.
  • Download the plan9 executable pack from here.
  • Execute one of the executables from the pack! Note that all of them do not work at the moment because of unimplemented system calls :)

Summary

In conclusion, here is a rough outline of the commands you will be executing:

$ wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.6.tar.bz2
$ wget http://www.glendix.org/code/glendix_2.6.31.6.patch
$ tar xvjf linux-2.6.31.6.tar.bz2
$ cd linux-2.6.31.6
$ patch -p0 < ../glendix_2.6.31.6.patch
patching file ./arch/x86/include/asm/irq_vectors.h
patching file ./arch/x86/Kconfig
patching file ./arch/x86/kernel/entry_32.S
patching file ./arch/x86/kernel/plan9_syscall_table.S
patching file ./arch/x86/kernel/traps.c
patching file ./.config
patching file ./Documentation/lguest/lguest.c
patching file ./fs/binfmt_plan9.c
patching file ./fs/binfmt_plan9.h
patching file ./fs/Makefile
patching file ./Makefile
patching file ./plan9/devcons.c
patching file ./plan9/Kconfig
patching file ./plan9/Makefile
patching file ./plan9/p9_constants.h
patching file ./plan9/syscalls.c
$ make menuconfig            # Don't forget to select CONFIG_BINFMT_PLAN9
$ make && make modules_intall  # Or whatever you would do to install your new kernel. Copy bzImage, Update GRUB etc...
$ reboot                   # Select your new kernel to boot

$ dmesg                    # Check for the "Hello, Plan9!" message. If you compiled as module, load with modprobe
$ wget http://www.glendix.org/code/p9pack_u1.tar.gz
$ tar xvzf p9pack_u1.tar.gz
$ cd p9
$ ./cat <something>

Congratulations, you just ran Plan 9's cat on Linux!