eCos scheduler

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

eCos scheduler

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
- 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 ?

  Mirko, Gerardo.

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

Before posting, please read the FAQ:
and search the list archive:

Reply | Threaded
Open this post in threaded view

Re: eCos scheduler

Fabian Scheler

this topic has already been discussed here:
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

Ciao, Fabian

Before posting, please read the FAQ:
and search the list archive: