March 7, 2012
This article was contributed by Koen Vervloesem
After almost a year and a half of development, MINIX saw a new stable release on 2012's
leap day. MINIX 3.2.0 has been updated with a lot of code from NetBSD, it
now uses Clang as its default compiler, and the developers have migrated to Git for version control.
The MINIX operating system was originally developed by computer science
professor Andrew Tanenbaum at Vrije
Universiteit Amsterdam for educational use. He used the code as
examples in his textbook "Operating Systems: Design and
Implementation". MINIX has a microkernel architecture with a kernel of
about 10,000 lines of code. The result is that device drivers and services
like filesystems, memory management, process management, and so on are
running as user-space processes. This resembles the approach taken by GNU Hurd.
These days, MINIX is not only an academic project, but it's also focused
on achieving high reliability for embedded systems through fault tolerance
and self-healing techniques. It is distributed with a BSD-type license. A
downside of that choice is that it's harder to find out how it is being used, so we don't know much about the use of MINIX outside academia. However, in a FOSDEM interview in 2010, Tanenbaum said: "I believe it was used in one embedded system for managing commercial parking garages."
NetBSD code
The most obvious message in the release notes of MINIX 3.2.0 are the many mentions of NetBSD. Because the MINIX userland grew outdated, many of its tools have been replaced by their counterparts from NetBSD. This project (a Google Summer of Code project in 2011 done by Vivek Prakash) was also an opportunity to expand the MINIX userland by porting additional utilities from NetBSD.
As can be seen from Vivek's GSoC status report, many of the simpler
tools just required some trivial changes to their Makefiles to port them to
MINIX. However, some of the tools required libraries that were not present
in MINIX, so Vivek had to port these too. Moreover, if a NetBSD tool lacked
an important flag that its MINIX counterpart had, he had to port this
missing functionality from the MINIX tool. Of course Vivek also submitted
the changes upstream. As part of this userland porting effort, MINIX also
migrated its /etc/passwd file to the NetBSD format.
Vivek's minix-userland Git repository shows the result of this porting effort. The /usr/src/commands directory contains the sources for the MINIX tools, while the tools that are ported from NetBSD go into /usr/src/bin, /usr/src/sbin, /usr/src/usr.bin, and /usr/src/usr.sbin, which are the corresponding locations in the NetBSD source tree. This way you can clearly see which tools are originally from the MINIX userland and which ones are ported from NetBSD. The plan is to track the development of the NetBSD stable releases for the ported tools. MINIX 3.2 also has adopted NetBSD's C library and boot loader.
Other features
MINIX now has also experimental support for SMP (symmetric
multiprocessing), as well as multi-threading and NCQ (Native Command
Queuing) support in the AHCI (Advanced Host Controller Interface) driver
for SATA adapters. The virtual filesystem (VFS) server is now asynchronous
and multi-threaded. The developers also added a /proc file system
and a proper /etc/fstab file. Because of the integration of ext2,
you can install MINIX on an ext2 file system now. There's also FUSE support for
user-space file systems, which was implemented by Evgeniy Ivanov as part of
the Google Summer of Code (GSoC) 2011.
Reliability also has been improved. When block device I/O fails in a
filesystem, for instance when reading a file from a hard drive, MINIX will
transparently retry. In the same way, it can transparently recover from the
crash of a block device driver. These improvements are examples of the
self-healing nature of MINIX. Moreover, servers and drivers now run as
unprivileged users, which should further lessen the damage when something
goes wrong. The kernel mediates whether particular servers and drivers can
access the hardware.
Development
There are also a lot of changes for developers. The most visible is that the project's code base has been moved to Git. The project also has set up extensive documentation for developers about using Git and an explanation of the MINIX 3 git workflow.
LLVM's Clang frontend has been adopted as the default compiler for MINIX 3.2, although GCC is still supported by setting the environment variable CC=gcc. Currently Clang runs slower than GCC for building the MINIX source and its packages, but it reports more build warnings on the MINIX code base. The plan is to fix all potential bugs found by Clang's more extensive warnings.
The default executable format in MINIX is now ELF (Executable and Linkable Format). Debugging also has been improved: MINIX 3.2 supports GDB and core dumps, which was a GSoC project by Adriana Szekeres. Moreover, tracing support for block devices has been added.
Getting started
MINIX 3.2 is available as a CD image. The
command line installer is spartan, but it does the job. Most of the
automatically suggested answers to questions are fine, such as the network
cards detected by MINIX, the use of DHCP, and so on. When the installation
is finished, it's striking how fast MINIX boots. One of the reasons is that
MINIX is a really bare-bones installation, which doesn't even include
OpenSSH.
When the login prompt shows up, log in as root without a password. After this, you have to do some manual post-installation steps: set your root password and time zone, add users, and so on. You can update the package database with pkgin update and then install a package with pkg install foobar. Probably some of the first packages to install would be openssh, vim, and x11. Pkgin is an apt/yum-like front-end to NetBSD's pkgsrc package management system.
There's a Getting started document on the website that guides you through all of this. The project also has a lot of documentation and a wiki, which has a User Guide, including pages about the installation, post-installation steps, and an introduction to X.
Developers are not left out in the cold either: there's documentation about the MINIX community, a Developers Guide, a list of who is working on what, and suggestions about how to contribute.
However, hardware support seems to be quite limited in MINIX. Currently, only IDE and SATA disks are supported, and there's no support for USB or FireWire peripherals. Moreover, only a limited number of Ethernet cards work. None of my systems had all the required hardware to be able to either install or run X, so I wasn't able to get a graphical desktop on MINIX. Even in a virtual machine in VirtualBox, I couldn't configure the X server of MINIX, although I followed the configuration tips for running MINIX in VirtualBox.
From academic exercise to general-purpose operating system
The migration to the NetBSD userland and C library is part of an ongoing
effort to make MINIX more usable outside academia. This started with the
release of MINIX 3.0 in 2005, which added X11 and over 400 common UNIX
tools. In the previous release (3.1.8), the MINIX developers adopted
NetBSD's package management system pkgsrc,
which was implemented as a GSoC project
in 2010. Thanks to pkgsrc, MINIX users potentially have access to over 8000 packages. Currently only 250 seem to be available as binary packages through pkgin, but you can build many more from source (although not all of the 8000 packages in pkgsrc will compile on MINIX).
The result of these ongoing efforts is that MINIX is much more of a general-purpose operating system than a few years ago. This should also make porting MINIX to other architectures easier. There have been efforts to port MINIX to PowerPC and ARM in the past, but these were not successful because the developers lost interest. However, currently the Vrije Universiteit Amsterdam is looking for a full-time programmer with embedded systems experience to port MINIX to ARM. So maybe in a few years we'll see MINIX on embedded systems that are currently the playing field of Linux and the BSDs.
(
Log in to post comments)