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]
Other format: [Raw text]

printf/cyg_user_start/main


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


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