User`s manual
SCIOPTA - Real-Time Kernel
5-8 Manual Version 4.1 User’s Manual
SCIOPTA - Real-Time Kernel
5 Processes
5.9 Init Processes
The init process is the first process in a module. Each module has at least one process and this is the init process.
At module start the init process gets automatically the highest pri
ority (0). After the init process has done some its
work it will change its priority to a specific lowest level (32) and enter an endless loop.
The init process acts therefore also as idle pro
cess which will run when all other processes of a module are in the
waiting state.
5.9.1 Creating and Declaring Init Processes
In static modules the init process is written, created and started automatically. Static modules are defined and con-
figured in the SCO
NF configuration utility. The code of the init process is generated automatically by the SCONF
configuration tool and included in the file sconf.c. The init process function name will be set automatically by the
kernel in sconf.c to: <module_name>_init. The init process of the system module will create all static SCIOPTA
objects such as other modules, processes and pools.
In dynamic modules the init process is also created and started auto
matically. But the code of the init process must
be written by the user. The entry point of the init process is given as parameter of the sc_moduleCreate2 system
call. Please see below for more information how to write init processes for dynamic modules.
5.9.2 Init Process Priorities
At start-up the init process gets the highest priority (0).
After the init process has done its work it will change its priority to a specific lowest level (32) and enter an endless
l
oop.
Priority 32 is only allowed for the init process.
All other processes are using priority 0 - 31.
5.9.3 Writing Init Processes
Only init processes of dynamic modules must be written by the user. The entry point of the init process is given as
parameter of the sc_moduleCreate2 system call. At start-up the init process gets the highest priority (0). The user
must set the priority to 32 at the end of the init process code.
Template of a minimal init process of a dynamic module:
SC_PROCESS(dynamicmodule_init)
{
/* Important init work on priority level 0 can be included here */
sc_procPrioSet(32);
for(;;) ASM_NOP; /* init is now the idle process */
}










