MINIX 3

MINIX 3 is a project to create a small,, high functioning. It is published under a and is a successor project to the earlier versions,  1 and 2.

The main goal of the project is for the system to be by detecting and repairing its own faults on the fly, with no user intervention. The main uses of the system are envisaged to be s and education.

, MINIX 3 supports and  processors. It can also run on s or s, such as, , , Oracle , and. A port to architecture is in development.

The distribution comes on a and can be downloaded as a  stick image. The latest release is "minix_R3.4.0rc6-d5e4fc0.iso.bz2" (09 May 2017).

MINIX 3 is believed to be used in the (ME) found in Intel's  starting with the introduction of ME 11 which is used with  and  processors.

Its use in the Intel ME makes it the most widely used OS on Intel processors starting, with more installations than Microsoft Windows, GNU/Linux, or macOS.

Goals of the project
Reflecting on the nature of based systems, where a driver (which has, according to MINIX creator, approximately 3–7 times as many bugs as a usual program) can bring down the whole system, MINIX 3 aims to create an operating system that is a "reliable, self-healing, multiserver Unix clone".

To achieve that, the code running in kernel must be minimal, with the file server, process server, and each device driver running as separate user-mode processes. Each driver is carefully monitored by a part of the system named the reincarnation server. If a driver fails to respond to pings from this server, it is shut down and replaced by a fresh copy of the driver.

In a monolithic system, a bug in a driver can easily crash the whole kernel. This is far less likely to occur in MINIX 3.

History
MINIX 3 was publicly announced on 24 October 2005 by Andrew Tanenbaum during his keynote speech on top of the (ACM) Symposium Operating Systems Principles conference. Although it still serves as an example for the new edition of Tanenbaum and Woodhull's textbook, it is comprehensively redesigned to be "usable as a serious system on resource-limited and embedded computers and for applications requiring high reliability."

Reliability policies
One of the main goals of MINIX 3 is reliability. Below, some of the more important principles that enhance its reliability are discussed.

Reduce kernel size
Monolithic operating systems such as and  and hybrids like  have millions of lines of  code. In contrast, MINIX 3 has about 6,000 lines of executable kernel code, which can make problems easier to find in the code.

Cage the bugs
In monolithic kernels, s reside in the kernel. Thus, when a new peripheral is installed, unknown, untrusted code is inserted in the kernel. One bad line of code in a driver can bring down the system.

Instead, in MINIX 3, each device driver is a separate user-mode process. Drivers cannot execute privileged instructions, change the s, perform arbitrary (I/O), or write to absolute memory. They must make kernel calls for these services and the kernel checks each call for authority.

Limit drivers' memory access
In monolithic kernels, a driver can write to any word of memory and thus accidentally corrupt user programs.

In MINIX 3, when a user expects data from, for example, the file system, it builds a descriptor telling who has access and at what addresses. It then passes an index to this descriptor to the file system, which may pass it to a driver. The file system or driver then asks the kernel to write via the descriptor, making it impossible for them to write to addresses outside the buffer.

Survive bad pointers
Dereferencing a bad within a driver will crash the driver process, but will have no effect on the system as a whole. The reincarnation server will restart the crashed driver automatically. For some drivers (e.g., disk and network) recovery is transparent to user processes. For others (e.g., audio and printer), the user may notice. In monolithic kernels, dereferencing a bad pointer in a driver normally leads to a system crash.

Tame infinite loops
If a driver gets into an, the scheduler will gradually lower its priority until it becomes idle. Eventually the reincarnation server will see that it is not responding to status requests, so it will kill and restart the looping driver. In a monolithic kernel, a looping driver could hang the system.

Limit damage from buffer overflows
MINIX 3 uses fixed-length messages for internal communication, which eliminates certain s and buffer management problems. Also, many exploits work by overrunning a buffer to trick the program into returning from a function call using an overwritten stack return address pointing into attacker controlled memory, usually the overrun buffer. In MINIX 3, this attack is mitigated because instruction and data space are split and only code in (read-only) instruction space can be executed, termed. However attacks which rely on running legitimately executable memory in a malicious way are not prevented by this mitigation.

Restrict access to kernel functions
Device drivers obtain s (such as copying data to users' address spaces) by making kernel calls. The MINIX 3 kernel has a bit map for each driver specifying which calls it is authorized to make. In monolithic kernels, every driver can call every kernel function, authorized or not.

Restrict access to I/O ports
The kernel also maintains a table telling which s each driver may access. Thus, a driver can only touch its own I/O ports. In monolithic kernels, a buggy driver can access I/O ports belonging to another device.

Restrict communication with OS components
Not every driver and server needs to communicate with every other driver and server. Accordingly, a per-process bit map determines which destinations each process may send to.

Reincarnate dead or sick drivers
A special process, called the reincarnation server, periodically pings each device driver. If the driver dies or fails to respond correctly to pings, the reincarnation server automatically replaces it with a fresh copy. Detecting and replacing non-functioning drivers is automatic, with no user action needed. This feature does not work for disk drivers at present, but in the next release the system will be able to recover even disk drivers, which will be shadowed in (RAM). Driver recovery does not affect running processes.

Integrate interrupts and messages
When an occurs, it is converted at a low level to a notification sent to the appropriate driver. If the driver is waiting for a message, it gets the interrupt immediately; otherwise it gets the notification the next time it does a  to get a message. This scheme eliminates nested interrupts and makes driver programming easier.

Architecture
As can be seen, at the bottom level is the, which is about 4,000 lines of code (mostly in , plus a small amount of ). It handles s,, and message passing. It also supports an (API) of about 30 kernel calls that authorized servers and drivers can make. User programs cannot make these calls. Instead, they can issue s which send messages to the servers. The kernel calls perform functions such as setting interrupts and copying data between address spaces.

At the next level up, there are the s, each one running as a separate process. Each one controls some I/O device, such as a disk or printer. The drivers do not have access to the I/O port space and cannot issue I/O instructions directly. Instead, they must make kernel calls giving a list of I/O ports to write to and the values to be written. While there is a small amount of overhead in doing this (typically 500 ns), this scheme makes it possible for the kernel to check authorization, so that, for example, the audio driver cannot write on the disk.

At the next level there are the. This is where nearly all the operating system functionality is located. User processes obtain file service, for example, by sending messages to the file server to open, close, read, and write files. In turn, the file server gets disk I/O performed by sending messages to the disk driver, which controls the disk.

One of the key servers is the reincarnation server. Its job is to poll all the other servers and drivers to check on their health periodically. If a component fails to respond correctly, or exits, or gets into an, the reincarnation server (which is the parent process of the drivers and servers) kills the faulty component and replaces it with a fresh copy. In this way the system is automatically made self-healing without interfering with running programs.

Currently the reincarnation server, the process server, and the microkernel are part of the. If any of them fail, the system crashes. Nevertheless, reducing the trusted computing base from 3-5 million lines of code, as in Linux and Windows systems, to about 20,000 lines greatly enhances system reliability.

Differences between MINIX 3 and prior versions
1, 1.5, and 2 were developed as tools to help people learn about the design of operating systems.

MINIX 1.0, released in 1987, was 12,000 lines of and some x86. Source code of the kernel,, and of MINIX 1.0 are printed in the book. Tanenbaum originally developed MINIX for compatibility with the and  s available at the time.

MINIX 1.5, released in 1991, included support for  systems and was also ported to the  and  architectures, supporting the,  , Apple  and   computer platforms. A version of MINIX running as a user process under was also available.

MINIX 2.0, released in 1997, was only available for the and -hosted SPARC architectures. was created by two researchers, and added  and support for the.

MINIX 3 does the same, and provides a modern operating system with many newer tools and many applications. Prof. Tanenbaum once said:

Please be aware that MINIX 3 is not your grandfather's MINIX ... MINIX 1 was written as an educational tool ... MINIX 3 is that plus a start at building a highly reliable, self-healing, bloat-free operating system ... MINIX 1 and MINIX 3 are related in the same way as and are: same first name. Many improvements have also been made in the structure of the kernel since the MINIX 2 release, making the system more reliable. MINIX version 3.1.5 was released 5 Nov 2009. It contains, , , cc, , , , , , , , , client, , and over 400 other common Unix utility programs. With the addition of X11, this version marks the transition away from a text-only system. Another feature of this version, which will be improved in future ones, is the ability of the system to withstand device driver crashes, and in many cases having them automatically replaced without affecting running processes. In this way, MINIX is self-healing and can be used in applications demanding high reliability.

MINIX 3.2.0 was released in February 2012. This version has many new features, including the compiler, experimental  support,  and  filesystem support, and  (GDB). Several parts of are also integrated in the release, including the bootloader,  and various  and other.

MINIX 3.3.0 was released in September 2014. This release is the first version to support the in addition to x86. It also supports a, with thousands of NetBSD packages running right out of the box.

Mascot
Rocky Raccoon is the mascot of MINIX 3.

MINIXCon
MINIXCon is a conference on sharing talks, efforts and researches related to MINIX.

MINIXCon2017 was cancelled due lack of talks submitted.