public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Gary Thomas <gthomas@cygnus.co.uk>
To: Grant Edwards <grante@visi.com>
Cc: ecos <ecos-discuss@sourceware.cygnus.com>, =ecos@visi.com
Subject: RE: [ECOS] Ethernet and Serial drivers for Linux target?
Date: Wed, 10 Nov 1999 16:40:00 -0000	[thread overview]
Message-ID: <XFMail.991110180953.gthomas@cygnus.co.uk> (raw)
In-Reply-To: <19991110143853.A18972@visi.com>

On 10-Nov-99 Grant Edwards wrote:
> 
> Hi,
> 
> I told management that it should be possible to write serial port and
> Ethernet device drivers for the Linux eCos target, thus allowing
> people to do eCos application development on Linux boxes.  Of course
> the performance and timing won't be the same, but for basic application
> functionality it should be good enough for many things.
> 
> Has anybody done this?  I assume that all you have to do is to map
> cyg_io_read() and cyg_io_write() into read() and write() calls, and
> map cyg_io_get_config() and cyg_io_set_config() into appropriate
> ioctl() calls?
> 
> The serial driver should be able to use the standard /dev/ttySx
> devices and the Ethernet driver can use the af_packet module to send
> and receive Ethernet packets.  Is this going to be as straight-forward
> as I think it is, or have I dug myself into a hole?
> 

It absolutely should be that simple (or we did a poor job designing it :-)

The serial device driver has two layers, one which is platform independent
and one is hardware dependent.  You'll want to creat a platform/hardware
dependent module that implements the basic functionalities.
 o Serial output is simple, no interrupts required
 o Serial input is a little harder if you want to support an interrupt
   driven model (i.e. other threads in your eCos application can run while
   one or more threads waits for input).  In this case, you'll need to use
   signals (SIGIO) to get indicate that data is ready and then use the
   interrupt model to send data to the upper levels of the driver.  This is
   not hard, just a little more work.  If you don't care, you can just blow
   this off and make input non-interrupt driven as well.
 o Control functions map directly onto Linux 'ioctl' calls.

For a purely non-interrupt driven driver, look at:
  .../io/serial/XXX/src/arm/pid_serial.c
Or the interrupt driven version
  .../io/serial/XXX/src/arm/pid_serial_with_ints.c

Note: the non-interrupt version may be a little "crusty", I haven't used it
in quite a while, but you'll get the idea.

As for the ethernet, I'd like to see what you come up with.

If you have questions or problems, be sure to let me (or the eCos team/list)
know;  we're glad to try and help.


  reply	other threads:[~1999-11-10 16:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-10 12:38 Grant Edwards
1999-11-10 16:40 ` Gary Thomas [this message]
1999-11-11  4:44 ` [ECOS] " Bart Veer
1999-11-11  9:10 ` [ECOS] " Jonathan Larmour
1999-11-11  9:23   ` Grant Edwards
1999-11-11  9:32     ` Gary Thomas
1999-11-11  9:39       ` Grant Edwards
1999-11-11  9:37     ` [ECOS] " Bart Veer
1999-11-11  9:45       ` Grant Edwards

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=XFMail.991110180953.gthomas@cygnus.co.uk \
    --to=gthomas@cygnus.co.uk \
    --cc==ecos@visi.com \
    --cc=ecos-discuss@sourceware.cygnus.com \
    --cc=grante@visi.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).