[Tinyos Core WG] Boot Order

Philip Levis pal at cs.stanford.edu
Wed May 21 16:00:18 PDT 2008


On May 21, 2008, at 3:15 PM, David Moss wrote:

> I’ve run into this problem several times now, so I wanted to bounce  
> an idea off you guys.
>
> The problem is I have an application that consists of many, many sub- 
> systems and components.  The sub-systems work fine when they are  
> separated, but integrating them together can cause problems with the  
> order they are started.
>
> Specifically, the problem is with Boot.booted().  There’s a single  
> event signaled out to fire up the entire system, but the fan-out  
> here is dependent upon the order in which I pull in components  
> within a configuration.  If my main configuration lists all of the  
> components that comprise the system in a certain order, and those  
> components all use Boot.booted() to startup, the order that their  
> booted() events get signaled is dependent upon the order I listed  
> them.  In fact, by changing the order in which components are called  
> out in a configuration file, the entire behavior of the system could  
> change because something started up before a sub-system it is  
> dependent upon.  Sometimes these types of integration issues are  
> nearly impossible to debug.
>
> A good example of this boot order behavior is loading variables from  
> non-volatile memory. I have a component that reads from internal  
> microcontroller memory to instantiate variables within other modules  
> in the system.  This component has to boot() before the rest of the  
> system tries to start and access those variables.  My solution in  
> the past was to add a custom init() command to MainC to start this  
> non-volatile configuration module before the rest of the system.

This was exactly the intent of SoftwareInit. Unless you need to access  
those variables in Init, at which point you could push your non- 
volatile into PlatformInit. What makes this approach unattractive?

Phil


More information about the Tinyos-2.0wg mailing list