Inspecting task state, Task description language, Rtk interface – Freescale Semiconductor Microcontrollers User Manual

Page 186

Advertising
background image

Real Time Kernel Awareness

Task Description Language

186

Microcontrollers Debugger Manual

Inspecting Task State

Each multitasking operating system stores the context of each task at a specific location,
usually called the task descriptor. This context consists of the CPU context (CPU
registers) and the content of the associated stack. There is more information in the task
descriptor, depending on the specific implementation of the kernel.

The Debugger allows you to inspect the CPU registers and stack containing all procedure
activation frames (return addresses, parameters, local variables). Therefore, it has to get
this information for each task to be debugged. Since this information is specific to the
kernel used, there is a universal way to specify the location where and how to collect this
data.

This information is read from a file with the name OSPARAM.PRM, which describes the
algorithm of how to get all the needed data from the target memory (from the task
descriptors). To describe this algorithm, a simple procedural language is used. The only
parameter to the algorithm is an address specified by the user, which identifies the task to
be inspected. The result is the CPU context (CPU registers) and status of the task, which
allows the debugger to display the procedure activation stack in a symbolic way.

RTK Interface

When the application is halted, the debugger displays the state of the current task. To
identify the task to be inspected, the user has to follow these steps.

Make the task descriptor or a pointer to it visible in any of the debugger's data windows.

Press the P key while holding down the left mouse button on a variable of type "pointer to
task descriptor".

Now the current state of the selected task and procedure chain of that task is displayed in
the 'Procedure Chain' window. By clicking on the procedures in the call chain list, the
local data of that function is displayed in the Data1 window. All the usual debugging
functions are also available to inspect this task (including displaying the register contents).

Task Description Language

To debug a task, a file named OSPARAM.PRM has to be created and must be stored in one
of the directories specified in

GENPATH: #include “File” Path

.

The file OSPARAM.PRM describes the algorithm to collect the context information for a
specific task (the PC, SP, DL, SR and registers).

The following syntax must be used to specify the algorithm (in EBNF):

StatSequence = Statement] {';' Statement;}.
Statement = Assignment | ErrorMsg | If.

Advertising