eCos scheduler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

eCos scheduler

gerardo.rossi
Currently available eCos schedulers do not have the notion of periods and
deadlines, and all of them are fixed priority-based schedulers. We have to
implement a dynamic priority based scheduler in eCos, based on the earliest
deadline first (EDF) policy. Priorities are therefore assigned at run time
based on the tasks' deadlines.
So we have to modify the thread data-structure in eCos kernel to add following
informations:
- Worst Case Execution Time;
- Period;
- Deadline.

but we don't know where thread data-structure is defined, can you help us?
Have we to modify the following code in kapi.h ?
typedef struct
{
    cyg_handle_t        handle;
    cyg_uint16          id;
    cyg_uint32          state;
    char                *name;
    cyg_priority_t      set_pri;
    cyg_priority_t      cur_pri;
    cyg_addrword_t      stack_base;
    cyg_uint32          stack_size;
    cyg_uint32          stack_used;

    /* added fields */
    cyg_tick_count_t wcet;
    cyg_tick_count_t period;
    cyg_tick_count_t dline;

} cyg_thread_info;

We have to implement our EDF scheduler on top of the Bitmap scheduler.
How can we have all the calls to the native Bitmap scheduler captured by our EDF
scheduler, which first modifies the priorities of individual thread based on
their respective deadlines and then calls the Bitmap scheduler ?

Thanks
  Mirko, Gerardo.


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

Reply | Threaded
Open this post in threaded view
|

Re: eCos scheduler

Fabian Scheler
Hello,

this topic has already been discussed here:
http://sourceware.org/ml/ecos-discuss/2005-10/msg00159.html
maybe the arguments announced there can help you

some comments:
- to implement the EDF scheduler on top of the bitmap scheduler is a
rather poor solution (as is to use the mlq-scheduler), how would you
handle more than 32 Threads with different priorities?
- you should implement a priority queue that is able to distinguish an
arbitrary number of different priorities t.m. deadlines (something
like a heap)
- about redirecting the calls: it is not that easy to 'redirect' the
calls, each scheduler has one scheduler specific class
Cyg_Scheduler_Implementation, if you want your EDF scheduler to be the
'standard' scheduler and want to use the bitmap scheduler as base,
then you have at least to rename the class
Cyg_Scheduler_Implementation implementing the bitmap scheduler
- if you make up your mind about the scheduleability of you system
before runtime you can maybe omit the thread attributes wcet and
period

Ciao, Fabian

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss