This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: how to implement EDF scheduling in eCos


Hi Nodir

Nodir Kodirov wrote:

[ snip ]

> cyg_thread_create(4, simple_program, (cyg_addrword_t) 0, "Thread A",
> (void *) stack[0], 4096, &simple_threadA, &thread_s[0],	11, 12, 13);
> cyg_thread_create(4, simple_program, (cyg_addrword_t) 1, "Thread B",
> (void *) stack[1], 4096, &simple_threadB, &thread_s[1],	21, 22, 23);
> printf("Created threads with extended properties\n");
> 
> Here 11,12,13 (and 21,22,23) are deadline, wcet, period of the first
> (second) thread respectively.

To avoid changing the kernel API, I suggest that you pass the deadline,
wcet and period by using the sched_info parameter of the
cyg_thread_create() call as the address of a scheduler-specific data
structure.

> One more question is, there are kernel tests in eCos repository, are
> they to check eCos kernel after such a modification?

Many of the kernel tests will exercise the scheduler. Some of the
existing kernel tests require a specific scheduler implementation, but
many should be scheduler-independent.

Unfortunately, the tests are written to assume that the sched_info
parameter of the cyg_thread_create() call contains the initial thread
priority. Some minor changes to the tests will therefore be necessary.
You can always use cyg_thread_set_priority() to set an initial priority
following thread creation.

You should also consider writing your own scheduler-specific test(s).

I hope this helps...

John Dallaway
eCos maintainer

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]