Before attempting to build Schemix, we need to install the Linux kernel sources. For example if we are using kernel version 2.4.20-8 on an i386 class machine that uses RPM packages, we type:
rpm -Uvh kernel-source-2.4.20-8.i386.rpm
It's also worth checking, at this point, that the gcc (GNU Compiler Collection) and ncurses packages are both installed as we'll need them both later.
Depending on our machine's architecture, we need to select an appropriate configuration file to use. If we don't know the machine's architecture, we can type:
$ uname -pFor example my desktop computer has an athlon class CPU so I would write:
Now it's time to get the sources for Schemix. If you have already downloaded a release of Schemix, that's fine - you just need to decompress the .tar.gz file and you'll have a schemix directory. Otherwise, you might like to try getting Schemix from CVS as that way you'll be able to try out all the latest features:
cvs -d:pserver:email@example.com:/cvsroot/schemix login
If you are using RedHat, you'll need to edit schemix/schemix.h (because RedHat kernels don't seem to play nicely with devfs) and change "#define SCHEMIX_USE_DEVFS 1" to "#define SCHEMIX_USE_DEVFS 0". RedHat kernels do have the kallsyms patch though, so we can leave SCHEMIX_USE_KALLSYMS set to 1. Other systems may support one, both, or neither of DevFS and Kallsyms, so you'll need to check your system documentation and adjust these two defines accordingly.
If you want to include the parts of Schemix that are written in Scheme
you can do so at this point. This is entirely optional. Doing so gives
you a much more usable Schemix system (very nearly R4RS), but at the
expense of memory.
Now you can build Schemix:
make SUBDIRS=schemix modules
Now the moment of truth - we load the Schemix module into the kernel:
When Schemix is configured to use devfs, it can create the /dev/schemix device entry by itself, but if we told it not to use devfs we'll have to give it a little help. Have a look at the output from the following command
mknod /dev/schemix c n 0
and that's it. You should now have a /dev/schemix device that gives you access to the inner workings of the Linux kernel using Scheme.