<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>keeping simple &#187; microkernel</title>
	<atom:link href="http://www.yodaiken.com/category/software-engineering/operating-systems/microkernel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.yodaiken.com</link>
	<description>Systems software technology and business</description>
	<lastBuildDate>Sun, 01 Jan 2012 18:30:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>why microkernels don&#8217;t work</title>
		<link>http://www.yodaiken.com/2010/10/why-microkernels-dont-work/</link>
		<comments>http://www.yodaiken.com/2010/10/why-microkernels-dont-work/#comments</comments>
		<pubDate>Sun, 24 Oct 2010 03:24:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[operating system]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=1067</guid>
		<description><![CDATA[You can almost just see it from this diagram of connected boxes.  I want to think of the whole system as a series of connected state machines.  The arrows show how information is moved around the system with the green &#8230; <a href="http://www.yodaiken.com/2010/10/why-microkernels-dont-work/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.yodaiken.com/wp-content/uploads/2010/10/microkernel.png"><img class="alignright wp-image-1070" title="microkernel" src="http://www.yodaiken.com/wp-content/uploads/2010/10/microkernel.png" alt="" width="400/" /></a>You can almost just see it from this diagram of connected boxes.  I want to think of the whole system as a series of connected state machines.  The arrows show how information is moved around the system with the green arrows identifying paths that carry data to and from the memory. When you fill in the details, you start to see that the proposed sheering off of the &#8220;fileserver&#8221; from the remaining &#8220;kernel&#8221; does not actually split state as much as it reproduces it. So much of the state of the rump Kernel needs to be available to the FileServer that the proposed modularity disintegrates.&#8221;&#8217;</p>
<p>The counter argument, in its best form, can be found at <a href="http://www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/fsys.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/fsys.html?referer=');">QNX</a>.</p>
<p><a href="http://www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/fsys.html" onclick="pageTracker._trackPageview('/outgoing/www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/fsys.html?referer=');">http://www.qnx.com/developers/docs/6.3.2/neutrino/sys_arch/fsys.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2010/10/why-microkernels-dont-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OS design</title>
		<link>http://www.yodaiken.com/2009/07/os-design/</link>
		<comments>http://www.yodaiken.com/2009/07/os-design/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 03:46:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[microkernel]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[elegance]]></category>
		<category><![CDATA[os design]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=446</guid>
		<description><![CDATA[Working on a &#8220;process algebra&#8221; post, I had to look up previous posts on microkernels where I wrote this: Information hiding is only good design when the hidden information is not needed by the software it is hidden from! If &#8230; <a href="http://www.yodaiken.com/2009/07/os-design/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Working on a &#8220;process algebra&#8221; post, I had to look up previous posts on<a href="http://www.yodaiken.com/2006/05/microkernels-and-why-academic-os-research-is-boring/" target="_blank"> microkernels</a> where I wrote this:</p>
<blockquote><p>Information hiding is only good design when the hidden information is not needed by the software it is hidden from! If you hide information that you need to share youâ€™re just wasting time. A great example of real modularity is the splitting off of the command interpreter (first in CTSS (corrected)) from the kernel. This split is possible because the designers recognized that there is very little information exchange between kernel and interpreter. An example of a fake module is the attempt of most microkernels to split virtual memory paging and storage caching. The most elegant and efficient message passing interface that can be imagined cannot fix the problem that too much information must be shared to make the resulting monstrosity run properly.</p></blockquote>
<p><img class="alignleft size-medium wp-image-447" title="swisspic20051210_6305626_0" src="http://www.yodaiken.com/wp-content/uploads/2009/07/swisspic20051210_6305626_0-300x225.jpg" alt="swisspic20051210_6305626_0" width="300" height="225" />Which applies to process algebras in that the basic &#8220;primitive&#8221; of process algebra is the communicating process &#8211; dumb idea. The one thing I&#8217;d take back from the para above is the overuse of exclamation points. I was more enthusiastic in those days. A related point was made here:</p>
<blockquote><p>The <span style="text-decoration: underline;"> Le Corbusier fallacy</span> is the mistaken belief that the purpose of engineering works is to impress passersby with a show or spectacle or to exhibit the aesthetic sensibility of the â€œartistâ€. In architecture, this fallacy produces high rise slums that look striking from the highway but that are uninhabitable. In programming, the fallacy produces microkernel operating systems, â€œformal methodsâ€, functional programming languages, and other â€œsimpleâ€, â€œcleanâ€, â€œelegantâ€ designs that do nothing interesting. De Botton compares the Salginatobel Bridge in Switzerland to Brunelâ€™s Clifton Suspension Bridge in England and finds the first to be â€œelegantâ€ and the second to be clunky and â€œponderousâ€. Of course the Brunel bridge is bulkier than the swiss toy: it is far larger, carries much more and much heavier traffic, has been adaptable, and was built 100 years earlier with much less capable materials. But one might as well argue that clipper ships are ponderous compared to jet-skis, or that 727â€™s are not as lightweight as paper airplanes or that UNIX systems are more â€œbloatedâ€ than some academic proof of concept. The Salginotobel bridge is <a href="http://www.schierstourismus.ch/salgina/esalgina.htm" onclick="pageTracker._trackPageview('/outgoing/www.schierstourismus.ch/salgina/esalgina.htm?referer=');">cute</a> and features a bravura use of what was new technology in the 1930s when it was designed, but  the  <a href="http://www.clifton-suspension-bridge.org.uk/" onclick="pageTracker._trackPageview('/outgoing/www.clifton-suspension-bridge.org.uk/?referer=');">Clifton bridge</a> has been an engineering and aesthetic triumph since it was completed in the 1860s and it is a far more powerful work.</p>
<p>[<a title="fallacy" href="http://www.yodaiken.com/2006/12/elegance-shmelagance-the-le-corbusier-fallacy-again/" target="_blank">cite</a>]<img class="alignright" src="http://www.galinsky.com/buildings/marseille/apartment%20window.jpg" alt="" width="210" height="280" /></p></blockquote>
<p>This post has a perhaps unmerited slap at Corbusier who did design some nice <a href="http://www.galinsky.com/buildings/marseille/index.htm" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.galinsky.com/buildings/marseille/index.htm?referer=');">buildings</a>.</p>
<p>What does it have to do with process algebra?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2009/07/os-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Operating system research &#8211; 16 years perspective</title>
		<link>http://www.yodaiken.com/2008/10/operating-system-research-14-years-perspective/</link>
		<comments>http://www.yodaiken.com/2008/10/operating-system-research-14-years-perspective/#comments</comments>
		<pubDate>Tue, 07 Oct 2008 18:27:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[academics]]></category>
		<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software engineering]]></category>
		<category><![CDATA[ast]]></category>
		<category><![CDATA[micorkernels]]></category>
		<category><![CDATA[operating systems design]]></category>
		<category><![CDATA[os]]></category>
		<category><![CDATA[pike]]></category>
		<category><![CDATA[plan9]]></category>
		<category><![CDATA[tanenbaum]]></category>

		<guid isPermaLink="false">http://www.yodaiken.com/?p=170</guid>
		<description><![CDATA[It&#8217;s somewhat funny and somewhat sad to read this thread on the old USENET. Starting out with Andy Tanenbaum&#8217;s proposed list of accepted truths (most of which I thought wrong at the time) GENERALLY ACCEPTED AS TRUE BY RESEARCHERS IN &#8230; <a href="http://www.yodaiken.com/2008/10/operating-system-research-14-years-perspective/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s somewhat funny and somewhat sad to read <a title="usenet tannebaum thread" href="http://fred.cambridge.ma.us/c.o.r.flame/msg00000.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/fred.cambridge.ma.us/c.o.r.flame/msg00000.html?referer=');">this thread</a> on the old USENET. Starting out with Andy Tanenbaum&#8217;s proposed list of accepted truths (most of which I thought wrong at the time)</p>
<blockquote><p>GENERALLY ACCEPTED AS TRUE BY RESEARCHERS IN DISTRIBUTED SYSTEMS</p>
<ul>
<li>- The client-server paradigm is a good one</li>
<li>- Microkernels are the way to go</li>
<li>- UNIX can be successfully run as an application program</li>
<li>- RPC is a good idea to base your system on</li>
<li>- Atomic group communication (broadcast) is highly useful</li>
<li>- Caching at the file server is definitely worth doing</li>
<li>- File server replication is an idea whose time has come</li>
<li>- Message passing is too primitive for application programmers to use</li>
<li>- Synchronous (blocking) communication is easier to use than asynchronous</li>
<li>- New languages are needed for writing distributed/parallel applications</li>
<li>- Distributed shared memory in one form or another is a convenient model</li>
</ul>
</blockquote>
<p>and then <a title="pike plan9 response" href="http://fred.cambridge.ma.us/c.o.r.flame/msg00025.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/fred.cambridge.ma.us/c.o.r.flame/msg00025.html?referer=');">Rob Pike&#8217;s refutation</a> entitled &#8220;Andy Tanenbaum hasn&#8217;t learned anything&#8221;. A key point that comes up later in the discussion is Tanenbaum&#8217;s (incorrect) assertion that a &#8220;factor of two&#8221; performance loss is nothing to worry about. The date of the discussion is interesting, because in a few years the Linux Tsunami washed away most of the landscape of this discussion. As for my <a title="yodaiken" href="http://fred.cambridge.ma.us/c.o.r.flame/msg00064.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/fred.cambridge.ma.us/c.o.r.flame/msg00064.html?referer=');">contribution </a>it is very disturbing to see that I have not learned much about those topics in the last <span style="text-decoration: line-through;">14</span> 16 years.</p>
<p>It is clear that Rob Pike was right on many more issues than AST, but that seemed clear at the time too.</p>
<p>Subject: Andy Tanenbaum hasn&#8217;t learned anything</p>
<blockquote><p>From: rob@alice.att.com (research!rob)<br />
Date: 6 Apr 92 20:06:28 GMT<br />
Approved: comp-os-research@ftp.cse.ucsc.edu<br />
Newsgroups: comp.os.research<br />
Organization: AT&amp;T, Bell Labs<br />
Sender: usenet@darkstar.ucsc.edu</p>
<p>The implementers of Plan 9 are baffled by Andy Tanenbaum&#8217;s recent posting.<br />
We suspect we are not representative of the mainline view, but we disagree<br />
at some level with most of the &#8220;GENERALLY ACCEPTED&#8221; truths Andy claims.<br />
Point by point:</p>
<p>- The client-server paradigm is a good one<br />
Too vague to be a statement.  &#8220;Good&#8221; is undefined.<br />
- Microkernels are the way to go<br />
False unless your only goal is to get papers published.<br />
Plan 9&#8242;s kernel is a fraction of the size of any microkernel we know and offers more functionality and comparable or often better performance.<br />
- UNIX can be successfully run as an application program<br />
`Run&#8217; perhaps, `successfully&#8217; no.  Name a product that succeeds by running UNIX as an application.<br />
- RPC is a good idea to base your system on<br />
Depends on what you mean by RPC.  If you predefine the complete set of RPC&#8217;s, then yes.  If you make RPC a paradigm and expect every application to build its own (c.f. stub compilers), you lose all the discipline you need to make the system comprehensive.<br />
- Atomic group communication (broadcast) is highly useful<br />
Perhaps.  We&#8217;ve never used it or felt the need for it.<br />
- Caching at the file server is definitely worth doing<br />
True, but caching anywhere is worthwhile.  This statement is like saying &#8216;good algorithms are worth using.&#8217;<br />
- File server replication is an idea whose time has come<br />
Perhaps.  Simple hardware solutions like disk mirroring solve a lot of the reliability problems much more easily.  Also, at least in a stable world, keeping your file server up is a better way to solve the problem.<br />
- Message passing is too primitive for application programmers to use<br />
False.<br />
- Synchronous (blocking) communication is easier to use than asynchronous<br />
They solve different problems.  It&#8217;s pointless to make the distinction based on ease of use.  Make the distinction based on which you need.<br />
- New languages are needed for writing distributed/parallel applications<br />
`Needed&#8217;, no.  `Helpful&#8217;, perhaps.  The jury&#8217;s still out.<br />
- Distributed shared memory in one form or another is a convenient model<br />
Convenient for whom?  This one baffles us: distributed shared memory is a lousy model for building systems, yet everyone seems to be doing it.  (Try to find a PhD this year on a different topic.)</p>
<p>How about the &#8220;CONTROVERSIAL&#8221; points?  We should weigh in there, too:</p>
<p>- Client caching is a good idea in a system where there are many more nodes than users, and users do not have a &#8220;home&#8221; machine (e.g., hypercubes)</p>
<p>What?</p>
<p>- Atomic transactions are worth the overhead</p>
<p>Worth the overhead to whom?</p>
<p>- Causal ordering for group communication is good enough</p>
<p>We don&#8217;t use group communication, so we don&#8217;t know.</p>
<p>- Threads should be managed by the kernel, not in user space</p>
<p>Better: have a decent process model and avoid this process/thread dichotomy.</p>
<p>Rob Pike<br />
Dave Presotto<br />
Ken Thompson<br />
Phil Winterbottom</p></blockquote>
<p>Distributed shared memory &#8211; an idea that never made any sense to me.</p>
<p>[edited to reflect the passage of time][ and again to add the Pike/Presott/Thompson/Winterbottom text]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2008/10/operating-system-research-14-years-perspective/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Sparc T2 (niagra 2)</title>
		<link>http://www.yodaiken.com/2007/11/sparc-t2-niagra-2/</link>
		<comments>http://www.yodaiken.com/2007/11/sparc-t2-niagra-2/#comments</comments>
		<pubDate>Tue, 06 Nov 2007 02:43:45 +0000</pubDate>
		<dc:creator>yodaiken</dc:creator>
				<category><![CDATA[architecture]]></category>
		<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://yodaiken.com/?p=118</guid>
		<description><![CDATA[UT architecture seminar today was by Greg Grohoski from Sun &#8211; an updated version of his Hot Chips talk. I&#8217;m not a big fan of this approach to chip architecture: 8 processors, each with 8 threads, but they are working &#8230; <a href="http://www.yodaiken.com/2007/11/sparc-t2-niagra-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>UT architecture seminar today was by Greg Grohoski from Sun &#8211; an updated version of his <a href="http://www.hotchips.org/archives/hc18/3_Tues/HC18.S9/HC18.S9T2.pdf" title="Sun T2 processor" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.hotchips.org/archives/hc18/3_Tues/HC18.S9/HC18.S9T2.pdf?referer=');">Hot Chips talk</a>. I&#8217;m not a big fan of this approach to chip architecture: 8 processors, each with 8 threads, but they are working hard on a real problem. The problem is the usual one of high speed processors waiting around for memory. It was interesting to see how OS limitations continue to cripple processor design. Cort Dougan&#8217;s nice work on <a href="http://www.usenix.org/events/osdi99/full_papers/dougan/dougan_html/dougan.html" title="Optimizing the idle task" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.usenix.org/events/osdi99/full_papers/dougan/dougan_html/dougan.html?referer=');">memory management</a> showed that careful tuning of the operating system mapping code got software table walk to blow away hardware table walk. But Sun chip designers seem to have not had an option of improving Solaris code &#8211; or even with getting rid of horrible errors like the four page tables that might all have to be searched to resolve a page miss! The interrupt hardware had to emulate 20 years of junk and the nightmarish register windows are still there. Even worse, the chip designers are trying to fairly schedule threads &#8211; although I&#8217;m not sure whether that is over-reach by chip architects or limitations of the OS.  So, to me it looks like a huge amount of smarts, effort, and invention, compensating for problems that could have been solved in the operating system.  One interesting note was that their measurement apparently do not show that the doubling the shared tiny L2 cache would make much of a difference. My conjecture is that modern applications are not showing locality of reference &#8211; due to a long chain of decisions that look unsmart in retrospect.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2007/11/sparc-t2-niagra-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>more on missed wakeup</title>
		<link>http://www.yodaiken.com/2007/10/more-on-missed-wakeup/</link>
		<comments>http://www.yodaiken.com/2007/10/more-on-missed-wakeup/#comments</comments>
		<pubDate>Thu, 11 Oct 2007 20:04:56 +0000</pubDate>
		<dc:creator>yodaiken</dc:creator>
				<category><![CDATA[communications]]></category>
		<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://yodaiken.com/?p=112</guid>
		<description><![CDATA[Here are some conventions [Update: typos fix, Friday] We are concerned with state machines and sequences of events. The prefixes of a sequence include the empty sequence &#8220;null&#8221; and the sequence itself. Relative state: If &#8220;w&#8221; is the sequence of &#8230; <a href="http://www.yodaiken.com/2007/10/more-on-missed-wakeup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are some conventions [Update: typos fix, Friday]</p>
<ul>
<li>We are concerned with state machines and sequences of events.  The prefixes of a sequence include the empty sequence &#8220;null&#8221; and the sequence itself.</li>
<li><strong>Relative state:</strong> If  &#8220;<em>w</em>&#8221; is the sequence of events that have driven a system of state machines from their initial to their current state then
<ul>
<li><em>|M</em>  is the output of state machine<em> &#8220;M&#8221;</em>  in the current state (reached by following input sequence &#8220;<em>w</em>&#8221; from the initial state of <em>M</em>)</li>
<li><em>a|M </em>is the output of <em>M</em> in the state reached from the current state by an &#8220;<em>a</em>&#8221; event.</li>
<li><em>z|M</em> is the output of <em>M</em> in the state reached from the current state by the sequence of events <em>&#8220;z&#8221;</em> (if it is not clear from the context whether <em>&#8220;z&#8221;</em> is an event or a sequence, then we can just say which it is.)</li>
</ul>
</li>
<li><strong>Absolute state</strong> where the sequence parameter is made explicit. This is mostly useful fordefining the initial output and for  when we construct composite state machines.
<ul>
<li><em>w:M</em>  is the output of state machine<em> &#8220;M&#8221;</em>  in the  state reached by following input sequence &#8220;<em>w</em>&#8221; from the initial state of <em>M</em>.</li>
<li><em>wa:M </em>is the output of <em>M</em> in the state reached by following the sequence wa (obtained by appending event a to sequence w) from the initial state of M.</li>
<li><em>wz:M</em> is the output of <em>M</em> n the state reached by following the sequence wz (obtained by appending event sequence z to sequence w) from the initial state of M (if it is not clear from the context whether <em>&#8220;z&#8221;</em> is an event or a sequence, then we can just say which it is.)</li>
<li><em>null:M</em> is the output of M in its initial state.</li>
</ul>
</li>
</ul>
<p>Specific state machines</p>
<ul>
<li><em>|Time</em> is the current real-time.</li>
<li><em>|Running(p)  =1</em> if<em> p</em> is executing and 0 otherwise</li>
<li><em>|Runnable(p) =1</em> if <em>p</em> wants to be scheduled, 0 otherwise.</li>
<li>|<em>RequestWakeup(p,e)=1</em>  if <em>p</em> is requesting a wakeup on event <em>e</em>, 0 otherwise</li>
<li>If <em>|Runnable(p)=0</em> then<em> a|Running(p)  â‰¤ |Running(p) </em>(if <em>p</em>  is not runnable it can stop running, but not start running.)</li>
<li>If <em>a|Runnable(p) &gt; |Runnable(p) </em>then there is at least one <em>e</em> so that <em>a|RequestWakeup(p,e)&lt; |RequestWakeup(p,e)</em>  (a process can only become runnable if some wakeup event happens and is cleared.)</li>
<li>If <em>a|RequestWakeup(p,e) &lt; |RequestWakeup(p,e) </em>then <em>a|Running(p)=1</em> (a request is only cleared if the process is actually made runnable)</li>
<li>If <em>|RequestWake(p,e)</em> then there is a <em>t</em> so that whenever <em>z|Time â‰¥ |Time +t</em> then<em> Sum(prefixes u of z; u|Runable(p)) &gt; 0</em> (if a process has requested a wakeup, it will become runnable in some bounded time &#8211; This liveness criteria is not strictly necessary)</li>
<li>Define <em>|Safe(p) </em>by <em>null:Safe(p)=1 </em>and
<ul>
<li><em>a|Safe(p)=<br />
</em></p>
<ul>
<li><em>0</em> if <em>a|Running(p)=0 and a|Runnable(p)=0  </em>and there is no <em>e</em> so that a<em>|RequestWakeup(p,e) (</em>real trouble requires that we are not runnable so can never start running unless we become runnable and cannot become runnable because we have no requests outstanding).<em><br />
</em></li>
<li><em>|Safe(p)</em> otherwise (<em>|Safe(p)</em> does not change otherwise)</li>
</ul>
</li>
</ul>
</li>
<li>So what we want is to ensure that |Safe(p)=1. If a process requests a wakeup, then deschedules, and then gets a wakeup, everything is fine.  The ordering is critical. If the wakeup happens before the process deschedules, but it is committed to descheduling then the process gets in trouble. If the code looks like  <span style="font-family: courier">Request e;  sleep;</span> then a wakeup event in-between the two operations is trouble. Note that  <span style="font-family: courier">Request e; if requeststill pending then sleep;</span>  is not safe unless the test and the sleep are atomic in some sense. Define  <em>|RequestOrder(p)</em>  by  <em>null:RequestOrder(p)=idle</em> and
<ul>
<li> <em>a|RequestOrder(p) =</em>
<ul>
<li><em>requesting</em> if <em>|RequestOrder(p) = idle</em> and <em>a|RequestWakeup(p,e)&gt;|RequestWakeup(p,e)</em> for some <em>e</em>.</li>
<li><em>idle</em>  if <em> a|Runnable(p)  &lt;  |Runnable(p) </em> and <em>|RequestOrder(p)=requesting</em></li>
<li><em>error</em> if <em>a|Runnable(p) &lt; |Runnable(p) </em>and<em> |RequestOrder(p) != requesting</em></li>
<li><em>|RequestOrder(p) </em>otherwise.<em><br />
</em></li>
</ul>
</li>
</ul>
</li>
<li><em>|RequestOrder(p) != error </em>does not ensure <em>|Safe(p).</em></li>
<li>One solution is a lock. Suppose <em>(Property L) </em>If<em> |locked(p)&gt;0 </em>then<em> a|Running(p) = Running(p)</em> and <em>a|RequestWakeup(p,e) &gt;= |RequestWakeup(p,e)</em>.  That is,  the lock prevents a running process from not running and prevents events from clearing requests -but we can make a process not-runnable while it holds the lock. Redefine RequestOrder to watch the lock.
<ul>
<li><em>a|RequestOrder(p) =</em></li>
<li><em>errror<br />
</em></p>
<ul>
<li><em>if  a|Locked(p) &lt;|Locked(p) and RequestOrder(p) != (Ready or Idle)</em></li>
<li><em>or if a|Runnable(p) &lt;|Runnable(p) and RequestOrder(p) != ready<br />
</em></li>
</ul>
</li>
<li><em>locked</em> otherwise if <em>|RequestOrder(p) = idle</em> and <em>a|Locked(p) &gt; |Locked(p) </em>.</li>
<li><em>requesting</em>  otherwise if  <em>|RequestOrder(p)=locked and a|RequestWakeup(p,e)&gt;|RequestWakeup(p,e)</em> for some <em>e</em><em> </em></li>
<li><em>ready</em> otherwise if <em> a|Runnable(p)  &lt;  |Runnable(p) </em> and <em>|RequestOrder(p)=requesting</em></li>
<li><em>idle</em> otherwise   if <em> a|Locked(p)  &lt;  |Locked(p) </em> and <em>|RequestOrder(p)=ready</em></li>
<li><em>|RequestOrder(p) </em>otherwise.</li>
</ul>
</li>
</ul>
<ul>
<li>Given Property L, <em>|RequestOrder(p) != errror</em> does assure <em>|Safe(p)</em>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2007/10/more-on-missed-wakeup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speculation on modularity and information theory</title>
		<link>http://www.yodaiken.com/2006/06/speculation-on-odularity-and-information-theory/</link>
		<comments>http://www.yodaiken.com/2006/06/speculation-on-odularity-and-information-theory/#comments</comments>
		<pubDate>Thu, 15 Jun 2006 06:56:47 +0000</pubDate>
		<dc:creator>yodaiken</dc:creator>
				<category><![CDATA[embedded systems]]></category>
		<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://yodaiken.com/?p=44</guid>
		<description><![CDATA[One way of defining modules is by what engineers have to know. If a program X consists of components X1 &#8230; Xn then we can say Xi is a module if a programmer can modify it without learning &#8220;much&#8221; about &#8230; <a href="http://www.yodaiken.com/2006/06/speculation-on-odularity-and-information-theory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One way of defining modules is by what engineers have to know. If a program X consists of  components X1 &#8230; Xn then we can say Xi is a module if a programmer can modify it without learning &#8220;much&#8221; about any other module. A second, related measure can be in terms of information hiding &#8211; a module essentially encapsulates some data and exports interfaces for manipulating the data. This second definition seems quantifiable. Given a system state S, let Xi(S) be the state of component Xi &#8211; essentially all the data that  Xi in state S will use to go to the next state. We need for Xi(S) to be minimal &#8211; it must contain only information that Xi uses to compute next state &#8211; no extra information at all. For example, if we have a poorly designed component that is just a single variable with methods <tt>set variable </tt>and <tt>get variable </tt>then Xi(S) would just be the contents of the variable. Now if looking at Xj(S) for all the other components Xj would let us know which of the other components last wrote a value to Xi and what that value was, we could recreate Xi(S) from the other components. In other words, we would see that Xi hid nothing. If Xi did something as simple as guard its variable against values outside a certain range, then we could not recreate Xi(S) from the other Xj(S) states. In that case, Xi is modular in the information hiding sense. We could then look at Xi and see how many bits are needed to reproduce that range information outside of Xi. And that count of bits is, in a sense, the measure of &#8220;how modular&#8221; Xj can be considered to be.   And then maybe its worth doing the same exercise for the first definition of modularity.</p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2006/06/speculation-on-odularity-and-information-theory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microkernels and why academic OS research is boring</title>
		<link>http://www.yodaiken.com/2006/05/microkernels-and-why-academic-os-research-is-boring/</link>
		<comments>http://www.yodaiken.com/2006/05/microkernels-and-why-academic-os-research-is-boring/#comments</comments>
		<pubDate>Tue, 16 May 2006 04:52:31 +0000</pubDate>
		<dc:creator>yodaiken</dc:creator>
				<category><![CDATA[microkernel]]></category>
		<category><![CDATA[operating systems]]></category>
		<category><![CDATA[rtlinux]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://yodaiken.com/?p=38</guid>
		<description><![CDATA[Andy Tanenbaum writes a defense of microkernels that (1) misses the content of Linus Torvald&#8217;s critique, (2) ignores the most relevant paper on software development, David Parnas&#8217; Software Jewels paper, and (3) pretends RTLinux does not exist. The problem with &#8230; <a href="http://www.yodaiken.com/2006/05/microkernels-and-why-academic-os-research-is-boring/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Andy Tanenbaum <a title="tanenbaum note" href="http://www.cs.vu.nl/~ast/reliable-os/" onclick="pageTracker._trackPageview('/outgoing/www.cs.vu.nl/_ast/reliable-os/?referer=');">writes</a> a defense of microkernels that (1) misses the content of Linus Torvald&#8217;s critique, (2) ignores the most relevant paper on software development, David Parnas&#8217; <a title="software jewels" href="http://www.yodaiken.com/references/parnas-jewels.pdf">Software Jewels</a> paper, and (3) pretends RTLinux does not exist. The problem with microkernels is that <strong>they are not modular</strong> and the problem with all the &#8220;nearly ready for prime time&#8221; microkernels is that <strong>they are not real products</strong> and the problem with many new academic OS projects is that<strong> they don&#8217;t have much new in them</strong>.</p>
</p>
<p>Parnas asks why we don&#8217;t see more elegant, simple, kludge-free &#8220;jewels&#8221; in systems software and he, rather gently, explains the compatibility, time pressures, and other constraints that make &#8220;clean and lean&#8221; so elusive. Parnas is just too nice to hammer the point home. Anyone can write small fast clean operating system that doesn&#8217;t do anything useful. Over and over, researchers stumble on the discovery that as you add minor inessential feature after minor inessential feature (all in response to some importuning victim who actually needs to <strong>do</strong> something with your creation), you recreate the &#8220;bloat&#8221; that wasn&#8217;t  needed when your software didn&#8217;t do anything. In fact, the natural result of making a nice clean simple lean fast OS into something useful is the creation of another implementation of POSIX. VMS and then Windows NT are very POSIX like, despite the intentions of the designers and so is Mach in OS-X and so are many traditional RTOSs. After all this time, this should not be so surprising anymore.</p>
</p>
<p>Linus Torvald&#8217;s <a title="torvalds" href="http://www.realworldtech.com/forums/index.cfm?action=detail&amp;id=66630&amp;threadid=66595&amp;roomid=11" onclick="pageTracker._trackPageview('/outgoing/www.realworldtech.com/forums/index.cfm?action=detail_amp_id=66630_amp_threadid=66595_amp_roomid=11&amp;referer=');">response</a> to Tanenbaum is pretty clear, but Tanenbaum misses the point:</p>
<blockquote><p>Linus also made the point that shared data structures are a good idea. Here we disagree. If you ever took a course on operating systems, you no doubt remember how much time in the course and space in the textbook was devoted to mutual exclusion and synchronization of cooperating processes. When two or more processes can access the same data structures, you have to be very, very careful not to hang yourself. It is exceedingly hard to get this right, even with semaphores, monitors, mutexes, and all that good stuff.</p></blockquote>
</p>
<blockquote><p>My view is that you want to avoid shared data structures as much as possible. Systems should be composed of smallish modules that completely hide their internal data structures from everyone else. They should have well-defined &#8216;thin&#8217; interfaces that other modules can call to get work done. That&#8217;s what object-oriented programming is all about&#8211;hiding information&#8211;not sharing it. I think that hiding information (a la <a href="http://en.wikipedia.org/wiki/David_Parnas" onclick="pageTracker._trackPageview('/outgoing/en.wikipedia.org/wiki/David_Parnas?referer=');">Dave Parnas</a>) is a good idea.</p></blockquote>
</p>
<p>And this gets both Torvalds and Parnas wrong. Information hiding is only good design when the hidden information is not needed by the software it is hidden from! If you hide information that you need to share you&#8217;re just wasting time. A great example of real modularity is the splitting off of the command interpreter (first in CTSS (corrected)) from the kernel. This split is possible because the designers recognized that there is very little information exchange between kernel and interpreter. An example of a fake module is the attempt of most microkernels to split virtual memory paging and storage caching. The most elegant and efficient message passing interface that can be imagined cannot fix the problem that too much information must be shared to make the resulting monstrosity run properly. Here&#8217;s Torvalds</p>
<blockquote><p><font>The fundamental result of access space separation is that you can&#8217;t share data structures. That means that you can&#8217;t share locking, it means that you must copy any shared data, and that in turn means that you have a much harder time handling coherency. All your algorithms basically end up being <em>distributed</em> algorithms.</font></p></blockquote>
</p>
<p>And Tanenbaum&#8217;s response is that sharing data structures is hard! Well, yeah &#8211; many engineering systems are complicated and hard to do right. During the 30 years of development of CTSS, Multics, UNIX, Plan9, and Linux, many components were split off into modules. What remains cannot be broken into decoupled parts in any obvious way. Let no man or woman split what Dennis and Ken have wrought without a damn good reason. Until the hardware changes or someone discovers something <strong>new</strong> about software structure in operating systems, complaining that this kernel model is complicated seems as useful as complaining that petroleum refineries are too big and filled with chemicals. <img height="150" src="http://www.yodaiken.com/images/belljournal.jpg"/>The POSIX model is a high performing engineering design &#8211; it works well and it is just perverse to assume its success is due only to the ineptness of everyone else.</p>
</p>
<p>It would be very interesting to study a production operating system like Linux or Windows XP and try to discover hidden modularity &#8211; functions that appear to not need to be bound to each other. Do such functions exist? Perhaps &#8211; one was discovered only a decade ago. The basis of RTLinux is the recognition that &#8220;real-time&#8221; can be separated from a time-sharing kernel and put into a module that can operate in a decoupled manner. The result was immediately useful but RTCore, the RTLinux real-time kernel, does not correspond to any of the traditional &#8220;modules&#8221; advocated by microkernelistas. There is no reason to suppose more such unconventional modules cannot be found. If we keep going back to the same boring list of &#8220;modules&#8221; that are familiar to generations of students forced to look at that ridiculous layer cake picture of an operating system, however, we&#8217;ll keep getting the same lack of results and the same &#8220;almost as fast as, almost complete&#8221; projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.yodaiken.com/2006/05/microkernels-and-why-academic-os-research-is-boring/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

