[Tinyos-beta-commits] CVS: tinyos-1.x/beta/teps/html tep107.html, NONE, 1.1

Ion Yannopoulos ion- at users.sourceforge.net
Mon Jan 31 15:25:01 PST 2005


Update of /cvsroot/tinyos/tinyos-1.x/beta/teps/html
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30703/html

Added Files:
	tep107.html 
Log Message:
HTML version.


--- NEW FILE: tep107.html ---
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.3.7: http://docutils.sourceforge.net/" />
<title>Boot Sequence</title>
<meta name="author" content="Philip Levis" />
<style type="text/css">

/*
:Author: David Goodger
:Contact: goodger at users.sourceforge.net
:date: $Date: 2005/01/31 23:24:59 $
:version: $Revision: 1.1 $
:copyright: This stylesheet has been placed in the public domain.

Default cascading style sheet for the HTML output of Docutils.
*/
body {
  font-family: Times;
  font-size: 16px;
}

.first {
  margin-top: 0 ! important }

.last {
  margin-bottom: 0 ! important }

.hidden {
  display: none }

a.toc-backref {
  text-decoration: none ;
  color: black }

blockquote.epigraph {
  margin: 2em 5em ; }

dd {
  margin-bottom: 0.5em }

/* Uncomment (& remove this text!) to get bold-faced definition list terms
dt {
  font-weight: bold }
*/

div.abstract {
  margin: 2em 5em }

div.abstract p.topic-title {
  font-weight: bold ;
  text-align: center }

div.attention, div.caution, div.danger, div.error, div.hint,
div.important, div.note, div.tip, div.warning, div.admonition {
  margin: 2em ;
  border: medium outset ;
  padding: 1em }

div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title {
  color: red ;
  font-weight: bold ;
  font-family: sans-serif }

div.hint p.admonition-title, div.important p.admonition-title,
div.note p.admonition-title, div.tip p.admonition-title,
div.admonition p.admonition-title {
  font-weight: bold ;
  font-family: sans-serif }

div.dedication {
  margin: 2em 5em ;
  text-align: center ;
  font-style: italic }

div.dedication p.topic-title {
  font-weight: bold ;
  font-style: normal }

div.figure {
  margin-left: 2em }

div.footer, div.header {
  font-size: smaller }

div.line-block {
  display: block ;
  margin-top: 1em ;
  margin-bottom: 1em }

div.line-block div.line-block {
  margin-top: 0 ;
  margin-bottom: 0 ;
  margin-left: 1.5em }

div.sidebar {
  margin-left: 1em ;
  border: medium outset ;
  padding: 0em 1em ;
  background-color: #ffffee ;
  width: 40% ;
  float: right ;
  clear: right }

div.sidebar p.rubric {
  font-family: sans-serif ;
  font-size: medium }

div.system-messages {
  margin: 5em }

div.system-messages h1 {
  color: red }

div.system-message {
  border: medium outset ;
  padding: 1em }

div.system-message p.system-message-title {
  color: red ;
  font-weight: bold }

div.topic {
  margin: 2em }

h1 {
  font-family: Arial, sans-serif;
  font-size: 20px;
}

h1.title {
 text-align: center;
 font-size: 32px;
}

h2 {
 font-size: 16px;
 font-family: Arial, sans-serif;
}

h2.subtitle {
  text-align: center }

hr {
  width: 75% }

ol.simple, ul.simple {
  margin-bottom: 1em }

ol.arabic {
  list-style: decimal }

ol.loweralpha {
  list-style: lower-alpha }

ol.upperalpha {
  list-style: upper-alpha }

ol.lowerroman {
  list-style: lower-roman }

ol.upperroman {
  list-style: upper-roman }

p.attribution {
  text-align: right ;
  margin-left: 50% }

p.caption {
  font-style: italic }

p.credits {
  font-style: italic ;
  font-size: smaller }

p.label {
  white-space: nowrap }

p.rubric {
  font-weight: bold ;
  font-size: larger ;
  color: maroon ;
  text-align: center }

p.sidebar-title {
  font-family: sans-serif ;
  font-weight: bold ;
  font-size: larger }

p.sidebar-subtitle {
  font-family: sans-serif ;
  font-weight: bold }

p.topic-title {
  font-weight: bold }

pre.address {
  margin-bottom: 0 ;
  margin-top: 0 ;
  font-family: serif ;
  font-size: 100% }

pre.line-block {
  font-family: serif ;
  font-size: 100% }

pre.literal-block, pre.doctest-block {
  margin-left: 2em ;
  margin-right: 2em ;
  background-color: #eeeeee }

span.classifier {
  font-family: sans-serif ;
  font-style: oblique }

span.classifier-delimiter {
  font-family: sans-serif ;
  font-weight: bold }

span.interpreted {
  font-family: sans-serif }

span.option {
  white-space: nowrap }

span.option-argument {
  font-style: italic }

span.pre {
  white-space: pre }

span.problematic {
  color: red }

table {
  margin-top: 0.5em ;
  margin-bottom: 0.5em }

table.citation {
  border-left: solid thin gray ;
  padding-left: 0.5ex }

table.docinfo {
  margin: 2em 4em;
}

table.footnote {
  border-left: solid thin black ;
  padding-left: 0.5ex }

td, th {
  padding-left: 0.5em ;
  padding-right: 0.5em ;
  vertical-align: top }

th.docinfo-name, th.field-name {
  font-weight: bold ;
  text-align: left ;
  white-space: nowrap;
  }

h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
  font-size: 100% }

tt {
  background-color: #eeeeee }

ul.auto-toc {
  list-style-type: none }

</style>
</head>
<body>
<div class="document" id="boot-sequence">
<h1 class="title">Boot Sequence</h1>
<table class="docinfo" frame="void" rules="none">
<col class="docinfo-name" />
<col class="docinfo-content" />
<tbody valign="top">
<tr class="field"><th class="docinfo-name">TEP:</th><td class="field-body">107</td>
</tr>
<tr class="field"><th class="docinfo-name">Group:</th><td class="field-body">Core Working Group</td>
</tr>
<tr class="field"><th class="docinfo-name">Type:</th><td class="field-body">Documentary</td>
</tr>
<tr><th class="docinfo-name">Status:</th>
<td>Draft</td></tr>
<tr class="field"><th class="docinfo-name">TinyOS-Version:</th><td class="field-body">2.x</td>
</tr>
<tr><th class="docinfo-name">Author:</th>
<td>Philip Levis</td></tr>
<tr class="field"><th class="docinfo-name">Draft-Created:</th><td class="field-body">10-Dec-2004</td>
</tr>
<tr class="field"><th class="docinfo-name">Draft-Version:</th><td class="field-body">1.1</td>
</tr>
<tr class="field"><th class="docinfo-name">Draft-Modified:</th><td class="field-body">2005-01-20</td>
</tr>
<tr class="field"><th class="docinfo-name">Draft-Discuss:</th><td class="field-body">TinyOS-2.0 Working Group list &lt;tinyos-2.0wg at mail.millenium.berkeley.edu&gt;</td>
</tr>
</tbody>
</table>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last">This memo documents a part of TinyOS for the TinyOS Community, and
requests discussion and suggestions for improvements.  Distribution
of this memo is unlimited. This memo is in full compliance with
TEP 1.</p>
</div>
<div class="section" id="abstract">
<h1><a name="abstract">Abstract</a></h1>
<p>This memo documents the structure and implementation of the mote
boot sequence in TinyOS 2.x.</p>
</div>
<div class="section" id="introduction">
<h1><a name="introduction">1. Introduction</a></h1>
<p>TinyOS has a set of calling conventions and semantics in its boot
sequence. Earlier versions of TinyOS used an interface named
&quot;StdControl&quot; to take care of system initialization and starting
required software systems. Experience with several hardware platforms
showed StdControl to be insufficient, as it provided only a
synchronous interface. Additionally, StdControl bundled the notion of
initialization, which happens only at boot, with power management and
service control. TinyOS 2.x solves these problems by separating what
was once StdControl into three separate interfaces: one for
initialization, one for starting and stopping components, and one for
notification that the mote has booted. This memo describes the TinyOS
boot sequence and reasons for its semantics.</p>
</div>
<div class="section" id="tinyos-1-x-boot-sequence">
<h1><a name="tinyos-1-x-boot-sequence">2. TinyOS 1.x Boot Sequence</a></h1>
<p>The TinyOS 1.x boot sequence is uniform across most mote platforms
(TOSSIM has a very different boot sequence, as it is a PC
program). The module RealMain implements main(), and has the following
signature:</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">module</span> <span class="pre">RealMain</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">uses</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">command</span> <span class="pre">result_t</span> <span class="pre">hardwareInit();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">StdControl;</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Pot;</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<p>The mote main() function uses a mix of nesC and C:</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">int</span> <span class="pre">main()</span> <span class="pre">__attribute__</span> <span class="pre">((C,</span> <span class="pre">spontaneous))</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">hardwareInit();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">Pot.init(10);</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">TOSH_sched_init();</span></tt></div>
<div class="line">``     ``</div>
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">StdControl.init();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">StdControl.start();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">__nesc_enable_interrupt();</span></tt></div>
<div class="line">`` ``</div>
<div class="line"><tt class="docutils literal"><span class="pre">while(1)</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">TOSH_run_task();</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<p>Several problems exist. Some of these calls are artifacts of old
platforms: the Pot component refers to the mica variable potentiometer
for controlling radio transmission power, and for other platforms is a
stub component Some of the calls -- TOSH_sched_init and TOSH_run_task
-- are C functions that are implemented in other, automatically
included files. Separation from the nesC component model makes
changing what lies behind these functions more difficult than normal
in TinyOS.</p>
<p>More importantly, the initialization sequence has several
limitations. The component HPLInit implements the hardwareInit command
(wired by the component Main): hardware initialization may not be part
of a pure HPL layer. The scheduler is initialized after hardware,
which means that no hardware initialization can post a task if it
needs one. The StdControl interface combines component initialization
(init()) and activation (start()/stop()); if a component needs to be
initialized by RealMain, it must also be started. Separating these two
leads to more flexible power management, and distinguishes required
low-level components that must always be running (such as a Timer)
from high level components that requires (such as an
application). Finally, some components that need to often need to be
started by main, such as a radio, do not follow a synchronous
start/stop model. In this case, some components can't operate properly
until the radio starts, but main has no mechanism for waiting for the
radio start completion event.</p>
</div>
<div class="section" id="tinyos-2-x-boot-interfaces">
<h1><a name="tinyos-2-x-boot-interfaces">3. TinyOS 2.x Boot Interfaces</a></h1>
<p>The TinyOS 2.x boot sequence uses three interfaces:</p>
<blockquote>
o Initialize, for initializing component/hardware state
o Scheduler, for initializing and running tasks
o Boot, for signalling that the system has successfully booted</blockquote>
<p>The Initialize interface has a single command, init():</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Initialization</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">command</span> <span class="pre">error_t</span> <span class="pre">init();</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<p>It provides a synchronous interface, enabling initialization
ordering. Unlike normal execution, in which operations from a wide
range of components need to be interleaved effectively, initialization
is a sequential, synchronous operation: no component can be started
until initialization is complete. If a particular component's
initialization requires waiting for interrupts or other asynchronous
events, then it must explicitly wait for them (e.g., by sleeping or
with a spin loop), and not return until complete. Otherwise the system
may start before initialization is complete.</p>
<p>The Scheduler interface is for initializing and controlling task
execution. It is detailed in TEP 106[tep106].</p>
<p>The Boot interface has a single event, booted(), which the boot
sequence signals when it has completed.</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Boot</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">event</span> <span class="pre">void</span> <span class="pre">booted();</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
</div>
<div class="section" id="tinyos-2-x-boot-sequence">
<h1><a name="tinyos-2-x-boot-sequence">4. TinyOS 2.x Boot Sequence</a></h1>
<p>The module RealMain implements the standard TinyOS 2.x boot sequence.
The configuration Main wires some of RealMain's interfaces to
components that imlpement standard abstractions and exports the
others that are application specific.</p>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">module</span> <span class="pre">RealMain</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">provides</span> <span class="pre">interface</span> <span class="pre">Booted;</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">uses</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Scheduler;</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Initialize</span> <span class="pre">as</span> <span class="pre">PlatformInit;</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">interface</span> <span class="pre">Initialize</span> <span class="pre">as</span> <span class="pre">SoftwareInit;</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">implementation</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">int</span> <span class="pre">main()</span> <span class="pre">__attribute__</span> <span class="pre">((C,</span> <span class="pre">spontaneous))</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">Scheduler.init();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">__nesc_enable_interrupts();</span></tt></div>
<div class="line">`` ``</div>
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">PlatformInit.init();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">while(call</span> <span class="pre">Scheduler.runNextTask(FALSE));</span></tt></div>
<div class="line">`` ``</div>
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">SoftwareInit.init();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">while(call</span> <span class="pre">Scheduler.runNextTask(FALSE));</span></tt></div>
<div class="line">`` ``</div>
<div class="line"><tt class="docutils literal"><span class="pre">signal</span> <span class="pre">Boot.booted();</span></tt></div>
<div class="line"><tt class="docutils literal"><span class="pre">while(1)</span> <span class="pre">{</span></tt></div>
<div class="line-block">
<div class="line"><tt class="docutils literal"><span class="pre">call</span> <span class="pre">Scheduler.runNextTask(TRUE);</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
<div class="line"><tt class="docutils literal"><span class="pre">}</span></tt></div>
</div>
</div>
<div class="section" id="author-s-address">
<h1><a name="author-s-address">5. Author's Address</a></h1>
<div class="line-block">
<div class="line">Philip Levis</div>
<div class="line">467 Soda Hall</div>
<div class="line">UC Berkeley</div>
<div class="line">Berkeley, CA 94720</div>
<div class="line"><br /></div>
<div class="line">phone - +1 510 290 5283</div>
<div class="line"><br /></div>
<div class="line">email - <a class="reference" href="mailto:pal&#64;cs.berkeley.edu">pal&#64;cs.berkeley.edu</a></div>
</div>
</div>
<div class="section" id="citations">
<h1><a name="citations">6. Citations</a></h1>
<table class="docutils citation" frame="void" id="rst" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a name="rst">[rst]</a></td><td>reStructuredText Markup Specification. &lt;<a class="reference" href="http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html">http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html</a>&gt;</td></tr>
</tbody>
</table>
</div>
</div>
</body>
</html>



More information about the Tinyos-beta-commits mailing list