This is the mail archive of the ecos-discuss@sources.redhat.com 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]

Re: More information on crash with CVS sources


"Lewin A.R.W. Edwards" wrote:
> 
> However, in further news, I built a little test proglet that consists of
> just a cyg_user_start that does a printf [and nothing else] and a main()
> that also does a printf.
> 
> In 1.3.1, it is seemingly not necessary to explicitly create and start a
> thread. cyg_user_start enables interrupts, and then control passes to
> main(). So my program at the moment runs in main() [since it was ported
> from a different OS].
> 
> When I compile the above test prog with anoncvs everything, I get the
> printf from cyg_user_start but not the one from main; after the printf("hi
> from cyg_user_start") I get an exception at 0xfffffffc. So I assume the
> 1.3.1 behavior I describe above is no longer true and that I must
> explicitly start a thread for my main application task.

There is stuff in the CYGPKG_LIBC_STARTUP package to do this for you - it
provides a default cyg_user_start() that will create (and resume) a thread
that will call main(). This differs from v1.3.1 because this used to happen
in cyg_package_start(). But this wasn't right because it polluted the
design, and meant that people who weren't interested in having their own
main(), and instead wanted to just write their own eCos program (which
would therefore include a cyg_user_start() entry point) would still get a
main() thread created. This way they don't.

You don't need to start a thread by hand. But if you provide your _own_
cyg_user_start() then you can instead call "cyg_iso_c_start()" from your
cyg_user_start(), since the default cyg_user_start() isn't being run.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine


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