Intro to MINIX

MINIX logo

When UNIX was young, Version 6, the source code was widely available under the AT&T license. John Lions of the University of New South Wales in Australia wrote a book describing line by line (1996). It was taught in many university system courses.

AT&T saw UNIX as a valuable commercial product, so in Version 7 AT&T released it with a “No Teaching” clause. With this, most universities stopped teaching operating systems in depth, and they just taught theory. This left the student with a lopsided view of operating system design and implementation.

Andrew Tanenbaum decided to write a new operating system from scratch not using any AT&T code, and this operating system would be compatible with UNIX for the user, but different on the inside. MINIX was free to be studied line by line.

MINIX was structured in a more modular way. From the very start the MINIX file system, and the memory manager were not part of the operating system, but rather ran as user programs. In MINUX 3, the I/O device drivers except the clock driver all ran as user programs. The MINIX code has thousands of comments in it to aid in study.

Why were the memory manager, file system and I/O ran as user programs? It has to do with bugs in the software. It’s hard to get “real” bug numbers per lines of code (LOC), but we have some guesstimates. With bug reporting systems, we can get a guess of how many lines of code an operating system has. This also does not take into account for bugs that are not reported as well.

  • Windows is estimated to have 10-20 bugs per 1,000 LOC. Windows XP reportedly had around 40 Million LOC.
  • macOS is said to have 5-10 bugs per 1,000 LOC, but since macOS like Windows are closed systems, it’s hard to know the exact number.
  • Linux (kernel) is estimated to have 0.6-1.0 bugs with about 30 million LOC, at the time of this writing.

The most untrusted code happens to be drivers for a couple of reasons. One reason is that drivers can be pushed into production without exhaustive testing. Now it is worth noting that a lot of these bugs may not be serious, but some may, and when they are in kernel space, if they are exploited can cause serious issues. The second reason is that most programmers will spend time in more “fun” parts of the operating system or kernel, than playing around with a printer driver, for example.

Shortly after MINIX was released, a USENET newsgroup comp.os.MINIX was formed to discuss it. It attracted a lot of people wanting to add features, but Tanenbaum wanted to keep MINIX small. He wanted MINIX remain small in order for students to study it. It is more difficult to read and understand a large system.

A Finnish student Linus Torvalds installed MINIX. Now MINUX could be run without being installed on a PC. Torvalds studied MINIX. Linus wanted to read USENET newsgroups from his PC and not from the university. Linus wrote a program to do this, but he soon realized he needed a different terminal driver. Then he wanted to download and save postings from the USENET, so he wrote a disk driver and a file system.

By August 25, 1991 a primitive kernel was written, and it was announced on comp.os.MINIX. This attracted a lot of people to help him, and on March 13, 1994 Linux 1.0 was released, thus Linux was born.