RMoX logo

RMoX

A Scalable, Compositional Operating-System
for Commodity Platforms

   

Building

[ requirements | kroc | rmox ]

Requirements

This page describes the steps needed to build RMoX from source. If you want to hack around with it, or intend to contribute to its development, this is the page you should be reading. If you just want to play around with it (and not have the hastle of installing a whole occam-pi system), download on of the binary images and run it in an emulator — see the user documentation.

Setting up a working build environment for RMoX is now much easier than it used to be. I'm currently developing RMoX on a Debian GNU/Linux system, running unstable/testing. The gcc version is 4.3.4. This appears to work fine, given past failures with earlier gcc versions (3.0, 3.1 and 3.2). Version 2.95.4 of gcc (as is installed on my Debian box) also works. Any gcc version that is known to correctly build Linux kernels should be adequate, however. You will need a Linux installation to build RMoX — RMoX will not build on Apple Macs, nor will it build under cygwin. This page also assumes that you have a subversion client (e.g. "svn"), in order to get the latest versions of KRoC and RMoX.

You can alternatively build a version of RMoX that runs in usermode (as a normal occam-pi program). The process for this is described below.

If building the baremetal version of RMoX (for use in emulators and on real hardware), a particular build of KRoC is required (with RMoX support, see below). For usermode RMoX, a standard working KRoC install is all that is required. This page describes the quick approach to setting up KRoC and RMoX. For more detailed instructions see the relevant project Wikis:

Installing KRoC

Baremetal RMoX

Baremetal RMoX is for use in emulators (such as QEMU or VirtualBox) or on real hardware. For this environment, a separate KRoC source tree (and resulting install) is required. In brief:

First, create a directory tree for RMoX and KRoC to reside in, and check-out the latest KRoC sources:


bash:~/$ mkdir rmox-build
bash:~/$ cd rmox-build
bash:~/rmox-build/$ svn co http://projects.cs.kent.ac.uk/projects/kroc/svn/kroc/trunk kroc
...  long list of checked-out files
bash:~/rmox-build/$

Then check-out the latest RMoX sources:


bash:~/rmox-build/$ svn co http://projects.cs.kent.ac.uk/projects/rmox/svn/rmox/trunk rmox
...  long list of checked-out files
bash:~/rmox-build/$

Next, configure KRoC specifically for building for/with RMoX:


bash:~/rmox-build/$ cd kroc
bash:~/rmox-build/kroc/$ autoreconf -fiv
...  output from autoreconf (will take some time)
bash:~/rmox-build/kroc/$ ./configure --prefix=$HOME/rmox-build/kroc-install --with-rmox=$HOME/rmox-build/rmox --enable-cpu-timers
...  output from configure (will take less time)
bash:~/rmox-build/kroc/$ make install
...  output from make (will take a while)
bash:~/rmox-build/kroc/$

If successful, this will leave behind a working KRoC installation built specifically for RMoX. If building for hardware without SSE2 instructions, add the additional './configure' option:

  • --disable-sse2 explicitly disables the use of SSE2 instructions. This is necessary if you're going to run RMoX on hardware that doesn't have them (e.g. an AMD Geode, or Intel Pentium 1, 2 or 3). Modern CPUs, Intel Pentium 4+s, Intel Core2s, AMD Athlon 64, AMD Opteron, etc. should have them. Wikipedia (SSE2) has a list of CPUs that do support it (and thus don't need this option). Any recent versions of the QEMU emulator (if this is how you intend to run RMoX) should have SSE2 instruction support.

Finally, set the KRoC environment variables by sourcing the generated setup script:


bash:~/rmox-build/kroc/$ cd ..
bash:~/rmox-build/$ source kroc-install/bin/kroc-setup.sh
bash:~/rmox-build/$ 

Running "kroc" without any arguments should produce an information page, rather than an error, at this point.

Usermode RMoX

A standard KRoC installation is required for building RMoX in usermode (i.e. to run as an ordinary application). For setting this up, follow the instructions on the KRoC installation page. Alternatively, you can build a working KRoC environment in a similar way to the above, e.g.:


bash:~/rmox-build/$ cd kroc
bash:~/rmox-build/kroc/$ autoreconf -fiv
...  output from autoreconf (will take some time)
bash:~/rmox-build/kroc/$ ./configure --prefix=$HOME/rmox-build/kroc-install
...  output from configure (will take a while)
bash:~/rmox-build/kroc/$ make install
...  output from make (will take a while)
bash:~/rmox-build/kroc/$ cd ..
bash:~/rmox-build/$ source ~/rmox-build/kroc-install/bin/kroc-setup.sh
bash:~/rmox-build/$

Configuring and building RMoX

This assumes that you have a working KRoC environment (either the general one for usermode, or a specific build for baremetal). You can test this by running "kroc" without any arguments (it should produce a help screen, rather than an error). This also assumes that the RMoX source-tree has been checked-out; if not:


bash:~/rmox-build/$ svn co http://projects.cs.kent.ac.uk/projects/rmox/svn/rmox/trunk rmox
...  long list of checked-out files
bash:~/rmox-build/$

Building for baremetal

Once you have a working KRoC installation and the RMoX sources:

  1. Change into the RMoX source directory:

    
    bash:~/rmox-build/$ cd ~/rmox-build/rmox
    bash:~/rmox-build/rmox/$
    
    
  2. If you need to, edit the RMoX configuration using vi (or your favourite editor):

    
    bash:~/rmox-build/rmox/$ vi occam/include/rmox_config.inc
    
    

    The available configuration options are plentiful. There will be some occamdoc style comments at the top of the file, which provide some information on configuration. A good number of device drivers enabled by default are compiled into the RMoX kernel, but are not activated by default — including drivers for which you don't have specific hardware shouldn't cause problems.

    The default build is for the "baremetal" version of RMoX — designed for running on real hardware or within an emulator such as QEMU or VirtualBox.

  3. Next you'll need to configure the RMoX build:

    
    bash:~/rmox-build/rmox/$ autoreconf -fiv
    ...  output from autoreconf
    bash:~/rmox-build/rmox/$ ./configure --enable-base-baremetal --with-kroctree=$HOME/rmox-build/kroc
    ...  output from configure
    
    
  4. Finally, compile RMoX:

    
    bash:~/rmox-build/rmox/$ make
    ...  output from make
    LINK    rmox.o
    LINK    baremetal/rmox
    VAL []BYTE rmox.datestamp IS "20091209145144":
    
    HDIMAGE baremetal/hdimage.rmox
    bash:~/rmox-build/rmox/$
    
    

    If this is successful, you will be left with two files:

    • baremetal/rmox: the multiboot image that can be loaded over a network or by GRUB on real hardware.

    • baremetal/hdimage.rmox: a (24 MiB) hard-disk image that can be used with an emulator such as QEMU. It contains GRUB and the RMoX kernel image.

    See the user documentation for details on booting these images (on real hardware or QEMU).

    As the last couple of 'make' output lines show, each compiled version of RMoX has a date-stamp embedded into it. When RMoX is run, this datestamp is visible on virtual terminals running the system-console (appears alongside the RMoX kernel version, e.g. '0.1.5'). The datestamp is useful to ensure that you have booted the latest version compiled (may be affected by caching in TFTP servers when booting on a network).

Building for usermode

Building usermode RMoX is a somewhat simpler process. It is recommeded that you use the latest KRoC/Linux version (currently the subversion "trunk" branch). usermode RMoX 1.6.0

  1. Ensure you have a working KRoC/Linux system. Follow the instructions above if necessary (KRoC installation guide). Make sure you remember to source the KRoC setup file!

  2. Change into the "rmox/" sub-directory and edit the file "occam/include/rmox_config.inc" such that the first few lines read:

        --{{{  raw/usermode selection
        #DEFINE USE.UM.RMOX
        --#DEFINE USE.BAREMETAL.RMOX
        --}}}
    

    You may also want to check the rest of the file for specific usermode configuration.

  3. Next you'll need to configure the RMoX build system using the provided configure script:

    
    bash:˜/rmox-build/rmox/:0$ ./configure --with-um-rmox=$HOME/rmox-build/kroc-install --with-kroctree=$HOME/rmox-build/kroc
    
    

    The path specified by "$HOME/rmox-build/kroc-install" should point to the base of the KRoC installation, and the path "$HOME/rmox-build/kroc" to the source-tree that created that installation.

  4. The last step is to compile RMoX:

    
    bash:~/rmox-build/rmox/$ make
     .. output from make
    
    

    If successful, you will be left with an executable named "rmox". This can be executed with the usual "./rmox".

occam-pi

Valid XHTML 1.0!

Valid CSS!

Last modified: 2009-12-09 15:00:20.000000000 +0000 by Fred Barnes
Copyright © 2003-2009 Fred Barnes, University of Kent