Question about task scheduling and RTEMS target shell

mikeci at acm.org mikeci at acm.org
Thu Jun 19 17:07:38 UTC 2003


Hi!

I have a following problem:

There are three tasks in the system:

TA1 - with priority 95 (highest). This task has a loop in which there is a
call to rtems_wake_after(2)
TA2 - with priority 100. This task has a loop in which there is a call to
rtems_wake_after(0)
TA3 - shell (it is a rtems shell found in libmisc) with priority 100. It
call serial driver and loops until something is typed on the terminal.

Now, all three of them are created with RTEMS_PREEMPT and RTEMS_TIMESLICE.
---------------------------------------------------------------------------
Also interesting is that when you run a "task" command in the shell, task
flags are never changed and are always displayed as "P:T:nA". This is not
correct, because default setting for a task should be "P:nT:A". There is
also a bug in a shell:

in the function register_cmds this is a correct code:

        command = rtems_monitor_commands;
        while(command->command)
        {
                if(strcmp("exit", command->command))        /* Exclude
EXIT (alias quit) */
                        shell_add_cmd(command->command, "monitor",
command->usage, main_monitor);
                command = command->next;
        };


while command must check for command->command == NULL, otherwise you will
have problems with strcmp comparing string with NULL. On my system this
cause an exception.
---------------------------------------------------------------------------
Now description about the problem with tasks:

What hapens is that task 2 is never scheduled if its priority is 100. If I
lower priority of the shell to 101 then shell is never scheduled. Can you
give me sugestions on how to solve this problem?






More information about the users mailing list