Service Profile

μT-Kernel 2.0 is an OS specification for small-scale embedded computer systems, and it allows many implementations, and permits customization and optimization suitable for each target platform. For features that have strong dependency on hardware such as MMU and FPU, and features that have potential implications for run-time efficiency such as hooks for debug support, the specification allows subsetting as exceptional case, and this allows efficient implementation of μT-Kernel 2.0 specification OS on target hardware. To accommodate the subsetting in this manner, and the desire to keep the distribution and portability of middleware and application high, μT-Kernel 2.0 has introduced a mechanism to let each implementation of μT-Kernel 2.0 describe the differences in the implementation from T-Kernel 2.0 and other implementation of μT-Kernel 2.0. This description as a whole is called service profile.

Service profile in μT-Kernel 2.0 is realized by enumerating the information about a particular implementation of μT-Kernel 2.0 as a list of C language macros that have constant value. For example, an implementation that allows the specification of TA_USERBUF, the corresponding service profile items must be defined as below to announce the support of TA_USERBUF.

#define  TK_SUPPORT_USERBUF          TRUE   /* Support of user-specified buffer area
                                               (TA_USERBUF) */

Applications and middleware can use the service profile information and write code according to the existence of the support of TA_USERBUF. For example, the following is a typical use case.

T_CTSK  ctsk = {
        .exinf   = NULL,
        .tskatr  = TA_HLNG|TA_RNG0|TA_USERBUF,
        .bufptr  = taskA_stack,
        .tskatr  = TA_HLNG|TA_RNG0,
        .task    = task,
        .itskpri = 10,
        .stksz   = 2048

tskid = tk_cre_tsk(&ctsk);

The code sample above changes, depending on the availability of TA_USERBUF, changes the content of parameter packet ctsk which is passed to tk_cre_tsk. In this manner, it is possible to develop applications and middleware that can be used on both the implementations, those that support TA_USERBUF and those that do not. Middleware developers are requested to improve the portability and thus facilitate distribution of middleware software packages by using the service profile mechanism appropriately.

For the details of service profile items defined in μT-Kernel 2.0, see the Section called Service Profile in the Chapter called Common Rules of μT-Kernel.