Minix 3 Explained

Minix 3
Developer:Andrew S. Tanenbaum et al.
Family:Unix-like
Working State:Abandoned
Source Model:Open source
Frequently Updated:yes
Latest Release Version:3.3.0
Latest Preview Version:3.4.0 rc6
Marketing Target:Embedded systems, education
Programmed In:C, assembly language
Language:English
Supported Platforms:IA-32, ARM
Kernel Type:Microkernel
Userland:Minix, NetBSD
Ui:ash
License:2005: BSD-3-Clause[1]
Original: BSD-3-Clause
Preceded By:Minix 1.0, 1.5 and 2.0

Minix 3 is a small, Unix-like operating system. It is published under a BSD-3-Clause license and is a successor project to the earlier versions, Minix 1 and 2.

The project's main goal is for the system to be fault-tolerant by detecting and repairing its faults on the fly, with no user intervention. The main uses of the system are envisaged to be embedded systems and education.[2]

, Minix 3 supports IA-32 and ARM architecture processors.[3] It can also run on emulators or virtual machines, such as Bochs,[4] [5] VMware Workstation,[6] Microsoft Virtual PC,[7] Oracle VirtualBox,[8] and QEMU. A port to PowerPC architecture is in development.[9] The distribution comes on a live CD and does not support live USB installation.[10] The project has been dormant since 2018,[11] and the latest release is 3.4.0 rc6 from 2017,[12] although the Minix 3 discussion group is still active.[13]

Minix 3 is believed to have inspired the Intel Management Engine (ME) OS found in Intel's Platform Controller Hub, starting with the introduction of ME 11, which is used with Skylake and Kaby Lake processors.[14] [15] It was debated that Minix could have been the most widely used OS on x86/AMD64 processors, with more installations than Microsoft Windows, Linux, or macOS, because of its use in the Intel ME.[16]

Goals of the project

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

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.[20]

History

MINIX 3 versions[21] [22]
VersionRelease dateDescription
3.1.0
(OSDI3)
2005-10-18
3.1.1
(SOSP)
2005-10-24
3.1.22006-04-18
3.1.2a2006-05-29
  • New Packman package manager.
  • Fixed an installation issue with auto-partitioning disks.
3.1.32007-04-13
3.1.3a2007-06-08
  • Bug fixes.
3.1.42009-06-09
3.1.52009-11-05
  • Improvements performance
  • Shared memory
  • setitimer function
  • ISO 9660 file system
  • Open Sound System
  • Trap NULL accesses now, for user convenience
  • Improved signal handling
  • Better support for debuggers (ptrace improvements, etc.)
  • Network card autodetection (for supported PCI cards), improved network configuration
3.1.62010-02-08
  • New Network drivers: Atheros L2, Intel E1000, Realtek 8169, DEC Tulip
  • PipeFS – removed pipe handling from filesystem drivers
  • HGFS – support for mounting VMware shared folders as file system
  • VFS: supplemental group support and sticky bit support
  • Floating-point unit support
  • System Event Framework (SEF)
  • Experimental APIC support
3.1.72010-06-16
  • Userspace scheduling and a scheduling server[26]
  • Proper support for multiple Ethernet cards of the same type
  • Boot monitor allows loading images > 16 MB
  • Buildsystem support for building Minix with GCC
  • Support for Windows-1251 and KOI8-U charsets
3.1.82010-10-04
3.2.02012-02-29
  • Porting GNU Debugger to Minix 3 and implementing core dumping support
  • FUSE support with experimental NTFS-3G file system
  • Gradually replacing userland, from Minix to NetBSD
  • Replacing the default compiler ACK with Clang; GCC is also supported
  • Switch to ELF and NetBSD libc libraries
  • Pkgsrc upstreaming and application porting
  • Asynchronous virtual filesystem (VFS) server
  • Replacing the bootloader from Minix to NetBSD
  • NCQ support in the AHCI driver
3.2.12013-02-21
3.3.0[27] 2014-09-15
  • ARM architecture support; cross-compilable
  • Support for mmap I/O mechanism; allows for shared dynamic libraries and lower memory needs
  • New input infrastructure: input server and keyboard driver separated from TTY
  • VND: vnode disk (loopback) block driver
  • LLVM Bitcode build of the system
  • Import of LLVM and clang in the sources
  • Unified block cache shared by FSes and VM
  • Improved NetBSD compatibility: utilities, calls, types (lots of 64-bit), toolchain, codebase, and packages
  • C type for messages: cleaner, bigger
  • Improved driver modularity: UDS separate from PFS, PTY from TTY, one controller per at_wini instance, LOG removed from boot image
  • Packages are now dynamically linked
3.4.0 rc62017-05-09X11 is now part of the operating system.
Minix 3 was publicly announced on 24 October 2005 by Andrew Tanenbaum during his keynote speech on top of the Association for Computing Machinery (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."

Initially released under the same BSD-3-Clause license that Minix was licensed under since 2000. In late 2005, the copyright owner was changed and a fourth clause was added.[28]

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 Linux and FreeBSD and hybrids like Windows have millions of lines of kernel code. In contrast, Minix 3 has about 6,000 lines of executable kernel code,[29] which can make problems easier to find in the code.

Cage the bugs

In monolithic kernels, device drivers 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 page tables, perform arbitrary input/output (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 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. Users will not notice recovery for some drivers (e.g., disk and network) but for others (e.g., audio and printer), they might. 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 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 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 buffer overflows 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 executable space protection. However, attacks which rely on running legitimately executable memory in a malicious way (return-to-libc, return-oriented programming) are not prevented by this mitigation.

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 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 I/O ports 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 random-access memory (RAM). Driver recovery does not affect running processes.

Integrate interrupts and messages

When an interrupt 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, which is about 4,000 lines of code (mostly in C, plus a small amount of assembly language). It handles interrupts, scheduling, and message passing. It also supports an application programming interface (API) of about 30 kernel calls that authorized servers and drivers can make. User programs cannot make these calls. Instead, they can issue POSIX system calls 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 device drivers, each one running as a separate userland 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 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 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 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, as in Linux and Windows systems, to about 20,000 lines greatly enhances system reliability.

Differences between Minix 3 and prior versions

See main article: Minix.

Minix 1.0, 1.5, and 2.0 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 and some x86 assembly language. Source code of the kernel, memory manager, and file system of Minix 1.0 are printed in the book. Tanenbaum originally developed Minix for compatibility with the IBM PC and IBM PC/AT microcomputers available at the time.

Minix 1.5, released in 1991, included support for MicroChannel IBM PS/2 systems and was also ported to the Motorola 68000 and SPARC architectures, supporting the Atari ST, Commodore Amiga, Apple Macintosh and Sun Microsystems SPARCstation computer platforms. A version of Minix running as a user process under SunOS was also available.

Minix 2.0, released in 1997, was only available for the x86 and Solaris-hosted SPARC architectures. Minix-vmd was created by two Vrije Universiteit researchers, and added virtual memory and support for the X Window System.

Minix 3 does the same, and provides a modern operating system with many newer tools and many Unix applications.[30] Prof. Tanenbaum once said:

Many improvements have also been made in the structure of the kernel since the Minix 2 release, making the system more reliable.[31] Minix version 3.1.5 was released 5 Nov 2009. It contains X11, Emacs, vi, cc, GCC, Perl, Python, Almquist shell, Bash, Z shell, FTP client, SSH client, Telnet client, Pine, 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 Clang compiler, experimental symmetric multiprocessing support, procfs and ext2fs filesystem support, and GNU Debugger (GDB). Several parts of NetBSD are also integrated in the release, including the bootloader, libc and various utilities and other libraries.[32]

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

Mascot

Rocky Raccoon is the mascot of Minix 3.[33]

MINIXCon

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

It was held once in 2016. MINIXCon2017 was cancelled due to lack of talks submitted.[34] [35]

See also

Further reading

Notes and References

  1. Web site: The Minix license. 2005-11-24. https://web.archive.org/web/20051124074039/http://www.minix3.org/license.html. 2005-11-24. dead.
  2. Web site: corbet . Minix 3 hits the net . Lwn.net . 2005-10-24 . 2014-05-01.
  3. Web site: minix3.org . minix3.org . 2017-04-16.
  4. Web site: Getting Started with Minix on Bochs on Mac OS . Woodhull.com . 2014-05-01.
  5. Web site: OSNews.com . OSNews.com . 2014-05-01.
  6. Web site: Minix under VMWare Installation How-To . Patrick.wagstrom.net . 2014-05-01 . https://web.archive.org/web/20131112031316/http://patrick.wagstrom.net/projects/academic/cs551/minix.html . 2013-11-12 . dead .
  7. Web site: Minix on Virtual PC: first look . Woodhull.com . 2014-05-01.
  8. Web site: Minix 3 on Virtual box . 6 August 2014 . inopinion.org.
  9. Web site: A port of the MINIX OS to the PowerPC platform . Alting. Ingmar.
  10. Web site: Minix3 . 2014-05-01 . Minix3.
  11. Web site: git.minix3.org Git - minix.git/summary . 2022-05-03 . git.minix3.org.
  12. Web site: Index of /Iso/Snapshot/ .
  13. Web site: minix3 - Google Groups . 2022-05-03 . groups.google.com.
  14. Web site: Intel ME: The Way of Static Analysis. blog.ptsecurity.com. 2017-08-28. 2017-07-01. https://web.archive.org/web/20170701161110/http://blog.ptsecurity.com/2017/04/intel-me-way-of-static-analysis.html. dead.
  15. Web site: Corna. Nicola. me_cleaner: Tool for partial deblobbing of Intel ME/TXE firmware images. GitHub. 2017-08-28. 2017-08-28.
  16. Web site: An Open Letter to Intel . 2022-09-06 . Tanenbaum . Andrew S. . https://web.archive.org/web/20220617004003/https://www.cs.vu.nl/~ast/intel/ . 2022-06-17 . live.
  17. Web site: Tanenbaum . Andy . Andrew S. Tanenbaum . Introduction to MINIX 3 . OSnew . OSnews . 2006-09-25 . 2008-07-04 . From Rebirth section: "Various studies have shown that software broadly contains something like 6-16 bugs per 1000 lines of code and that device drivers have 3-7 times as many bugs as the rest of the operating system. When combined with the fact that 70% of a typical operating system consists of device drivers, it is clear that device drivers are a big source of trouble. For Windows XP, 85% of the crashes are due to bugs in device drivers. Obviously, to make OSes reliable, something has to be done to deal with buggy device drivers. Building a reliable system despite the inevitable bugs in device drivers was the original driving force behind Minix 3.".
  18. Web site: CSAIL Event Calendar . Csail.mit.edu . 2014-05-01 . https://web.archive.org/web/20120204065301/http://www.csail.mit.edu/events/eventcalendar/calendar.php?show=event&id=1128 . 2012-02-04 . dead .
  19. Web site: Tanenbaum-Torvalds debate, Part II . Cs.vu.nl . 2006-05-12 . 2014-05-01.
  20. Web site: Reliability. www.MINIX3.org . https://web.archive.org/web/20060701163916/http://www.minix3.org/reliability.html . July 1, 2006.
  21. Web site: MinixReleases – Minix Wiki . Wiki.minix3.org . 2014-05-01 .
  22. Web site: Minix versions and their use in teaching. 2021-06-16. 2006-07-11. https://web.archive.org/web/20060711224110/http://minix1.woodhull.com/teaching/teach_ver.html.
  23. Web site: LICENSE (3.1.0). GitHub. 2021-06-16.
  24. Web site: LICENSE (3.1.1). 2021-06-16.
  25. Web site: LICENSE (3.1.2). GitHub. 2021-06-16.
  26. Web site: Individual Programming Assignment User Mode Scheduling in Minix 3 . Swift. Björn Patrick. Minix3.org.
  27. https://wiki.minix3.org/doku.php?id=releases:3.3.0 MINIX Release 3.3.0
  28. Web site: Minix1: Copying and Use Policies. 2007-02-13. 2020-06-14. https://web.archive.org/web/20200614080610/http://minix1.woodhull.com/copyinfo.html. live.
  29. Web site: The MINIX 3 Operating System . minix3.org . https://web.archive.org/web/20120113022926/http://www.minix3.org/ . 2012-01-13 . dead .
  30. Web site: FAQ – Minix Wiki . Minix3.org . 2013-11-09 . 2014-05-01.
  31. Web site: Improvements since V2. www.minix3.org . https://web.archive.org/web/20060417154237/http://www.minix3.org/improvements.html . April 17, 2006.
  32. Web site: MINIX Releases. wiki.minix3.org. 29 February 2012. dead. https://web.archive.org/web/20120621105604/http://wiki.minix3.org/en/MinixReleases. 21 June 2012.
  33. Web site: mascot [Wiki]]. wiki.minix3.org. en. 2017-07-20.
  34. Web site: Minix3 . 5 July 2006 . 10 November 2017 . https://web.archive.org/web/20171110164353/http://www.minix3.org/ . bot: unknown .
  35. Web site: Minix3. www.minix3.org. 2017-11-11.