This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: twothread example in redboot.
- From: Bart Veer <bartv at ecoscentric dot com>
- To: naiduk at intotoinc dot com
- Cc: ecos-discuss at sources dot redhat dot com
- Date: Thu, 29 Apr 2004 16:33:27 +0100 (BST)
- Subject: Re: [ECOS] twothread example in redboot.
- References: <1083251067.1212.156.camel@naidu.intotoind.com>
>>>>> "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