Booting Process in TinyOS

In our programs we always be wiring in our configuration file Boot interface to MainC

component.Boot->MainC.Boot;

So from this MainC is the component which is providing the Boot Interface. But when you look at the code in the MainC component. You will find that Boot=RealMainP. It means whenever you call MainC.Boot it automatically goes to RealMainP.Boot.. It means that RealMainP  signals the event booted() of the Boot interface.

Now we will see what are the steps before it signals the booted() event of Boot interface.

Step1: Platform_bootstrap();
          call Scheduler.init();

Here he is initializing the scheduler so that any components can posts tasks and initializing all the other hardware related stuff.

Step2: call PlatformInit.init();
       while(call Scheduler.runNextTask());

Initializing the platform. Then spinning on the scheduler to check whether all the tasks are completed. If all the  tasks are completed runNextTask() will return FALSE .

Step3: call SoftwareInit.init();
          while(call Scheduler.runNextTask());

Initializing the software and waiting until all the tasks to complete by spinning on the scheduler. If no tasks remain it means that the system has successfully booted.

Step4: __nesc_enable_interrupts();
        signal Boot.booted();

   Enabling Interrupts and signal the booted event that the system has successfully booted.

So RealMainP component will signal the booted() event after initializing the scheduler,platform,software and enabling the interrupts....

Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto