Title: Class 22: Microkernels and Beyond
Date: 2014-04-17
Category: Classes
Tags: operating systems, kernel, kernel programming, synchronization, Dijkstra, Lamport, mutual exclusion
Author: David Evans

   <div class="todo"> 
   <center>

Don't forget to submit a [**Project Submission
Option**](https://docs.google.com/forms/d/1yECpbvJLWqelIRrLPwgioA1G8Eb4nsaa3TgzW_qr-Uw/viewform)
by Monday, 21 April (4:59pm).  But, the earlier you submit the more
likely you are to receive your first choice.  **Teams that do not submit
this form on time, will be required to do whatever I choose, and also
take a final exam.**

   </center>
   </div>


<center>
<iframe src="http://www.slideshare.net/slideshow/embed_code/33655345" width="427" height="356" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px; max-width: 100%;" allowfullscreen> </iframe> 

</center>

# Operating System Design

<center>
<iframe width="560" height="315" src="//www.youtube.com/embed/sxgYPSsIA74?list=PLvpsxlEF9cP0JPdl3GjbykbX0uhMUWW9K" frameborder="2" allowfullscreen></iframe>
</center>

What are the design tradeoffs one should consider in putting something in the kernel?
<div class="gap">

</div>

Should the file system be in the kernel?
<div class="gap">

</div>

# Microkernels

<center>
<iframe width="560" height="315" src="//www.youtube.com/embed/UMsscWnM67g?list=PLvpsxlEF9cP0JPdl3GjbykbX0uhMUWW9K" frameborder="2" allowfullscreen></iframe>
</center>

What aspects of an operating system _must_ be in the kernel?
<div class="gap">

</div>

What are good reasons to put anything else in the kernel?
<div class="gap">
</div>


From [_The Tanenbaum-Torvalds Debate_](http://oreilly.com/catalog/opensources/book/appa.html):

<pre><code class="code">
From: ast@cs.vu.nl (Andy Tanenbaum)
Newsgroups: comp.os.minix
Subject: LINUX is obsolete
Date: 29 Jan 92 12:12:50 GMT
&nbsp;
I was in the U.S. for a couple of weeks, so I haven't commented much on
LINUX (not that I would have said much had I been around), but for what 
it is worth, I have a couple of comments now.
&nbsp;
As most of you know, for me MINIX is a hobby, something that I do in the
evening when I get bored writing books and there are no major wars,
revolutions, or senate hearings being televised live on CNN. My real
job is a professor and researcher in the area of operating systems.
&nbsp;
As a result of my occupation, I think I know a bit about where operating
are going in the next decade or so. Two aspects stand out:
&nbsp;
1. MICROKERNEL VS MONOLITHIC SYSTEM
   Most older operating systems are monolithic, that is, the whole operating
   system is a single a.out file that runs in 'kernel mode.'  This binary
   contains the process management, memory management, file system and the
   rest. Examples of such systems are UNIX, MS-DOS, VMS, MVS, OS/360, 
   MULTICS, and many more.
&nbsp;
   The alternative is a microkernel-based system, in which most of the OS
   runs as separate processes, mostly outside the kernel.  They communicate
   by message passing.  The kernel's job is to handle the message passing,
   interrupt handling, low-level process management, and possibly the I/O.
   Examples of this design are the RC4000, Amoeba, Chorus, Mach, and the
   not-yet-released Windows/NT.
&nbsp;
   While I could go into a long story here about the relative merits of the
   two designs, suffice it to say that among the people who actually design
   operating systems, the debate is essentially over.  Microkernels have won.
   The only real argument for monolithic systems was performance, and there
   is now enough evidence showing that microkernel systems can be just as
   fast as monolithic systems (e.g., Rick Rashid has published papers comparing
   Mach 3.0 to monolithic systems) that it is now all over but the shoutin'.
</code></pre>

# Inter-process Communication

<center>
<iframe width="560" height="315" src="//www.youtube.com/embed/mRr1lCJse_I?list=PLvpsxlEF9cP0JPdl3GjbykbX0uhMUWW9K" frameborder="2" allowfullscreen></iframe>
</center>

What are different methods you have used for inter-process communication?  How expensive is each?
<div class="gap">

</div>

What can be done to make IPC less expensive?
<div class="gap">

</div>

[Comparing Linux and Minix](http://lwn.net/Articles/220255/)

Is Windows NT a microkernel?
<div class="gap">

</div>

David Black, David B. Golub, Daniel P. Julin, Richard F. Rashid, Richard
P. Draves, Randall W. Dean, Alessandro Forin, Joseph Barrera, Hideyuki
Tokuda, Gerald Malan, and David Bohman.  [_Microkernel Operating System
Architecture and Mach_](|filename|./Black92.pdf). USENIX Workshop on
Microkernels, 1992.

How is IPC so fast on L4?
<div class="gap">

</div>

Jochen Liedtke. [_Improving IPC By Kernel Design_](|filename|./liedtke93improving.pdf). SOSP 1993.

Gerwin Klein, Kevin Elphinstone, Gernot Heiser, June Andronick, David
Cock, Philip Derrin, Dhammika Elkaduwe, Kai Engelhardt, Rafal Kolanski,
Michael Norrish, Thomas Sewell, Harvey Tuch, Simon Winwood.  [_seL4:
Formal Verication of an OS Kernel_](|filename|./seL4.pdf).  SOSP 2009.

Kevin Elphinstone and Gernot Heiser. [_From L3 to seL4: What Have We
Learnt in 20 Years of L4 Microkernels?_](|filename|./20years.pdf). SOSP
2013.

How many microkernels are you carrying today?
<div class="gap">

</div>

## Exokernels

<center>
<iframe width="560" height="315" src="//www.youtube.com/embed/QgIeBpyS5-4?list=PLvpsxlEF9cP0JPdl3GjbykbX0uhMUWW9K" frameborder="2" allowfullscreen></iframe>
</center>

Should an operating system do more than just manage resources?
<div class="gap">

</div>

Dawson Engler and Frans Kaashoek. [_Exterminate All Operating System
Abstractions_](|filename|./exokernel.pdf). Fifth Workshop on Hot Topics
in Operating Systems, 1995.

[Exokernel Talk Slides](http://pdos.csail.mit.edu/exo/exo-slides/index.htm), 1998.

[Homework or espionage?](http://homes.cs.washington.edu/~lazowska/ott/WSJ.Akamai.html) ("Mr. Kaashoek insists it was homework, not espionage.")

## What's Next?

How should future operating systems be designed?
<div class="gap">

</div>

_Bitter experience in the design of operating systems leads to the conclusion that radical changes must be made, both the way we think about functions of operating systems and in the way they are implemented._ (Butler Lampson, 1969)

[NATO Software Engineering Techniques Conference](http://homepages.cs.ncl.ac.uk/brian.randell/NATO/N1969/index.html), Rome 1969.

<div id="disqus_thread"></div>

<script type="text/javascript">
        /* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
        var disqus_shortname = 'rust-class'; // required: replace example with your forum shortname
	var disqus_url = 'http://www.rust-class.org/class-22-microkernels-and-beyond.html';

        /* * * DON'T EDIT BELOW THIS LINE * * */
        (function() {
            var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
            dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
            (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
        })();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a>
