Saturday, May 10, 2014

Achieving Fast Boot in Statically built Applications

Strategy:

In domain specific applications such as Automotive where the system start-up needs to be achieved in few hundred millseconds, the application and boot-up sequence needs to be optimized in the following way.

Even though the binary will be one single image, the inner modules can be divided as follows and the corresponding Code, data and BSS sections of each functional module can be scattered and kept with separate sections each with some distinguished start and end symbols.

The boot can be divided into sevaral stages and many modules can be copied into ram and executed on demand, instead of initiating everything at boot-time.

Stage 1: A portion of the executable binary image is loaded and run which is responsible for Reset vector, necessary hardware initialization such as memory map, SDRAM, basic OS initialization and starting up control task

Stage 2: Control task monitors for events and loads and executes the another portion of the binary image which is responsible for a specific functionality.

This is very much similar to making all optional functionalities as Linux modules and loading on-demand. But, this is about how to do in single and static binary image.

Enhancement: Inside each functional module, the initialization functions and termination functions can be defined separately and moved into boot-time initialization module. How to do is described below. This is too similar to module_init() and module_ext() calls.

(Be foolish when asked about what to do. Be wise when asked about how to do.
Products mady by wise people, but made for fools will get great success.)



No comments: