]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - doc/txt/tep107.txt
Update tos-bsl for win32 python
[tinyos-2.x.git] / doc / txt / tep107.txt
index 221a8aa11d880930ace89a600a4e36e786f9a518..18465422927bf61197593ea1d222638e682c6809 100644 (file)
@@ -5,15 +5,10 @@ TinyOS 2.x Boot Sequence
 :TEP: 107
 :Group: Core Working Group 
 :Type: Documentary
-:Status: Draft
+:Status: Final
 :TinyOS-Version: 2.x
 :Author: Philip Levis 
 
-:Draft-Created: 10-Dec-2004
-:Draft-Version: $Revision$
-:Draft-Modified: $Date$
-:Draft-Discuss: TinyOS Developer List <tinyos-devel at mail.millennium.berkeley.edu>
-
 .. Note::
 
    This memo documents a part of TinyOS for the TinyOS Community, and
@@ -162,6 +157,7 @@ Layer (TEP 2) SHOULD wire to MainC and not RealMainP::
   implementation {
     int main() __attribute__ ((C, spontaneous)) {
       atomic {
+        platform_bootstrap();
         call Scheduler.init();
         call PlatformInit.init();
         while (call Scheduler.runNextTask());
@@ -198,8 +194,18 @@ operations besides those which are absolutely necessary for further code,
 such as scheduler initialization, to execute.
 Examples of platform_bootstrap() operations are configuring the memory
 system and setting the processor mode. Generally, platform_bootstrap() 
-is an empty function. The platform_bootstrap() function SHOULD be
-specified in a platform's ``hardware.h`` file. 
+is an empty function. TinyOS's top-level include file, ``tos.h``, includes
+a default implementation of this function which does nothing. If a platform
+needs to replace the default, it SHOULD put it in a platform's
+``platform.h`` file as a #define. The implementation of ``tos.h`` 
+supports this::
+
+  /* This platform_bootstrap macro exists in accordance with TEP
+     107. A platform may override this through a platform.h file. */
+  #include <platform.h>
+  #ifndef platform_bootstrap
+  #define platform_bootstrap() {}
+  #endif
 
 The boot sequence has three separate initializations: Scheduler,
 PlatformInit, and SoftwareInit. The boot configuration (MainC) wires
@@ -237,9 +243,7 @@ hardware, the sequence is platform-specific. A port of TinyOS to a
 new plaform MUST include a component PlatformC which provides
 one and only one instance of the Init interface.
 
-Generally, component intialization occurs through SoftwareInit.
-PlatformInit is for a small subset of initializations whose properties
-requires that they be performed separately. Initializations invoked
+Initializations invoked
 through PlatformC meet some or all of the following criteria:
 
 1. The initialization requires configuring hardware resources. This implies that the code is platform-specific.