Microkernel vs. monolith and "triumph" of MINIX

    Recently, Andrew Tatenbaum, a professor at the Free University of Amsterdam and the author of the educational and miniature Unix Minix system, was once again at the center of events thanks to the epistolary genre. In his letter to Intel, he thanked the company for using Minix, complained that it had not trumpeted it at every step, and said that because of this, few people know that Minix is ​​by far the most popular OS in the world .


    Unbridled joy


    We must pay tribute to the professor, he knows how to choose the addressee, time and place in order to cause a loud and lasting effect with the help of a simple message sent by e-mail. His previous correspondent was Linus Torvalds, and their correspondence about the monolithic and micro core was included in the annals of the history of IT. Without this, it is difficult to understand why Andrew Tanenbaum is so exalted because of the alleged success of the Minix, which for only ten years ensured the work of the Intel IME backdoor .


    The birth of Linux and criticism of the monolithic kernel


    26 years ago, programming for Unix was not a trivial thing for an ordinary student, since all versions of Unix were paid. To master this operating system, Linus decides to install Minix. The Internet at that time was just in its infancy, the OS order went through regular mail, as well as delivery. For the sake of Minix, I had to fork out for $ 169.


    I have a lot of complaints about Minix. The worst thing was terminal emulation, a very important program for me, because I used it to connect to a university computer. I depended on this emulation every time I contacted a university computer to work with a powerful Unix system or just go online.

    Soon, the future creator of Linux discovered the serious flaws of Minix. Since it was just a training version of Unix, the professor deliberately misrepresented it. Many of these shortcomings could be eliminated by patch of the most famous Minix hacker Bruce Evans, but in order to install it you had to pretty transport. The most significant drawback for Linus was the terminal emulation program, which had to be replaced with its own. Then a file system driver was needed and away we go, the kernel of the new OS originated on the principle of porridge from an ax.


    On August 25, 1991, Linus sends his famous message that he is working on a free operating system, but it will not be such a large and professional project as GNU . Among other things, it is noteworthy that this and other early announcements of his operating system Linus sends to the Minix conference, delaying the users of the latter.


    Andrew Tanenbaum for the time being did not react to this at all, but Linux grew like a snowball. Already in January 1992, version 0.12 was released, in which page swapping to disk was implemented - something that was not in Minix. Soon after, the professor condescended to an upstart to personally answer him, and on January 29th Linus receives a message to the conference comp.os.minixwith moralizing content. The start was encouraging.


    From: ast@cs.vu.nl (Andy Tanenbaum)
    That: Newsgroups: comp.os.minix
    Subject: LINUX is out of date
    Date: 29 Jan 92 12:12:50 GMT

    I went here for a couple of weeks to the USA, so I didn’t write about LINUX (not that I began to write if I were here). However, now I want to make a few comments.
    As most of you know, for me MINIX is a hobby that I do in the evenings, when I get tired of writing books, and on CNN they don’t show any wars, revolutions or parliamentary hearings. My main job is teaching and research in the field of operating systems.

    This was followed by background information about the monolithic core, microkernel and OS, professing one or another principle. Then followed an argument, which was not logical from the point of view of logic, that among specialists in the development of operating systems disputes on this issue had already ceased due to the clear advantage of the microkernel. Further the declaration that Minix is ​​progressive and Linux is a return to the 1970s. In addition, Linux is tied to one architecture while Minix was ported from Intel processors to other platforms: Atari, Amiga, Macintosh, SPARC and NS32016.


    I could tell a lot about the comparative advantages of these two approaches, but suffice it to say that among specialists in the development of operating systems, disputes have already ended. The micronucleus won. Minix is ​​a microkernel system. The file system and memory management are separate processes that operate outside the kernel. I / O is also performed separately. LINUX is a monolithic system. This is a big step back to the 70s. years .

    Microkernel vs Monolithic


    In the early 90s, the microkernel was really in favor with the designers of operating systems. In their opinion, the kernel of the OS should be minimal and contain only the most necessary: ​​memory management, scheduler and IPC, and everything else is implemented in the form of services. Having broken the whole into many simple parts, the complexity disappears, and lightweight services easily exchange data with the microkernel. Failure in the driver of the file system or network card, so it was elementarily restored by rebooting the corresponding service.


    Linus accepts the challenge


    Linus had a different opinion on this. Paying tribute to the elegance and grace of micronucleus architecture from a theoretical point of view, he nevertheless considered the micronucleus unsuitable for practical purposes. The imaginary simplicity of the microkernel turns out to be that the interaction and interface between the simple parts of the microkernel creates difficulties that level all its “paper” advantages. In his response, he outlined his vision on the matter. After bold attacks against his opponent, Linus goes to the point.


    From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
    Subject: Re: LINUX deprecated
    Date: 29 Jan 92 23:14:26 GMT
    Organization: University of Helsinki

    ...
    Yes, linux is a monolithic system, and I agree, that the micronucleus is better. If your message did not have such a controversial headline, I would probably agree with most of your statements. From a theoretical (and aesthetic) point of view, linux loses. If the GNU kernel were ready last spring, I would not have taken up my development: the trouble is that it was not ready then and is not ready until now. Linux wins primarily because it is ready.

    It then lists the Minix problems with multitasking in the file system.


    If this were the only criterion for the quality of the kernel, you would be right. However, you are not writing that the microkernel in minix is ​​poorly done and there are problems with multitasking (in the kernel). If I made an OS whose file system would have problems with multitasking, I would not hastily condemn others: on the contrary, I would go out of my way to let everyone forget about my failure. Yes, I know that for minix there are a lot of patches that provide multi-threaded work, but these are only patches, and Bruce Evans says that there are still many synchronization problems.

    The skirmish in the conference continues, new participants enter into the dispute. Andrew Tanenbaum and Linus Torvalds continue the argument, but in a more restrained manner. Below is a free translation of selected quotes.


    Andrew Tanebaum : I purposely wrote Minix so clumsy so that students could drive it on a diverse and inexpensive computer hardware, but my OS's design is normal, not just your backward Linux. It is also impossible to transfer it to other platforms. I’d put you on the exam.

    David Feustel : It's okay, and Einstein had bad grades in mathematics and physics .

    Ken Thompson : Users who care about whether they have up-to-date software on their computer, performance is much more important. Yes, the future lies with the microkernel, but a monolithic core is easier to cook up. However, it’s easier to screw it up if you write code in haste.

    Randy Burns :Linux system calls are compatible with portable OSs, so complaints about binding to one platform are inappropriate. On the contrary, Linux closes the gap, allowing us to use GNU programs . Maybe in a couple of years, when Hurd and low-cost BSD systems get Linux spread and become obsolete, but now we can enjoy gcc, bash, bison for nothing and write code for a better OS .

    Pete French : Isn't the microkernel and monolithic core the artifacts of the programming language they are written in? What is the difference between a microkernel written in C and a monolithic kernel - in OCCAM?

    Linus Torvalds :You tried so for the sake of students, well then it is clear. But multitasking in your OS is still a problem, whatever one may say, but everything flies on my "backward" monolithic Linux. There will be no big problems with portability, since the Linux API is portable - there would be those who wish. And good grades do not shine for me anyway, I recently quarreled with another teacher of OS architecture.

    Lawrence C. Foard : Theorists are such theorists. They have great ideas, but no one bothered to check them in practice. Intelligent 32-bit processors have been available on the market for almost 10 years, but no one except Linus has written an OS for them that can be felt without having to buy Unix AT&T for $ 100,000. A finished OS costs a dozen paper ones. I can already write code for Linux todayand experiment as I please.

    peter da silva : It’s great that Linux exists and a monolithic kernel is one of the reasons that it was created so quickly. This is a powerful argument in favor of a monolithic core, but this does not mean that the micronucleus must be slow, or that it is "paper".

    The arguments in favor of the microkernel were really outweighed at that time, but to date, the experience of using both principles of building the OS has made adjustments .


    Despite the capabilities of Mach, such performance losses in the real world are unacceptable. As the rest of the development teams came to the same conclusions, their enthusiasm quickly began to fade. Therefore, most of the community of OS developers considered that using IPC as the basis of the OS was initially a failure.

    On this, the first part of the Marlezon Ballet ended. The first round of the battle remained with the professor, Linus took his words back, the first came out of the dispute, but did not change his mind, so in the main he was right - his OS won because she was ready . After 14 years, the debate of the famous theoretician and practice continued.


    Used materials


    1. Linus Torvalds, “Just for fun”
    2. The Tanenbaum Torvalds debate

    Also popular now: