This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
printf/cyg_user_start/main
- From: Zi Zhou <zzhou at 3upsystems dot com>
- To: ecos-discuss at sources dot redhat dot com
- Date: Tue, 18 Mar 2003 18:43:23 -0800
- Subject: [ECOS] printf/cyg_user_start/main
- Organization: 3upsystems
Hi,
I am relatively new to eCos system. I have an IDT438 demo board and eCos
2.0 package. I built a eCos libarary ( net package) and I choose
/dev/tty1 as console and included /dev/ser1 hardware device driver. I
want to test the libarary with example code that come with eCos package,
and I observed something I don't quite understand.
I have a Hyperterminal connected to /dev/ser1, and I am able to see the
expected display on Hyperterminal for program hello, serial,
simple_alarm, however, program twothreads only print 'E' ( which is the
first char of printf("Entering ... ") in twothreads.c). I compared the
4 source files. hello.c use main() as entry point while the rest use
cyg_user_start(). Among the 3 programs that use cyg_user_start() as
entry point, serial.c and simple_alarm.c do printf() in the threads
while twothreads.c do printf() right after it enters cyg_user_start(), I
vaguely remember some discussion about the restriction of when we can
call printf() in eCos, but I can't find it now, Can some one kindly
explain the reason behind the scenario I observed and give me some hint
about how to fix the problem?
Another question is which driver is used for stdio printf()? I choose
/dev/tty1 as console which use /dev/ser1 hardware device driver, does
this mean in this case printf() will use /dev/ser1 driver?
Thanks !
Zi
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss