In my OS course, we use the Minix operating system. We have various assignments that require us to edit kernel source code, etc. We use virtual machines for doing our work, and my preferred VM software is VirtualBox. There seems to be little info about using Minix with VirtualBox on the net, as Minix is not officially supported by VBox. Nevertheless it can be used fine. I am going to write about my own setup in roughly tutorial form.
First, about my software versions. At the time of this writing, I am using:
- the latest stable Ubuntu, which is Jaunty Jackalope, version 9.04, as the host operating system,
- the latest stable VirtualBox, which is version 3.0.4, and,
- the latest stable Minix 3, version 3.1.3a
It is quite simple to install Virtualbox on Ubuntu.
Installing Minix on VBox
My own VM settings are 128 MB RAM and a 1 GB virtual hard disk.
Packages that are useful for me: flex, gcc, emacs, less, make.
Networking has not been possible to setup. I have tried to get bridged networking to work, so that files can be shared via ssh, but it has not worked yet. I will update if I do succeed. Please post in the comments if you have any tips.
Networking would have been ideal for transferring files both ways between the two OSes, but I am managing with one way transfers for now (Linux to Minix).
Exchanging files between Minix and Ubuntu
I have so far only succeeded in copying files into the guest OS and not vice versa. Since networking has not worked for me, I transfer files via cd images. To transfer single files, create a cd image containing the files in Ubuntu with:
mkisofs -o t.iso <list of single files>
isoread - /dev/c0d2 src.c > src.c
Don’t forget the hyphen after “isoread”.
Copying a whole directory into minix may seem complex using the above method, but the trick is to create a tar file out of the directory we want to copy. We copy the tar archive into minix using the method discussed above and then extract it in the guest.
Getting Minix kernel sources
This initially turned out to be challenging, because though the source code is available in the VM at /usr/src, it can’t be copied to the host for editing using powerful editors in Linux. The source code is available on the Minix cd but it is present in a cd sub-partition that is in the Minix filesystem format. Also, there is no readily available download package on the Minix website.
But there is the SVN repo. The only thing to find is the right revision for the version of Minix we use. Looking the tags folder, helped. To download the sources for my version, I fired off a terminal and typed:
svn checkout https://gforge.cs.vu.nl/svn/minix/tags/r3_1_3a
Enter the username as “anonymous” and enter a blank password.
To get rid of the .svn folders (these are not part of Minix source code) inside the sources folder we downloaded, use the following command from inside the folder created by the subversion checkout:
find . -name ".svn$" | xargs rm -rf
Now our sources are ready for editing.
Recompiling the Minix kernel
After we edit sources, we copy the files into Minix’s /usr/src. Then, from /usr/src/ we type:
If everything works, this builds a new kernel and sets it up for booting. Type “shutdown” to shutdown the VM, and from the boot prompt, type “boot d0p0” to start minix. In the resulting boot menu enter “3”, and we boot into the kernel we just modified! More information about recompiling is here.
Filed under: Computer Science, Linux | Tagged: cd transfers, course work, isodir, isoread, jaunty, jaunty jackalope, kernel, Linux, minix, minix 3, minix 3.1.3a, minix svn repo, operating system, recompiling kernels for minix, ubuntu, Ubuntu 9.04, virtual machines, virtualbox, VirtualBox 3.0.4 | 7 Comments »