public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Wolfram Kattanek <wolfram.kattanek@imms.de>
To: Gary Thomas <gthomas@cambridge.redhat.com>
Cc: Wolfram Kattanek <wolfram.kattanek@imms.de>,
	ecos-discuss@sourceware.cygnus.com
Subject: Re: [ECOS] cyg_io_write & printf
Date: Wed, 07 Feb 2001 07:14:00 -0000	[thread overview]
Message-ID: <981558819.3a816623e4051@imp.imms.de> (raw)
In-Reply-To: <3A815DE6.8D4BF0E6@cambridge.redhat.com>

Gary Thomas <gthomas@cambridge.redhat.com>:

> > More interestingly, if I change cyg_user_start to main then the output
> > becomes really weird:
> >
> > AEB-1 eCos
> > This isHaetest lessalo! eCos world!
> >
> > Both outputs seem to be mixed! The output changes a little bit if I use tty1
> > instead of ser1 or \r\n instead of \n but the mixing won't stop.
> >
> 
> This is happening because 'printf()' uses the diagnostic routines, which use
> polling
> The 'cyg_io_write()' uses interrupts to drive the port.  Thus, once the 'printf()'
> starts, all characters will be displayed at once.  The 'cyg_io_write()' relies on
> interrupts
> to drive the process.  Getting mixed output is certainly to be expected.
> 
> >
> > So here are my questions:
> >
> > - Why is the behavior so different when using main or cyg_user_start?
> 
> It depends on when interrupts get enabled.

But when do they get enabled when using main() or cyg_user_start() without
creating some user threads?

When I put the example code inside a user thread (created in cyg_user_start)
everything seems to work fine. Does that mean that (only) the scheduler enables
interrupts? Can the scheduler also be started from inside main() (via creating
a user thread)? When trying to do so I get the following assertion failure:

ASSERT FAIL: <2>intr.cxx   [571] static void Cyg_Interrupt::enable_interrupts()

Am I missing something fundamental about eCos?

> > - Is it possible to use both cyg_io_write and printf when only one physical
> >   serial port is available?
> 
> Yes, there is an option to get diagnostic output to basically go through 'cyg_io'

But this doesn't solve the above problems concerning mix of interrupt driven and
polled output or am I wrong about that?

> > - BTW: Is there a config option to turn off the output "AEB-1 eCos"?
> >
> 
> I'm pretty sure that this has been removed.  Are you using a "release" version
> or anonymous CVS?

I'm using an anonymous CVS snapshot from Jan 22 2001. However the "AEB-1 eCos"
string is coded inside the file packages/hal/arm/aeb/current/src/hal_diag.c
which is dated from Jul 4 2000.

Wolfram
--
Wolfram 'L.A.' Kattanek     Institut fuer Mikroelektronik- und
Email:       LA@imms.de     Mechatronik-Systeme (IMMS) gGmbH     
Tel: +49 3677 / 6783-55     Langewiesener Str. 22
Fax: +49 3677 / 6783-38     98693 Ilmenau / Germany

-------------------------------------------------
This mail sent through IMP: imp.imms.de

  reply	other threads:[~2001-02-07  7:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-02-07  3:32 Wolfram Kattanek
2001-02-07  6:38 ` Gary Thomas
2001-02-07  7:14   ` Wolfram Kattanek [this message]
2001-02-07  8:42     ` Jonathan Larmour
2001-02-08  3:03       ` Wolfram Kattanek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=981558819.3a816623e4051@imp.imms.de \
    --to=wolfram.kattanek@imms.de \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=gthomas@cambridge.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).