All Topics  
MINIX 3

 

   Email Print
   Bookmark   Link






 

MINIX 3



 
 
MINIX 3 is a project to create a small, highly reliable and functional Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
. The main goal of the project is for the system to be fault-tolerant by detecting and repairing its own faults on the fly, without user intervention. It is published under the BSD license and can be downloaded for free from .






Discussion
Ask a question about 'MINIX 3'
Start a new discussion about 'MINIX 3'
Answer questions from other users
Full Discussion Forum



Recent Posts









Encyclopedia


MINIX 3 is a project to create a small, highly reliable and functional Unix-like
Unix-like

A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
 operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
. The main goal of the project is for the system to be fault-tolerant by detecting and repairing its own faults on the fly, without user intervention. It is published under the BSD license and can be downloaded for free from . The main uses of the operating system are envisaged to be embedded systems (such as ADSL routers) as well as the education sector, such as universities or the XO-1 laptop.

MINIX 3 currently supports IA-32
IA-32

IA-32 , often generically called x86 or x86-32, is the instruction set architecture of Intel's most commercially successful microprocessors....
 architecture PC compatible systems. It is also possible to run MINIX under emulator
Emulator

An emulator duplicates the functions of one system using a different system, so that the second system behaves like the first system. This focus on exact reproduction of external behavior is in contrast to some other forms of computer simulation, which can concern an abstract model of the system being simulated....
s or virtual machine
Virtual machine

In computer science, a virtual machine is a software implementation of a machine that executes programs like a real machine.Definitions...
s, such as Bochs
Bochs

Bochs is a portable x86 and x86-64 IBM PC compatible emulator and debugger mostly written in C++ and distributed as free software under GNU Lesser General Public License....
, VMware Workstation
VMware Workstation

VMware Workstation is a virtual machine software suite for x86 and x86-64 computers from VMware, a division of EMC Corporation. This software suite allows users to set up multiple x86 and x86-64 virtual computers and to use one or more of these virtual machines simultaneously with the hosting operating system....
, Microsoft Virtual PC
Microsoft Virtual PC

Microsoft Virtual PC is a virtualization suite for Microsoft Windows, and an emulation suite for Mac OS X on PowerPC-based systems. The software was originally written by Connectix, and was subsequently acquired by Microsoft....
, and QEMU
QEMU

QEMU is a central processing unit emulator that relies on dynamic binary translation to achieve a reasonable speed while being easy to port on new host CPU architectures....
. Ports to the PowerPC
PowerPC

PowerPC is a RISC instruction set architecture created by the 1991 Apple Inc.?IBM?Motorola alliance, known as AIM alliance. Originally intended for personal computers, PowerPC CPUs have since become popular embedded system and high-performance processors....
 and ARM architecture
ARM architecture

The ARM architecture is a 32-bit RISC central processing unit architecture developed by ARM Limited that is widely used in embedded system designs....
s (Intel XScale
Intel XScale

The XScale, a Central processing unit, is Marvell Technology Group's implementation of the fifth generation of the ARM architecture, and consists of several distinct families: IXP, IXC, IOP, PXA and CE ....
) are in development.

The distribution comes on a Live CD
Live CD

A live CD or live DVD is a CD or DVD containing a booting computer operating system. Live CDs are unique in that they have the ability to run a complete, modern operating system on a computer lacking Computer_storage , such as a hard disk drive....
 and also can be downloaded as a USB stick image.

Goals of the project

Reflecting on the nature of monolithic kernel
Monolithic kernel

A monolithic kernel is a Kernel architecture where the entire operating system is run in kernel space as supervisor mode. In difference with other architectures , the monolithic kernel defines alone a high-level virtual interface over computer hardware, with a set of primitives or system calls to implement all operating system services such...
 based systems, where a driver (which has, according to MINIX creator Tanenbaum
Andrew S. Tanenbaum

Andrew Stuart "Andy" Tanenbaum is a professor of computer science at the Vrije Universiteit, Amsterdam in the Netherlands. He is best known as the author of MINIX, a free Unix-like operating system for teaching purposes, and for his computer science textbooks, regarded as standard texts in the field....
, 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". In order 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 known as the reincarnation server. If a driver fails to respond to pings from the reincarnation 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, something that is much less likely to occur in MINIX 3..

Reliability in MINIX 3

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

Reduce kernel size

Monolithic operating systems such as Windows, Linux
Linux

Linux is a generic term referring to Unix-like computer operating systems based on the Linux kernel. Their development is one of the most prominent examples of free and open source software collaboration; typically all the underlying source code can be used, freely modified, and redistributed by anyone under the terms of the GNU GPL license...
 and FreeBSD
FreeBSD

FreeBSD is a Unix-like free software operating system descended from AT&T Unix via the Berkeley Software Distribution branch through the 386BSD and Berkeley Software Distribution#4.4BSD and descendants operating systems....
 have millions of lines of kernel code. In contrast, MINIX 3 has about 4000 lines of executable kernel code, which can make problems easier to find in the code.

Cage the bugs

In monolithic operating systems, device drivers reside in the kernel. This means that when a new peripheral is installed, unknown, untrusted code is inserted in the kernel. A single bad line of code in a driver can bring down the system. In MINIX 3, each device driver is a separate user-mode process. Drivers cannot execute privileged instructions, change the page tables
Page table

A page table is the data structure used by a virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses....
, perform arbitrary I/O
I/O

I/O may refer to:* Input/output, a system of communication for information processing systems* The input-output model, an economic model of flow prediction between sectors...
, or write to absolute memory. They have to make kernel calls for these services and the kernel checks each call for authority.

Limit drivers' memory access

In monolithic operating systems, a driver can write to any word of memory and thus accidentally trash 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 pointer 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 systems, dereferencing a bad pointer in a (kernel) driver normally leads to a system crash.

Tame infinite loops

If a driver gets into an infinite loop, 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 system, a looping driver could hang the system.

Limit damage from buffer overruns

MINIX 3 uses fixed-length messages for internal communication, which eliminates certain buffer overruns 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 stacked return address pointing into the overrun buffer. In MINIX 3, this attack does not work because instruction and data space are split and only code in (read-only) instruction space can be executed.

Restrict access to kernel functions

Device drivers obtain kernel services (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 systems every driver can call every kernel function, authorized or not.

Restrict access to I/O ports

The kernel also maintains a table telling which I/O ports each driver may access. As a result, a driver can only touch its own I/O ports. In monolithic systems, 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. The detection and replacement of non-functioning drivers is automatic, without any user action required. 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 interrupt
Interrupt

In computing, an interrupt is an asynchronous communication signal from hardware indicating the need for attention or a synchronous event in software indicating the need for a change in execution....
 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 RECEIVE 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 microkernel
Microkernel

In computer science, a microkernel is a computer kernel which provides the mechanisms needed to implement an operating system, such as low-level address space management, thread management, and inter-process communication....
, which is about 4000 lines of code (mostly in C
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
, plus a small amount of assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
). It handles interrupts, scheduling
Scheduling (computing)

Scheduling is a key concept in computer multitasking and multiprocessing operating system design, and in real-time operating system design. In modern operating systems, there are typically many more processes running than there are CPUs available to run them....
, and message passing. In addition it 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 POSIX
POSIX

POSIX or "Portable Operating System Interface" is the collective name of a family of related standardizations specified by the Institute of Electrical and Electronics Engineers to define the application programming interface , along with shell and utilities interfaces for software compatible with variants of the Unix operating system, altho...
 system call
System call

In computing, a system call is the mechanism used by an application program to request service from the kernel based on the Monolithic_kernel or to system servers on operating systems based on the microkernel-structure....
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, we find the device drivers, each one running as a separate user-mode
User space

A conventional operating system usually segregates virtual memory into kernel space and user space. Kernel space is strictly reserved for running the kernel , kernel extensions, and some device drivers....
 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 nsec), 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 we find the servers. 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 actually 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 infinite loop, 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 file server, the process server, and the microkernel are part of the trusted computing base. If any of them fail, the system crashes. Nevertheless, reducing the trusted computing base from 3-5 million lines of code found in Linux and Windows systems to about 20,000 lines greatly enhances system reliability.

Differences between MINIX 3 and prior versions

MINIX
Minix

MINIX is a Unix-like computer operating system based on a microkernel Software architecture. Andrew S. Tanenbaum wrote the operating system to be used for educational purposes; MINIX also inspired the creation of the Linux kernel....
 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 C (programming language)
C (programming language)

C is a general-purpose computer programming language originally developed in 1972 by Dennis Ritchie at the Bell Telephone Laboratories to implement the Unix operating system....
 and some x86 Assembly language
Assembly language

An assembly language is a low-level language for programming computers. It implements a symbolic representation of the numeric machine codes and other constants needed to program a particular CPU architecture....
. Source code of the kernel, memory manager
Memory manager

A memory manager is a part of a computer program which accepts requests from the program to allocate and deallocate chunks of computer memory....
, and file system
File system

In computing, a file system is a method for store and organize computer files and the data they contain to make it easy to find and access them....
 of MINIX 1.0 are printed in the book. Tanenbaum originally developed MINIX for compatibility with the IBM PC
IBM PC

The IBM Personal Computer, commonly known as the IBM PC, is the original version and progenitor of the IBM PC compatible hardware platform ....
 and IBM PC/AT microcomputers available at the time. MINIX 1.5, released in 1991, included support for MicroChannel
Microchannel

Microchannel can refer to* Basic structure used in microtechnology, see Microchannel_.* Micro Channel architecture in computing...
 IBM PS/2 systems and was also ported to the Motorola 68000
Motorola 68000

The Motorola 68000 is a 16/32-bit Complex instruction set computer microprocessor core designed and marketed by Freescale Semiconductor ....
 and SPARC
SPARC

SPARC is a Reduced Instruction Set Computer microprocessor instruction set Computer architecture originally designed in 1985 by Sun Microsystems....
 architectures, supporting the Atari ST
Atari ST

The Atari ST is a home computer/personal computer that was commercially available from 1985 to the early 1990s. It was released by Atari Corporation in 1985....
, Commodore
Commodore International

Commodore, the commonly used name for Commodore International, was a United States electronics company based in West Chester, Pennsylvania which was a vital player in the home computer/personal computer field in the 1980s....
 Amiga
Amiga

The Amiga is a family of personal computers originally developed by Amiga Corporation. Development on the Amiga began in 1982 with Jay Miner as the principal hardware designer....
, Apple Macintosh
Macintosh

File:Imac alu.pngMacintosh, commonly shortened to Mac, is a brand name which covers several lines of personal computers designed, developed, and marketed by Apple Inc....
 and Sun Microsystems
Sun Microsystems

Sun Microsystems, Inc. is a multinational corporation vendor of computers, computer components, computer software, and information technology services, founded on February 24, 1982....
 SPARCstation
SPARCstation

The SPARCstation, SPARCserver and SPARCcenter product lines were a series of SPARC-based computer workstations and server s in desktop, deskside and rack-based form factor developed and sold by Sun Microsystems...
 computer platforms. A version of MINIX running as a user process under SunOS
SunOS

SunOS is a version of the Unix operating system developed by Sun Microsystems for their workstation and server computer systems. The SunOS name is usually only used to refer to versions 1.0 to 4.1.4 of SunOS....
 was also available. MINIX 2.0, released in 1997, was only available for the x86 and Solaris-hosted SPARC architectures. Minix-vmd
Minix-vmd

Minix-vmd is a free software operating system which was created from Minix, and added some additional features such as virtual memory and X Window System support....
 was created by two Vrije Universiteit
Vrije Universiteit

The Vrije Universiteit is a university in Amsterdam, the Netherlands. The Dutch name is often abbreviated as VU. The board of trustees is the Vereniging VU-Windesheim, which also manages the Christelijke Hogeschool Windesheim University of Applied Sciences in Zwolle and VUmc, which is the university's Medical Center....
 researchers, and added virtual memory
Virtual memory

Virtual memory is a computer system technique which gives an application program the impression that it has contiguous working memory , while in fact it may be physically fragmented and may even overflow on to disk storage....
 and support for the X Window System
X Window System

The X Window System is a computing software system and network protocol that provides a graphical user interface for networked computers. It implements the X Window System protocols and architecture and provides windowing system on raster graphics Visual display units and manages Keyboard and pointing device control functions....
. MINIX 3 does the same, and provides a modern operating system with many newer tools and many UNIX
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 applications. Prof. Tanenbaum once said:

There have also been many improvements in the structure of the kernel since MINIX 2 was released, making the operating system more reliable.

MINIX version 3.1.2 was released 8 May 2006. It contains X11, emacs
Emacs

Emacs is a class of feature-rich text editors, usually characterized by their extensibility. Emacs has, perhaps, more editing commands than any other editor or word processor, numbering over 1,000....
, vi
Vi

vi is a family of screen-oriented text editors which share common characteristics, such as methods of invocation from the operating system command interpreter, and characteristic user interface features....
, cc, gcc
GNU Compiler Collection

The GNU Compiler Collection is a compiler system produced by the GNU Project supporting various programming languages. GCC is a key component of the GNU toolchain....
, perl
Perl

In computer programming, Perl is a high-level programming language, List of programming languages by category, Interpreter , dynamic programming language....
, python
Python (programming language)

Python is a general-purpose high-level programming language. Its design philosophy emphasizes code readability. Python's core syntax and semantics are Minimalism , while the standard library is large and comprehensive....
, ash
Almquist shell

The Almquist shell was originally Kenneth Almquist's clone of the SVR4-variant of the Bourne shell; it is a fast, small, POSIX-compatible Unix shell designed to replace the Bourne shell in later BSD distributions....
, bash
Bash

Bash is a free software Unix shell written for the GNU Project. Its name is an acronym which stands for Bourne-again shell. The name is a pun on the name of the Bourne shell , an early and important Unix shell written by Stephen Bourne and distributed with Version 7 Unix circa 1978, and the concept of being "Born again Christianity"....
, zsh, ftp, ssh
Secure Shell

Secure Shell or SSH is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for TELNET and other Computer security remote Shell s, which send information, notably passwords, in...
, telnet
TELNET

Telnet is a network protocol used on the Internet or Local Area Network connections. It was developed in 1969 beginning with RFC 15 and standardized as Internet Engineering Task Force STD 8, one of the first Internet standards....
, pine
Pine (e-mail client)

Pine is a freeware, text-based e-mail client developed at the University of Washington. Source code was available for only the Unix version under a license written by the University of Washington....
, and over 400 other common UNIX
Unix

Unix is a computer operating system originally developed in 1969 by a group of American Telephone & Telegraph employees at Bell Labs, including Ken Thompson , Dennis Ritchie, Douglas McIlroy, and Joe Ossanna....
 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
Self-healing

Self-healing is a phrase applied to the process of recovery , motivated by and directed by the patient, guided often only by instinct. Such a process encounters mixed fortunes due to its amateur nature, although self-motivation is a major asset....
 and can be used in applications demanding high reliability.

Books and Articles

  • by Jorrit N. Herder, Herbert Bos, Ben Gras, Philip Homburg, and Andrew S Tanenbaum
  • J.N. Herder et al., Modular System Programming in MINIX 3, ;Login, April 2006
  • Pablo A Pessolani. MINIX4RT: A Real-Time Operating System Based on MINIX
  • Building Performance Measurement Tools for the MINIX 3 Operating System, by Rogier Meurs
  • Design and implementation of the MINIX Virtual File system
  • Reference manual for MINIX 3 Kernel API
  • Towards a true microkernel operating system
  • Construction of a Highly Dependable Operating System


See also


  • Comparison of kernels
    Comparison of kernels

    A Kernel is the core component of every computer operating system. While kernels are highly technical in nature, and may be hidden from the user under many layers of software and applications, they do have distinguishing or characteristic features, such as computer architecture, design goals, as well as the more practical features that they provid...
  • GNU Hurd
    GNU Hurd

    GNU Hurd is a free software computer kernel , released under the GNU General Public License. It consists of a set of Server that work on top of a microkernel; together they form the kernel of GNU....
  • MINIX
    Minix

    MINIX is a Unix-like computer operating system based on a microkernel Software architecture. Andrew S. Tanenbaum wrote the operating system to be used for educational purposes; MINIX also inspired the creation of the Linux kernel....
  • MINIX file system
    MINIX file system

    The Minix file system is the native file system of the Minix operating system....


External links


  • :
  • by Andy Tanenbaum
  • An interview with Andy Tanenbaum