<?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>Observations from Uppsala &#187; embedded</title>
	<atom:link href="http://jakob.engbloms.se/archives/category/embedded/feed" rel="self" type="application/rss+xml" />
	<link>http://jakob.engbloms.se</link>
	<description>Computer Technology: Simulation, Virtualization, Virtual Platforms, Embedded, Multicore and Multiprocessing (by Jakob Engblom)</description>
	<lastBuildDate>Sun, 29 Jan 2012 19:45:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<image>
    <title>Observations from Uppsala</title>
    <url>http://jakob.engbloms.se/favicon.png</url>
    <link>http://jakob.engbloms.se</link>
    <width>32</width>
    <height>32</height>
    <description>Observations from Uppsala - http://jakob.engbloms.se</description>
    </image>		<item>
		<title>Keynote on System-Level Debug</title>
		<link>http://jakob.engbloms.se/archives/1568?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1568#comments</comments>
		<pubDate>Sun, 01 Jan 2012 20:12:33 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[appearances]]></category>
		<category><![CDATA[conferences]]></category>
		<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1568</guid>
		<description><![CDATA[I have now posted the slides from my keynote talk at the S4D 2011 conference to the presentations list on my regular home page. The topic of that talk was &#8220;System-Level Debug&#8221;, something which has started to interest me in recent years. Essentially, as the (embedded) software systems we are developing get more and more [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg"><img class="alignleft size-full wp-image-941" title="S4D" src="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg" alt="" width="143" height="62" /></a>I have now posted the slides from my keynote talk at the S4D 2011 conference to the <a href="http://www.engbloms.se/jakob_presentations.html">presentations list </a>on my regular home page. The topic of that talk was &#8220;System-Level Debug&#8221;, something which has started to interest me in recent years.</p>
<p><span id="more-1568"></span>Essentially, as the (embedded) software systems we are developing get more and more complex, we need to update our debuggers to keep up with the times. This means moving beyond looking at single processors, threads, programs, or even nodes &#8211; and making debuggers that support working with multiple contexts at once. For example, debugging a couple of different boards in a rack from a single debug session. This would mean supporting multiple processor architectures, execution modes, and operating systems inside a single debugger session. Debuggers need to orient themselves towards handling software that is already running in a target, rather than starting the target software. The debugger becomes more of a passive observer of the target system than an active component.</p>
<p>Take a look!</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1568"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1568" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1568" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1568/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My Bug Doesn&#8217;t Work!</title>
		<link>http://jakob.engbloms.se/archives/1489?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1489#comments</comments>
		<pubDate>Wed, 14 Sep 2011 03:27:07 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[bugs]]></category>
		<category><![CDATA[compilers]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[VxWorks]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1489</guid>
		<description><![CDATA[Every once in a while I need to build demo setups to show debugging in action. As I have blogged before, finding a good bug when you need one isn&#8217;t always easy.  The solution is to try to invent artificial bugs, and I was very happy when I managed to stage a buffer overrun in [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2009/10/butterfly.png"><img class="alignleft size-full wp-image-982" title="butterfly" src="http://jakob.engbloms.se/wp-content/uploads/2009/10/butterfly.png" alt="" width="90" height="91" /></a>Every once in a while I need to build demo setups to show debugging in action. As I have blogged before, <a href="http://jakob.engbloms.se/archives/975">finding a good bug when you need one isn&#8217;t always easy</a>.  The solution is to try to invent artificial bugs, and I was very happy when I managed to stage a buffer overrun in a VxWorks program.</p>
<p>It is pretty very nice demo in which you first start a period program A, which prints the value of an incrementing counter every target second.  You then run a supposedly unrelated program B, resulting in the values that program A prints to become corrupted.  Perfect to show off reverse execution and data breakpoints in reverse as you go from the point where the corrupted value is printed to the piece of code that overwrote the variable.</p>
<p>But then I ported the demo to a new platform&#8230; and the bug didn&#8217;t work anymore. My bug had caught a bug and was now not working, or at least not they way I expected it to. What had happened?<br />
<span id="more-1489"></span><br />
Very simple. I changed the compiler I used. Since my bug relied on an unspecified behavior in C, the change was totally valid and really expected.  Still, it was interesting to see how things played out&#8230; in the end, we got a different bug from the same code thanks to the change.</p>
<p>The code is essentially the following, with some simplifications that make it easier to read for those not familiar with VxWorks, and ignoring all the code to start tasks initially.</p>
<pre>// Global variables
int     iDataArray[100];
int     myWdISRcount;
WDOG_ID myWatchDogId;

// Periodic task - program A
void myWdISR(void)
{
  /* Increment ISR invocation count */
  myWdISRcount = myWdISRcount+1;
  printf("wd Fired %d times\n",myWdISRcount);

  /* Start off next invocation */
  wdStart (
    myWatchDogId,
    WD_INTERVAL,
    (FUNCPTR) myWdISR,
    (int) NULL
  );   
}

// Overwrite code - program B
int myCompletelySafeRoutine(void)
{
  uint32_t *a,i;
  a = iDataArray;   
  // This loop writes one word beyond the
  // limit of the iDataArray
  for (i=0; i&lt;=100; i++) {
     a[i] = 0x7fffffff;
   }   
   return OK;
}</pre>
<p>In the original setup, compiled for a Power Architecture target, iDataArray ended up right before myWdISRcount in memory.  Thus, the buffer overflow changed the value of the counter from something like 10 to 0x7fffffff.  Very noticeable in the printouts from the periodic task.</p>
<p>When I changed to an x86 target (using a compiler from the same family, but obviously with a different code generator since the target was different), the variable order in memory changed and it seems that we got iDataArray placed last.  Suddenly, the effect of running the safe code was that nothing happened at all.  A bit annoying for a demo.  Some small source-code changes and a recompile later, the effect was instead to crash the target with a triple fault (page fault inside a page fault handler). Seems the program now managed to corrupt some kernel state. While impressive as a bug, it was not quite what I was looking for.</p>
<p>I then changed the compiler type to compiler 2, and the data layout changed once more.  This produced a very useful bug, but it took me a while to actually understand this.  Now, when program B was run, program A stopped.  This looked like a bug in my program, and I actually started trying to fix this &#8211; until I realized that this was the bug I was looking for.  Running program B kills program A is just as good a bug as corrupting a counter value, after all.  In this case, the array overrun hits the myWatchDogId variable, and when that gets corrupted, the wdStart call ignores the request since it does not recognize the ID it gets.</p>
<p>So, in the end, I got a bug that was just as good as the first, and arguably a bit more intruiging. It is still obviously a contrived example &#8211; but I think that a good demo or lab exercise can be artificial as long as it gets the point across.  Judging from how people who have done the lab reacts, the goal seems to have been<br />
achieved.</p>
<p>The moral of the story is really that compilers are free to change things which are explicitly implementation-defined or not specified at all in the C standard. That is a good thing as it gives the compiler freedom to optimize the code. If you want to control how variables are laid out in memory, I guess you have to resort to linker scripts or similar &#8211; but that was too much pain for me in this case. Just changing things around until I got a good bug, and then freezing the binary (and not recompiling it ever again) is a sufficient strategy.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1489"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1489" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1489" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1489/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Software is Concrete &#8211; is it?</title>
		<link>http://jakob.engbloms.se/archives/1411?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1411#comments</comments>
		<pubDate>Sat, 07 May 2011 20:13:30 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Robert Howe]]></category>
		<category><![CDATA[verum]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1411</guid>
		<description><![CDATA[I this quote: Software is Concrete. Once poured it becomes extremely difficult and very expensive to change. It comes from a blog post by Robert Howe, CEO of Verum, a company selling formal-methods-based and model-based programming tools. It does capture something of the phenomenon we all know: that software can be pretty darn hard to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/11/construct.png"><img class="alignleft size-full wp-image-1318" title="construct" src="http://jakob.engbloms.se/wp-content/uploads/2010/11/construct.png" alt="" width="96" height="96" /></a>I this quote:</p>
<blockquote><p><em>Software is Concrete. Once poured it becomes extremely difficult and very expensive to change.</em></p></blockquote>
<p>It comes from a <a href="http://community.verum.com/blog/veritas.aspx?post=%E2%80%9Csoft%E2%80%9D_in_software_is_an_illusion">blog post by Robert Howe, CEO of Verum</a>, a company selling formal-methods-based and model-based programming tools. It does capture something of the phenomenon we all know: that software can be pretty darn hard to change, once it has shipped and is in use. It fits well with the fact that the later bugs are found, the more expensive they are to fix.</p>
<p>But it also provoked quite a bit of opposition when I put the quote up on Facebook, and I have to agree that maybe not all is as simple as that blog makes it out to be.</p>
<p><span id="more-1411"></span>The main problem as I see it is that it compares the development of software to the construction phase of a bridge (or other civil engineering structure). When software development is really much more like the architecture and exploration work that goes on long before the bridge is starting to be built. The blog post recognizes this in a way, I admit that. But you cannot escape the feeling that the fundamental thinking behind it all is waterfall-based. It never says so, but it feels like that.</p>
<p>Which is a shame &#8211; I cannot see that there is any fundamental dichotomy between being iterative, agile, and changing things as requirements clarify, and using model-based development and formal methods.  The idea of model-based development is to program at a higher level of abstraction to get more efficiency. And programming at a higher level of abstraction fundamentally <em>supports</em> agile and iterative development, since the amount of &#8220;code&#8221; you must change is smaller. Model-based development ought to support drastic and quick changes to software just like modern dynamic programming languages and powerful frameworks support it. Add in some model checking to find important classes of bugs (like deadlocks and dead-end states) automatically, and you have a very agile programming environment.</p>
<p>In software development, I don&#8217;t think there needs to be a great step from design and architecture to implementation. It seems to be more gradual, you build code as you go along and ideas get more and more detailed, and slowly you get to something fairly concrete and indeed fixed. The trick is to make this process gradual and find issues early, so that they are cheap to fix.</p>
<p>Overall, it seems that software is more like clay than concrete. It slowly goes from soft to hard&#8230; but you have a chance to make changes during the process.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1411"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1411" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1411" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1411/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: VxWorks 64-bit using Simics</title>
		<link>http://jakob.engbloms.se/archives/1396?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1396#comments</comments>
		<pubDate>Fri, 25 Mar 2011 19:52:36 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[Wind River Blog]]></category>
		<category><![CDATA[64-bit]]></category>
		<category><![CDATA[Simics]]></category>
		<category><![CDATA[VxWorks]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1396</guid>
		<description><![CDATA[There is a new post at my Wind River blog, about how Simics was used to kick-start the development of the 64-bit version of VxWorks. It is an interesting example of how to use a virtual platform as a model of something much simpler and gentler than actual hardware systems. Tweet]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" />There is a new post at my Wind River blog, about how <a href="http://blogs.windriver.com/engblom/2011/03/kick-starting-an-os-port.html">Simics was used to kick-start the development of the 64-bit version of VxWorks</a>. It is an interesting example of how to use a virtual platform as a model of something much simpler and gentler than actual hardware systems.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1396"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1396" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1396" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1396/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Testing Integrated Software in Simulation</title>
		<link>http://jakob.engbloms.se/archives/1391?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1391#comments</comments>
		<pubDate>Sun, 13 Mar 2011 20:36:30 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[Wind River Blog]]></category>
		<category><![CDATA[control software]]></category>
		<category><![CDATA[NASA]]></category>
		<category><![CDATA[Toyota]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1391</guid>
		<description><![CDATA[There is a new post at my Wind River blog, about the testing on an integrated software stack in simulation. I base the discussion on the very interesting report about the Toyota &#8220;unintended acceleration&#8221; problems and the deep investigation into the control software of the affected vehicles performed by a NASA team (!). The report [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" />There is a new post at my Wind River blog, about the <a href="http://blogs.windriver.com/wind_river_blog/2011/03/integration-and-testing-the-integration.html">testing on an integrated software stack in simulation</a>. I base the discussion on the very interesting report about the Toyota &#8220;unintended acceleration&#8221; problems and the deep investigation into the control software of the affected vehicles performed by a NASA team (!). The report covers a lot of different tools, but also notes that about the only thing not done was to integrate the complete software stack in simulation.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1391"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1391" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1391" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1391/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Working Smarter, not Harder</title>
		<link>http://jakob.engbloms.se/archives/1380?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1380#comments</comments>
		<pubDate>Thu, 24 Feb 2011 13:16:19 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[virtual machines]]></category>
		<category><![CDATA[Wind River Blog]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1380</guid>
		<description><![CDATA[   ]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" />There is a new post at my Wind River blog, <a href="http://blogs.windriver.com/engblom/2011/02/working-faster-and-with-less-sweat.html">about how you can use a virtual platform to complete work faster</a>. Not by making the virtual platform execution of target code faster, but by optimizing the way you work and taking advantage of the features of a virtual platform.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1380"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1380" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1380" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1380/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Being Helpful or Being Correct?</title>
		<link>http://jakob.engbloms.se/archives/1366?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1366#comments</comments>
		<pubDate>Fri, 11 Feb 2011 08:12:23 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[Wind River Blog]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1366</guid>
		<description><![CDATA[   ]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" />There is a new post at my Wind River blog, about <a href="http://blogs.windriver.com/engblom/2011/02/being-helpful-or-simply-correct.html">warnings in virtual platforms</a>. It is an art to add good warnings to virtual platform models, and just being correct visavi the hardware behavior is not necessarily that helpful for a software developer. A virtual platform should warn about suspicious operations, even if they are technically &#8220;correct&#8221;.</p>
<p>I also have to apologize for the slow blogging in January of 2011. There was too much going on at work and quite a few days taking care of sick kids. Hopefully, the pace can improve going forward.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1366"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1366" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1366" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1366/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Iterative Hardware-Software Interface Design</title>
		<link>http://jakob.engbloms.se/archives/1356?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1356#comments</comments>
		<pubDate>Wed, 22 Dec 2010 19:00:10 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Wind River Blog]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1356</guid>
		<description><![CDATA[   ]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" />There is a new post at my Wind River blog, about <a href="http://blogs.windriver.com/engblom/2010/12/iterating-the-hardware-software-design.html">iterative hardware-software interface design</a>. It is a discussion with some examples of why hardware designers would do well to use virtual platforms to include software designers in the loop when designing new devices and their programming interfaces.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1356"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1356" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1356" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1356/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: &#8220;IMA on Simics&#8221;</title>
		<link>http://jakob.engbloms.se/archives/1304?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1304#comments</comments>
		<pubDate>Tue, 26 Oct 2010 13:00:25 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[computer simulation technology]]></category>
		<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[multicore software]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Wind River Blog]]></category>
		<category><![CDATA[Integrated Modular Avionics]]></category>
		<category><![CDATA[real-time]]></category>
		<category><![CDATA[Simics]]></category>
		<category><![CDATA[Tennessee Carmel-Veilleux]]></category>
		<category><![CDATA[wcet]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1304</guid>
		<description><![CDATA[I have a fairly lengthy new blog post at my Wind River blog. This time, I interview Tennessee Carmel-Veilleux, a Canadian MSc student who have done some very smart things with Simics. His research is in IMA, Integrated Modular Avionics, and how to make that work on multicore. I made some cocky comments about just [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png"><img class="alignleft size-full wp-image-1122" style="margin: 10px 5px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" /></a>I have a <a href="http://blogs.windriver.com/engblom/2010/10/interview-with-tennessee-carmel-veilleux.html">fairly lengthy new blog post </a>at my Wind River blog. This time, I interview <a href="http://www.tentech.ca/">Tennessee Carmel-Veilleux</a>, a Canadian MSc student who have done some very smart things with Simics. His research is in IMA, Integrated Modular Avionics, and how to make that work on multicore.</p>
<p><span id="more-1304"></span>I made some <a href="http://jakob.engbloms.se/archives/58">cocky comments about just how stupid the current implementations </a>of this idea are a few years ago, but in my discussions with Tennessee I have realized that things are not that simple. Essentially, you are caught between the structures and strictures of the certification agencies, and the complexity of the hardware with its many shared resources making predictability and programming very difficult.</p>
<p>It is a field which touches to my old work on WCET, but with a target system that is much less amenable to analysis. I still <a href="http://jakob.engbloms.se/archives/123">think it is a good idea to try to use seas of simple cores and separate work physically </a>rather than virtually, but that might be a battle that will never be won. If nothing else, even on a massive spatially-divided multicore device, there will be some shared resources that make life difficult when very low levels of jitter are tolerated.</p>
<p>Read the interview, and read Tennessee&#8217;s own blog &#8211; he has done some pretty cool things both in hardware, software, and virtual hardware.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1304"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1304" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1304" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Interesting Blog: &#8220;Embedded in Academia&#8221;</title>
		<link>http://jakob.engbloms.se/archives/1290?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1290#comments</comments>
		<pubDate>Thu, 14 Oct 2010 10:50:13 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[John Regehr]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1290</guid>
		<description><![CDATA[I  just found the blog of an old real-time researcher friend of mine, John Regehr at the University of Utah. It is at http://blog.regehr.org/ and covers a range of embedded topics relevant to his academic research (which is more embedded that most). Tweet]]></description>
			<content:encoded><![CDATA[<p>I  just found the blog of an old real-time researcher friend of mine, John Regehr at the University of Utah.</p>
<p>It is at <a href="http://blog.regehr.org/">http://blog.regehr.org/</a> and covers a range of embedded topics relevant to his academic research (which is more embedded that most).</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1290"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1290" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1290" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1290/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>S4D 2010 Part 2</title>
		<link>http://jakob.engbloms.se/archives/1280?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1280#comments</comments>
		<pubDate>Sun, 19 Sep 2010 20:10:55 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[EDA]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Barry Lock]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Lauterbach]]></category>
		<category><![CDATA[S4D]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1280</guid>
		<description><![CDATA[My previous post on S4D did omit some of my notes from the conference. In particular, the very entertaining and serious keynote of Barry Lock from Lauterbach and some more philosophical observations on the nature of debugging. Barry Lock Barry lock gave a very entertaining keynote, from his viewpoint as essentially the champion of physical [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg"><img class="alignleft size-full wp-image-941" title="S4D" src="http://jakob.engbloms.se/wp-content/uploads/2009/09/S4D1.jpg" alt="" width="143" height="62" /></a>My <a href="http://jakob.engbloms.se/archives/1251">previous post on S4D </a>did omit some of my notes from the conference. In particular, the very entertaining and serious keynote of Barry Lock from Lauterbach and some more philosophical observations on the nature of debugging.</p>
<h3><span id="more-1280"></span>Barry Lock</h3>
<p>Barry lock gave a very entertaining keynote, from his viewpoint as essentially the champion of physical hardware debug. Lauterbach is clearly focused on debugging using hardware assists in real systems, with not much to do with high-level programming or virtual platforms. Barry has been working with computers longer than I have lived, and have seen both the semiconductor and software side of things.</p>
<p>His main message was that you have to take debuggability into account when buying chips for your embedded project. Saving a few cents by buying a chip with no or limited debug features will come back to haunt you, many times, in many nightmares. He had had grown men crying over the phone, asking for a miracle to save their projects after debugging had utterly failed for many months. He had seen startup companies go under, burning all their money chasing the last bug&#8230; and claimed that 75% of all product starts never got to market, blaming debug problems for a large proportion of that.</p>
<p>The most important debug feature is <em>trace </em>- which follows the theme of this being the S4D of trace. After trace, you want <em>hardware breakpoints</em>. Apparently, you need at least two to breakpoints to debug a system with a virtual memory RTOS. One to keep a look at the MMU, and one to actually debug code. More are better, but it is rare to see silicon vendors include many more breakpoints.</p>
<p>Barry gave  a number of examples of projects which had failed by not buying the right hardware. He put the blame both on the buyers chasing a few cents of costs in the end product, but also on the poor quality of silicon salespeople who rather took the price route than the quality route when selling chips.</p>
<p>He also noted that there seemed to be a positive correlation between industry leaders and buying debuggable hardware. Companies like Bosch, Ericsson, and Nokia always spend the extra money to get hardware that can be debugged, and have results to show for it.</p>
<h3>Philosophy of Debug</h3>
<p>During our two panel discussions on debug, there were two ways to look at debugging that stood out from the crowd.</p>
<p>The first was the observation that debugging today is very much a <em>craft</em>. When things go really bad, you go to the proven expert. Debugging is a craft you learn by apprenticeship with a master, and master debuggers are incredibly valuable for their organizations. This reliance on masters indicate that general programming education to a large extent overlooks debugging as a crucial skill for programmers. It also means that, in the words of one member of the audience, debug cannot scale. As problems become more complex, we still rely on single individuals, which reduces our ability to tackle problems.</p>
<p>The second observation was to liken debugging to the diagnosis of human diseases. As systems become more complex, their behavior gets so complicated and rich that it is hard to even precisely identify what a bug is. A simple crash or illegal operation is clear-cut &#8211; but when results of programs are just a bit off? When control loops don&#8217;t quite do the right thing, but almost? When the quality of a picture of a television just feels wrong? In those cases, we might be looking at composite measurements of many different parameters and factors in a system, and making a diagnosis of error based on the whole picture rather than each factor in isolation.</p>
<p>Based on these observations, I can envision a somewhat weird future where we train computer doctors (as in medical doctor, not PhD)  to diagnose computer problems based on holistic, systematic, approaches. Such education could be separate from the training of programmers and testers, as their specialty would be the diagnosis of system outputs against the expected outcomes at a high level, rather than the details of code.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1280"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1280" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1280" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1280/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Shiny Old Hardware</title>
		<link>http://jakob.engbloms.se/archives/1213?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1213#comments</comments>
		<pubDate>Fri, 20 Aug 2010 11:10:10 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[Wind River Blog]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1213</guid>
		<description><![CDATA[I just posted a blog post called &#8220;Shiny Old Hardware&#8221; at my Wind River blog. In it, I discuss why modeling old computer hardware to build virtual systems make sense. Virtual platforms are just not all about the next-generation stuff. Tweet]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png"><img class="alignleft size-full wp-image-1122" style="margin: 5px;" title="Wind River Logo" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" /></a>I just posted a blog post called &#8220;<a href="http://blogs.windriver.com/engblom/2010/08/shiny-old-hardware.html#more">Shiny Old Hardware</a>&#8221; at my Wind River blog. In it, I discuss why modeling old computer hardware to build virtual systems make sense. Virtual platforms are just not all about the next-generation stuff.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1213"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1213" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1213" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1213/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Worm Attacking Industrial Control Systems</title>
		<link>http://jakob.engbloms.se/archives/1200?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1200#comments</comments>
		<pubDate>Wed, 21 Jul 2010 19:18:13 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[SCADA]]></category>
		<category><![CDATA[Siemens]]></category>
		<category><![CDATA[USB]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[worm]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1200</guid>
		<description><![CDATA[There is a very interesting worm going around the world right now which is specifically targeting industrial control systems. According to Business Week, the worm is targeting a Siemens plant control system, probably with the intent to steal production secrets and maybe even information useful to create counterfeit products. This is the first instance I [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very interesting worm going around the world right now which is specifically targeting industrial control systems. According to <a href="http://www.businessweek.com/idg/2010-07-17/new-virus-targets-industrial-secrets.html">Business Week, </a>the worm is targeting a <a href="http://en.wikipedia.org/wiki/SCADA">Siemens plant control system</a>, probably with the intent to steal production secrets and maybe even information useful to create counterfeit products. This is the first instance I have seen of malware targeting the area of embedded systems. However, the actual systems targeted are not really embedded systems, but rather regular PCs running supervision and control software.</p>
<p><span id="more-1200"></span>There are two important aspects to this worm, as I see it.</p>
<p>First, it only works due to the fact that the software in question is running on regular Windows PCs.  An  attack on a real embedded OS like Wind River VxWorks or Enea OSE would  be more interesting, and much scarier since that would mean a much more devoted enemy. In this case, the attackers are opportunistic, using the window of vulnerability of a <a href="http://www.microsoft.com/technet/security/advisory/2286198.mspx">new Windows flaw </a>to attack Windows-based plant control systems. They also use <a href="http://blogs.technet.com/b/mmpc/archive/2010/07/16/the-stuxnet-sting.aspx">signed Windows drivers</a>, which is apparently a new development in malware. All quite interesting in its own right, and worth reading about for those interested in security.</p>
<p>Second, the malware spreads using physical movement of USB memory sticks rather than attacks over the Internet or other networks. This makes the very important point that even if systems are not connected to the Internet, they can still be attacked if something crosses the &#8220;<a href="http://en.wikipedia.org/wiki/Air_gap_%28computing%29">air gap</a>&#8221; that separates them from the outside world. In this case, a plant would be infected by using <a href="http://technet.microsoft.com/en-us/magazine/2008.01.securitywatch.aspx">social engineering to make some employee carry an infected USB stick </a>into the plant and putting it into some internal PC. Once the infection is inside the plant, it might spread over networks or by USB sticks moving around inside the presumably protected perimeter.</p>
<p>The lesson I think we can draw from this is that using general-purpose desktop operating systems for critical systems is a bad idea. Using a more obscure real-time OS (or even Linux) would probably reduce the number of vulnerabilities &#8211; but more importantly, it would make it much more difficult to make an infection hop from computer to computer until it reaches its target.</p>
<p>In this particular case, all Windows machines are potential bearers and spreaders of the infection. An attacker can rely on that fact to seed the Windows ecosystems at some place, hoping to get the infection hopping from machine to machine until it reaches something interesting. There is no real need to seed the infection directly into the target plant. If the target systems had been running a different OS, the attackers would have had to get really close to the target, making them easier to stop.</p>
<p>Overall, embedded systems security is something that we need to take much more seriously going forward. As we rely on embedded control systems to run much of the modern infrastructure and economy, we really need to be concerned about how to secure these systems. Security needs to be part of the architecture of embedded systems, including their operating systems (please make them as robust as possible), application designs, and networking systems. Unfortunately, current embedded technology tends to be designed to work, with little care for how they could be broken by an intentional attack. One scary example of this was provided in the <a href="http://www.grc.com/sn/sn-251.htm">SecurityNow podcast episode #251</a>, where a listener shows how easy it could be to take remote control over a car due to carelessly designed fleet management units.</p>
<p><em>Updated information</em></p>
<p>I found some more in-depth information on the issue at <a href="http://www.infoworld.com/d/security-central/siemens-warns-users-dont-change-passwords-after-worm-attack-915?page=0,0&amp;source=rss_security_central">Infoworld</a>. It notes that the software that is attacked is vulnerable since all installations use the same password to login &#8211; changing it is likely to break it. That is totally ridiculous as a security solution, period.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1200"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1200" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1200" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1200/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Poking Holes in Products</title>
		<link>http://jakob.engbloms.se/archives/1147?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1147#comments</comments>
		<pubDate>Mon, 14 Jun 2010 09:42:43 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[software testing]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1147</guid>
		<description><![CDATA[I recently started using a new mobile phone, a Blackberry Bold 9700. I am a bit ambivalent on some of its design features, but it is certainly a very different device from the much more friendly SonyEricsson I had before. Like anybody would do, I have been playing around with it to see what it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/06/happy-key.png"><img class="alignleft size-full wp-image-1148" style="margin: 5px 10px;" title="happy key" src="http://jakob.engbloms.se/wp-content/uploads/2010/06/happy-key.png" alt="" width="95" height="97" /></a>I recently started using a new mobile phone, a Blackberry Bold 9700. I am a bit ambivalent on some of its design features, but it is certainly a very different device from the much more friendly SonyEricsson I had before. Like anybody would do, I have been playing around with it to see what it can do and what not (notable things not working: the &#8220;AppWorld&#8221; application store is not available in Sweden, YouTube videos do not play in any way that I can figure out).</p>
<p>And almost inevitably, as you play around with a complex modern piece of software (which is what most of the phone is, after all), you find some <strong>obvious </strong>things which are just plain <strong>broken</strong>. You wonder, &#8220;why didn&#8217;t they think of this&#8221;, and &#8220;how could this ever escape testing?&#8221; My current best example is that the built-in web browser does not render the pages from Blackberry&#8217;s own support knowledgebase.</p>
<p><span id="more-1147"></span>This is something that they have control over from both sides, so the only reasonable explanation is that they just have not thought to test that site with the browser. It seems strange that  a new user would uncover such holes after a few hours, when presumably thousands of planned and spontaneous testing hours are being spent at Blackberry on each device they release.</p>
<p>To be fair, this is not a showstopper for me, it is just a good example of how users tend to poke holes in all modern software products. Blackberry is not unique in this regard, and I fully admit that the software that I have worked on over the years did not always fulfill the requirement of being bulletproof. There is a classic saying that if you think something is foolproof, you just haven&#8217;t found the right fool yet.</p>
<p>So what is this telling us about software development? I think the main lesson is that you need people who just use your product and do so creatively, as part of the development process. Software developers usually lack the destructive imagination necessary to really poke holes in what they have created, and are usually not given time to develop elaborate test cases.</p>
<p>The moment you put code into the hands of users, you can expect them to find &#8220;obvious&#8221; issues in your product &#8211; simply because their &#8220;normal&#8221; use is something you yourself never dreamt could happen. In my example, I presume that Blackberry assumed that people will use the support forum when their phones don&#8217;t work &#8211; and therefore not surf to them from a phone. Sounds reasonable, until you press on a bit and ask if someone might not look at a friend&#8217;s broken phone out in the field and need to search support&#8230; or check for solutions to non-fatal errors.</p>
<p>I guess the key lesson for me, one which I apply in my daily work, is that product management, marketing, or testing, has to work through use cases with the software they create. Really work them through, and when sidetrack ideas appear, follow through on them, not ignore them to focus on the main task at hand. We have to combine features, and do more than what&#8217;s in typical tutorials.</p>
<p>Feature combination is especially powerful, I still recall the sense of &#8220;aha&#8221; I got when as a PhD student I talked to some colleagues <a href="http://www.it.uu.se/research/publications/lic/2000-006/">researching the field of feature interaction</a>. It sounds like quite an interesting field, even though I am not sure how you could formally capture something that will generate the test case &#8220;read our support site using the phone browser&#8221;&#8230;</p>
<p>This post used to end in &#8220;I guess this counts as a software development rant&#8221;. Now, I classify this as a &#8220;tester&#8217;s lament&#8221;&#8230;</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1147"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1147" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1147" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1147/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Kindgarten Robot Videos Online</title>
		<link>http://jakob.engbloms.se/archives/1140?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1140#comments</comments>
		<pubDate>Sun, 06 Jun 2010 07:57:13 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Kindergarten]]></category>
		<category><![CDATA[lego]]></category>
		<category><![CDATA[MEPROM]]></category>
		<category><![CDATA[Mindstorms]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1140</guid>
		<description><![CDATA[I have now torn down the Kindergarten Robot, as I wanted to build some other things. However, before tearing it down, I did take a few more movies of its critical functions. The first movie is just the robot driving around using its MEPROM programming unit. I think this movie is slightly clearer than the [...]]]></description>
			<content:encoded><![CDATA[<p>I have now torn down the Kindergarten Robot, as I wanted to build some other things. However, before tearing it down, I did take a few more movies of its critical functions.</p>
<p><span id="more-1140"></span></p>
<p>The first movie is just the robot driving around using its MEPROM programming unit. I think this movie is slightly clearer than the old one I posted.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/0btgDZ7Pf-g&amp;hl=sv_SE&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/0btgDZ7Pf-g&amp;hl=sv_SE&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Next, here is how a program loop can be created in this system. By removing the white end marker from the program, the motor will just keep spinning the program until it spots a program step. This is a very mechanical infinite loop.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ngL9oxv5cds&amp;hl=sv_SE&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/ngL9oxv5cds&amp;hl=sv_SE&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Finally, we have the emergency stop bumper that was added to the robot to make it stop when it hits something. It does not take effect immediately due to the latencies involved in the NXT programming environment, but at least the robot does not proceed to the next programming step.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/AsLS9CNXc1g&amp;hl=sv_SE&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/AsLS9CNXc1g&amp;hl=sv_SE&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1140"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1140" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1140" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1140/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind River Blog: Simics Analyzer</title>
		<link>http://jakob.engbloms.se/archives/1137?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1137#comments</comments>
		<pubDate>Wed, 26 May 2010 19:40:42 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[multicore debug]]></category>
		<category><![CDATA[virtual platforms]]></category>
		<category><![CDATA[Wind River Blog]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1137</guid>
		<description><![CDATA[I have a new blog post up at the Wind River blog network, about the new target analysis tools in Simics 4.4. It is a very fun piece of technology to play with, and you learn a lot just by poking around at existing software systems&#8230; Tweet]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png"><img class="alignleft size-full wp-image-1122" style="margin: 5px 10px;" title="button-quicklink-blogs" src="http://jakob.engbloms.se/wp-content/uploads/2010/04/button-quicklink-blogs.png" alt="" width="46" height="46" /></a>I have a <a href="http://blogs.windriver.com/engblom/2010/05/analyzed.html">new blog post </a>up at the Wind River blog network, about the new target analysis tools in Simics 4.4. It is a very fun piece of technology to play with, and you learn a lot just by poking around at existing software systems&#8230;</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1137"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1137" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1137" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1137/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kindergarten Robot 3: Programming is Kid&#8217;s Play</title>
		<link>http://jakob.engbloms.se/archives/1103?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1103#comments</comments>
		<pubDate>Tue, 09 Mar 2010 16:40:25 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[Kindergarten]]></category>
		<category><![CDATA[lego]]></category>
		<category><![CDATA[MEPROM]]></category>
		<category><![CDATA[Mindstorms]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1103</guid>
		<description><![CDATA[Today I finally got to try my MEPROM-equipped Lego Mindstorms robot with a larger group of kids. As expected, this did not go quite as expected. It turned out that trying to show a group of ten impatient kids that the robot read instruction codes and moved accordingly failed. Using a chaser program, where the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/01/lego-mindstorms-nxt2.png"><img class="alignleft size-full wp-image-1057" style="margin: 5px 10px;" title="lego mindstorms nxt2" src="http://jakob.engbloms.se/wp-content/uploads/2010/01/lego-mindstorms-nxt2.png" alt="" width="146" height="126" /></a>Today I finally got to try my <a href="http://jakob.engbloms.se/archives/1086">MEPROM-equipped Lego Mindstorms robot </a>with a larger group of kids. As expected, this did not go quite as expected.</p>
<p><span id="more-1103"></span></p>
<p>It turned out that trying to show a group of ten impatient kids that the robot read instruction codes and moved accordingly failed. Using a chaser program, where the robot drove around waiting for something to show up close in front of it and then drove full speed forward to try to hit it, was much easier to appreciate.  Classics like driving around avoiding to hit walls was also just as much fun as ever. Like my previous attempts, the kids piled up on the robot and tried to make it turn the way they wanted.</p>
<p>Clearly, physical exercise is easier to sell than cerebral exercise.</p>
<p>That said, I did manage to get some more thoughtful kids interested in getting the robot to go particular places. The setup I used was to put the robot on a starting square marked on the floor, and then putting a red bucket out on the floor some distance away. The kids were asked to help me program the robot to either hit the bucket or drive around it. I explained what the robot did as taking steps forward and turning, and actually the approximately 50 cm long runs it did for each blue programming tile was fairly similar to a serious step by a five-year-old (some kids instead started tip-toeing forward, which did not quite provide the correct stride).</p>
<p>As a safety device and to retain a semblance on intelligence on the part of the robot, I equipped it with a bumper in front. As soon as the bumper is hit, the robot is supposed to say “stop” and stop all activities.</p>
<p>The problems we tried were:</p>
<ul>
<li>Put the bucket down in front and try to hit it, needing three forward to get there</li>
<li>Drive around said bucket, which required a program like blue, green, blue, yellow, blue, blue, yellow, blue, green (forward, right, forward, left, forward, forward, left, forward, right).</li>
<li>Leave the base and drive to the back instead of front.</li>
</ul>
<p>I sat down with a group of three kids who really got into this part (even with ten other kids running around playing cops and robbers at a very high level of intensity). They did get the idea and did propose steps towards the solution. However, it is clear that at least initially; one cannot expect them to plan out an entire program in their heads.</p>
<p>Rather, we ended up in a style quite familiar to anyone learning a new programming language or taking their first programming course. Try one step, see where it takes us, add another step or two to the program, and try again. Very much how I myself solve programming and scripting problems where I interact with a complex and possibly unpredictable environment. In this way, we did manage to solve some problems, and I do think the kids understood what was going on.</p>
<p>To me, I feel the idea of the Lego-programmable robot as a preschool-level programming course is at least partially proven. As in most other educational ventures, what is needed is a good overall teaching environment. Next time, I will have to try this with a small group of kids, just after they have had a snack so that they are alert and fresh. I will also make sure to break up the hard work with some simple play, since that is needed to keep the kids from being bored.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1103"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1103" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1103" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1103/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kindergarten Robot 2: Going Programmable</title>
		<link>http://jakob.engbloms.se/archives/1086?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1086#comments</comments>
		<pubDate>Sun, 21 Feb 2010 20:32:03 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[Kindergarten]]></category>
		<category><![CDATA[lego]]></category>
		<category><![CDATA[MEPROM]]></category>
		<category><![CDATA[Mindstorms]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1086</guid>
		<description><![CDATA[As discussed in my previous blog post about Kindergarten robots, I wanted to see if I can teach kids the core idea of programming. This project has now progressed to the point that I have a working prototype of a programmable robot. Essentially, the robot is programmed by putting colored Lego bricks in a sequence [...]]]></description>
			<content:encoded><![CDATA[<h2><img class="alignleft size-full wp-image-1057" style="margin: 5px;" title="lego mindstorms nxt2" src="http://jakob.engbloms.se/wp-content/uploads/2010/01/lego-mindstorms-nxt2.png" alt="lego mindstorms nxt2" width="146" height="126" /></h2>
<p>As discussed in my <a href="http://jakob.engbloms.se/archives/1079">previous blog post </a>about Kindergarten robots, I wanted to see if I can teach kids the core idea of programming. This project has now progressed to the point that I have a working prototype of a programmable robot.</p>
<p>Essentially,  the robot is programmed by putting colored Lego bricks in a sequence on  top of the robot. This should be accessible and direct enough to work  with kids &#8212; and with no computer needed, just direct physical interaction with  the system. For some reason, I think the extra level of abstraction from a screen to a robot is just an unnecessary obstacle at this level.</p>
<p><span id="more-1086"></span><br />
For an example run, see the <a href="http://www.youtube.com/watch?v=U-18jmUnGqU">Youtube video </a>linked below:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/U-18jmUnGqU&amp;hl=sv_SE&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/U-18jmUnGqU&amp;hl=sv_SE&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The robot is shown in the picture below. Since I use the same base as a fast chaser robot, it uses the large wheels from a <a href="http://www.brickset.com/detail/?Set=8284-1">Technic kit I happened to have around</a>, and a decent swiveling rear wheel. Using treads for the drive would probably have given me a bit more precision, but this is faster and simply feels more fun.</p>
<p><img class="aligncenter size-full wp-image-1089" title="P1110612" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/P1110612.JPG" alt="P1110612" width="550" height="491" /></p>
<p>The inspiration for the programming method came from the boardgame <a href="http://www.boardgamegeek.com/boardgame/18/roborally">Roborally</a>, where you are dealt a set of card with meanings like &#8220;forward&#8221;, &#8220;back&#8221;, &#8220;turn right&#8221;, &#8220;turn around&#8221;, etc., and have to make your robot navigate a hazardous landscape to get to a destination. In my kindergarten robot, I simplified the programming to just forward, left, and right. And there are no conveyor belts, lasers, pits, or other hazards on the field.</p>
<p>The program steps available are the following (the color sensor can only distinguish a few primary colors):</p>
<ul>
<li>Black &#8211; start bit</li>
<li>Blue &#8211; move forward</li>
<li>Green &#8211; turn right</li>
<li>Yellow &#8211; turn left</li>
<li>Red &#8211; honk the horn (beep)</li>
<li>White &#8211; stop bit</li>
</ul>
<p>As a programming language, this is definitely not Turing-complete and nothing that you could program anything useful with. In particular, the programming model lacks decision statements, loops, and variables. However, it conveys what I feel is at the heart of programming: obtaining a goal by putting together a sequence of very small and simple steps. If you cannot grasp the idea of many small steps, you will never be able to program in any meaningful way.</p>
<h2>User Testing</h2>
<p>I have not tested this with a group of kids yet, but only with myself and my five-year-old son. So far, it seems to work. After some initial confusion, he is starting to get the idea of putting steps in order and having the robot execute them.</p>
<p>Here are some very simple missions that can be used to get the programming thinking going:</p>
<ul>
<li>Turn around a corner (of the fridge in this case)</li>
<li>Move to hit a balloon lying on the floor some distance away</li>
<li>Move in a square pattern to get back where it started</li>
</ul>
<p>I am sure I will think of more as I go along. I will blog some more once I have more experience with the robot.</p>
<h2>Details of the Program Memory</h2>
<p>The major problem that had to be solved to build this robot was creating a working program memory. I have decided to call the program memory <strong>MEPROM</strong>, for &#8220;Mechanically Erasable Programmable Read-Only Memory&#8221;. It is a ROM, since the robot itself cannot change it.  Since you can both remove program steps and put in new steps using mechanical means (human hands, typically), it is definitely an M-EPROM.</p>
<p>The idea for the memory is simple: use Lego bricks to represent moves.  It took a while to come up with the current form, as there are many ways  to move colored bricks past a sensor.</p>
<p>Two of the program steps can be seen below: I used 3&#215;1 standard lego bricks (which I borrowed from my son&#8217;s Legos, since  it seems very hard to find good kits containing this particular type of brick):</p>
<p><img class="aligncenter size-medium wp-image-1087" title="P1110625" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/P1110625-300x210.jpg" alt="P1110625" width="300" height="210" /></p>
<p>To move these programming blocks past the color sensor in order to read them, I used some classic Lego treads (which seems to have been in use <a href="http://www.brickset.com/detail/?Set=856-1">since the late 1970s</a>!). Today, these can be best obtained by buying the <a href="http://http://www.brickset.com/detail/?Set=8259-1">Mini Bulldozer kit (8259)</a>. The program steps are put on alternate tread elements:</p>
<p><img class="aligncenter size-full wp-image-1088" title="P1110631" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/P1110631.JPG" alt="P1110631" width="550" height="405" /></p>
<p>The Mindstorms color sensor only sees six colors, as discussed above. Worse, it tends to see black in dark shadows. For this reason, it needs to read the bricks head-on to be reliable. I have tried in vain to make the system self-adjusting, so currently, the program start has to be manually aligning the start bit (black brick) in front of  the sensor. For the rest of the run, turning the driving motor 90 degrees reliably puts the next brick in place in front of the sensor.</p>
<p>The program turns out to be quite simple in the NXT programming environment. Turn program motor 90 degrees, sample the color sensor, and act accordingly using a &#8220;switch statement&#8221;:</p>
<p><a href="http://jakob.engbloms.se/wp-content/uploads/2010/02/Program.jpg"><img class="alignright size-medium wp-image-1090" title="Program" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/Program.jpg" alt="Program" width="550" /></a></p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1086"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1086" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1086" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1086/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Kindergarten Robot</title>
		<link>http://jakob.engbloms.se/archives/1079?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1079#comments</comments>
		<pubDate>Tue, 09 Feb 2010 20:16:50 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[appearances]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[teaching]]></category>
		<category><![CDATA[lego]]></category>
		<category><![CDATA[Mindstorms]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1079</guid>
		<description><![CDATA[One of my little projects while on parental leave has been to play around with my Lego Mindstorms NXT 2.0 robotics kit. Apart from being fun for a serious dad like myself, I always had in mind how I could use it with kids to get them interested in technology. When I was a PhD [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-1057" style="margin: 10px 5px;" title="lego mindstorms nxt2" src="http://jakob.engbloms.se/wp-content/uploads/2010/01/lego-mindstorms-nxt2.png" alt="lego mindstorms nxt2" width="146" height="126" />One of my little projects while on parental leave has been to play around with my Lego Mindstorms NXT 2.0 robotics kit. Apart from being fun for a serious dad like myself, I always had in mind how I could use it with kids to get them interested in technology.</p>
<p>When I was a PhD student in Uppsala back around 2000, we bought a pile of the Lego Mindstorms RCX kits, for use in real-time courses. Obviously, the students loved the opportunity to play with Lego (including the few females). What was less obvious and much more interesting was what happened when we brought in a bunch of children from a local kindergarten to visit &#8212; they really took a liking to our little yellow robots running around a classroom. They treated the robots as little animals, wondering what they were doing and why&#8230;</p>
<p>With that in mind, I decided to try to reprise this myself with my own son and his kindergarten friends. <img title="More..." src="../wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" />Last week, I took my robot kit with me and went to meet the kids.</p>
<p><span id="more-1079"></span>My top-level goal with exercise was really to get the kids interested in technology as a future field of study and venture&#8230; you have to start early to counteract the prevalent tendency of people to want to be famous and work in media or something&#8230; Only time will tell if this had any effect at all (I doubt it).</p>
<p>In addition to the top-level goal, I wanted to communicate some about how things work. Make technology more understandable and less magical, and more accessible. In particular:</p>
<ul>
<li>Autonomy: the robot is not under remote control, it acts autonomously based on its programming.</li>
<li>Sense-compute-actuate: the robot perceives the world and makes decisions that get sent to the motors.</li>
<li>Limited sensors: the robot does not see like we do, it uses far simpler sensing.</li>
<li>Programmability: the same physical setup can do a lot of different things just by switching to a different program.</li>
<li>Concurrency: the robot can do several unrelated things at once.</li>
<li>Stupidity: the robot is really dumb and just reacts very predictably to its environment.</li>
</ul>
<p>I think these points can be brought across using an indirect approach. You cannot tell a four-year-old about programmability. But you can show that if you go to the robot&#8217;s control unit and press some buttons it does something different.</p>
<p>Note that some of the points above are artificial, in that you could build much smarter programs with more complex behaviors and less direct reactions. But that would make things more magical and &#8220;human-like&#8221;, which is not what I wanted to communicate.</p>
<p>Anyway, in the end I used two configurations of a driving base, with a few different programs.</p>
<p>The first configuration is shown below, using a color sensor pointing downwards and an ultrasound sensor pointing forward.It also had a shooter pointing forward (in this picture, the organic styling of the <a href="http://bionicle.wikia.com/wiki/Zamor_Launcher">Lego Bionicle Zamor</a>-derived shooter comes across very nicely, as well as the apparently <a href="http://www.brickset.com/detail/?Set=8719-1">quite special silver- and gold-colored </a>balls I picked up on a sale).</p>
<p><img class="aligncenter size-full wp-image-1080" title="shooterbot" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/shooterbot.jpg" alt="shooterbot" width="500" height="620" /></p>
<p>First, I had this robot follow a black line on the floor. Putting the line down was fun, watching the robot follow the line did not work out as intended. Too hard to explain the algorithm for following the contrast between black and not-black. Adding the behavior to stop when the robot hit a red line was also too subtle.</p>
<p>Next, I tried to put the robot on a table with the program &#8220;stay within black lines&#8221;. Or rather &#8220;reverse and turn if you hit a black line&#8221;. Problem was that the table had a spotted pattern that included small specks of black, and the robot just kept doing avoidance maneuvers&#8230; so that failed. I still want to do a table-dancing robot, but I guess relying on an ultrasound sensor pointing downwards to detect the chasm at the edge will work better.</p>
<p>What was fun though was when I activated the ultrasound sensor and the shooter: the robot would crawl along the line, and if something got in the way, it would fire a ball. That was huge fun! All the kids crowded around to get the robot to shoot and collect the balls. Note for future attempts: dramatic actions are great!</p>
<p>It was even better when I set the robot to rove freely, using the ultrasound sensor to turn when something got in its way. This was an easy-to-understand behavior that the kids appreciated, putting feet and hands in the way of the robot to make it turn. The poor robot was often the center of a pile of kids that were all trying to make it turn.</p>
<p>I also tried a configuration using bumper sensors:</p>
<p><img class="aligncenter size-full wp-image-1081" title="bumberbot" src="http://jakob.engbloms.se/wp-content/uploads/2010/02/bumberbot.jpg" alt="bumberbot" width="500" height="375" />Here, the robot only had one program, to move forward until it hit something, and based on the side that hit, back up and turn to avoid hitting the same obstacle again. This was a very successful configuration. The kids started to play &#8220;don&#8217;t touch the robot&#8221; with it, having it drive between their legs or bending over the robot to make a bridge &#8211; but not touching it and making it turn.</p>
<p>Note that I did not bring any computer with me, all programs were preloaded on the NXT brick. Very handy, actually.</p>
<p>In summary, I had a great time doing this, and I will be back with new configurations and programs. Creating the programs was very quick and easy in the Mindstorms environment, proving the value of domain-specific programming.</p>
<p>The kids have hopefully learned that you can play with and control technology, and that you should not be too respectful. Maybe someone also picked up some of the ideas I presented at the start of this blog post.</p>
<h3>Gender-Theoretical Notes</h3>
<p>I do have to end with a slightly sad note.</p>
<p>It was surprising to me just how differently the boys and the girls reacted and behaved. I had assumed that kids would just be kids at this age (three to five years old), with no gender-related differences. It was very striking that this was not the case in reality. The boys just ran in and started playing, and very quite hard to get to listen to anything I had to say. The girls walked in and quietly waited for instructions, and took some warming-up before they would interact with the robot.</p>
<p>I cannot blame our kindergarten for this, they are definitely trying to avoid gender-based stereotypes.I guess it shows that fighting societal norms is just as hard as everyone says it is.</p>
<p>It was also interesting that the kids were surprised to see a parent build with Lego and have a great time. For some reason, that was not expected behavior from a dad. Sad too.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1079"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1079" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1079" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1079/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Neat Register Design to Avoid Races</title>
		<link>http://jakob.engbloms.se/archives/1070?&#038;owa_medium=feed&#038;owa_sid=</link>
		<comments>http://jakob.engbloms.se/archives/1070#comments</comments>
		<pubDate>Thu, 28 Jan 2010 18:59:53 +0000</pubDate>
		<dc:creator>Jakob</dc:creator>
				<category><![CDATA[embedded software]]></category>
		<category><![CDATA[embedded systeme]]></category>
		<category><![CDATA[ESL]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[64-bit computing]]></category>
		<category><![CDATA[device driver]]></category>
		<category><![CDATA[Gary Stringham]]></category>
		<category><![CDATA[high-level synthesis]]></category>
		<category><![CDATA[programming register]]></category>
		<category><![CDATA[race condition]]></category>

		<guid isPermaLink="false">http://jakob.engbloms.se/?p=1070</guid>
		<description><![CDATA[In his most recent Embedded Bridge Newsletter, Gary Stringham describes a solution to a common read-modify-write race-condition hazard on device registers accessed by multiple software units in parallel. Some of the solutions are really neat! I have seen the &#8220;write 1 clears&#8221; solution before in real hardware, but I was not aware of the other [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-589" style="margin: 5px 10px;" title="racecondition" src="http://jakob.engbloms.se/wp-content/uploads/2008/01/racecondition.png" alt="racecondition" width="99" height="78" />In his most recent <a href="http://garystringham.com/newsletter.shtml?nid=039">Embedded Bridge Newsletter</a>, Gary Stringham describes a solution to a common read-modify-write race-condition hazard on device registers accessed by multiple software units in parallel. Some of the solutions are really neat!</p>
<p>I have seen the &#8220;write 1 clears&#8221; solution before in real hardware, but I was not aware of the other two variants. The idea of having a &#8220;write mask&#8221; in one half of a 32-bit word is really clever.</p>
<p>However, this got me thinking about what the fundamental issue here really is.</p>
<p><span id="more-1070"></span></p>
<p>As I see it, it is the fact that the processor cannot address small enough units atomically. The <a href="http://garystringham.com/newsletter.shtml?nid=037">read-modify-write that was used to start the discussion in the Embedded Bridge #37</a> was needed in order to get the current state of a configuration register, change some setting that only occupied a few bits in it, and write back the result to the register. The way most configuration registers that I have seen in practice works.</p>
<p>But if each setting could be given its own register, the problem would go away. Each operation would target a unique address, achieving the same effect as the bit-wise masks or write-1 solutions proposed. The core problem is that hardware tends to share settings into registers, as it has been considered too expensive to put information that might cover a range as small as [0,1] into a 32-bit register. Probably, since there is a lack of addresses for registers, you cannot have 1000 settings cause each simple device to use up 1000 words of physical addresses.</p>
<p>But is that really an issue, if we look forward?</p>
<p>It seems to me that, as 64-bit instruction sets and addressing systems penetrate down into more and more embedded systems, a simple solution would be to throw address space at the problem. I don&#8217;t think it is uneconomical to allocate huge chunks of memory space to each device, giving each setting its own register, when you have 64 bit virtual addresses to work with. There is no way you can fill up a physical memory system (guess that will some day come back to haunt me)&#8230; even the highest-end machines today only use something like 40 bits for actually addressing physical memories.</p>
<p>The software would be simpler and more robust, with virtually no cost.</p>
<p>Another solution that I have also seen starting to appear is to dispense with register settings altogether, and rather define a command API that the processor &#8220;calls&#8221; by putting in command packets into some memory area. This does require quite a bit of silicon for a decoder, but it provides for a much higher level of interaction with devices. As hardware devices get defined in successively higher-level languages (C, C++, UML, MatLab, &#8230;), and <a href="http://jakob.engbloms.se/archives/871">their programming interfaces and associated drivers get autogenerated</a>, this solution makes eminent sense.</p>
<div class="simple_likebuttons_container_small">
      <div class="simple_likebuttons_googleplus">
        <g:plusone size="medium" count="false" href="http://jakob.engbloms.se/archives/1070"></g:plusone>
      </div>
    
      <div class="simple_likebuttons_twitter simple_likebuttons_twitter_s">
        <a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://jakob.engbloms.se/archives/1070" data-lang="en">Tweet</a>
      </div>
    
      <div class="simple_likebuttons_facebook">
        <div id="fb-root"></div>
        <script>(function(d, s, id) {
          var js, fjs = d.getElementsByTagName(s)[0];
          if (d.getElementById(id)) {return;}
          js = d.createElement(s); js.id = id;
          js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
          fjs.parentNode.insertBefore(js, fjs);
        }(document, "script", "facebook-jssdk"));</script>
        <div class="fb-like" data-href="http://jakob.engbloms.se/archives/1070" data-send="false" data-layout="button_count" data-show-faces="false" data-width="90"></div>
      </div>
    </div>]]></content:encoded>
			<wfw:commentRss>http://jakob.engbloms.se/archives/1070/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

