This page is available in: en

System States While Non-task Portion Is Executing

When programming tasks to run on µT-Kernel, the changes in task states can be tracked by looking at a task state transition diagram. In the case of routines such as interrupt handlers or extended SVC handlers, however, the user must perform programming at a level closer to the kernel than tasks. In this case, consideration must be made also of system states while a nontask portion is executing, otherwise programming cannot be done properly. An explanation of µT-Kernel system states is therefore given here. System states are classified as in Figure 2.6. Of these, a "transient state" is equivalent to OS running state (system call execution). From the standpoint of the user, it is important that each of the system calls issued by the user be executed indivisibly, and that the internal states while a system call is executing cannot be seen by the user. For this reason, the state while the OS is running is considered a "transient state" and internally it is treated as a blackbox. In the following cases, however, a transient state is not executed indivisibly.

  • When memory is being allocated or freed in the case of a system call that gets or releases memory

When a task is in a transient state such as these, the behavior of a task termination (tk_ter_tsk) system call is not guaranteed. Moreover, task suspension (tk_sus_tsk) may cause a deadlock or other problem by stopping without clearing the transient state. Accordingly, as a rule tk_ter_tsk and tk_sus_tsk cannot be used in user programs. These system calls should be used only in a subsystem or debugger that is so close to being an OS that it can be thought of as part of the OS. A task-independent portion and quasi-task portion are states while a handler is executing. The part of a handler that runs in a task context is a quasi-task portion, and the part with a context independent of a task is a task-independent portion. An extended SVC handler, which processes extended system calls defined by the user, is a quasi-task portion, whereas an interrupt handler or time event handler triggered by an external interrupt is a task-independent portion. In a quasi-task portion, tasks have the same kinds of state transitions as ordinary tasks, so system calls that enter WAIT state can be issued. A transient state, task-independent portion, and quasi-task portion are together called a nontask portion. When ordinary task programs are running, outside of these, this is “task portion running” state.

Figure 2.6: Classification of System States

Comments

Click here to Post a Comment