[ECOS] twothread example in redboot.

Bart Veer bartv@ecoscentric.com
Fri Apr 30 07:11:00 GMT 2004


>>>>> "Sai" == Sai Naidu <naiduk@intotoinc.com> writes:

    Sai> I have some queries regarding the thread scheduling in
    Sai> redboot.

RedBoot has been designed as a single-threaded application, without
any of the overheads of multi-threading etc. Making it multi-threaded
would require non-trivial changes.

Amongst other issues, something needs to start the scheduler before
any threads actually get to run. Usually this happens at the end of
cyg_start() after the system has initialized. However RedBoot has its
own cyg_start() which contains a "while (true)" loop, and which is
responsible for outputting the "RedBoot>" prompt and reading in the
user's commands. You would need to reorganize all this so that it all
runs in a separate thread - just calling cyg_scheduler_start()
somewhere won't suffice because that function does not return.

You should also be aware that in a RedBoot configuration the various
devices will usually run in polled mode rather than interrupt-driven
mode, while multi-threading (especially timeslicing) implies use of
interrupts. There could be quite a few problems in this area.

It may be easier to hook your http and tftp functionality into
RedBoot's polling code, rather than try to to make RedBoot
multi-threaded. You would have to look at the RedBoot internals for
details of how to do this. The obvious alternative is to have RedBoot
start a multi-threaded application which provides http and tftp.

Bart

-- 
Bart Veer                       eCos Configuration Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts

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



More information about the Ecos-discuss mailing list