From: Bart Veer <bartv@cygnus.co.uk>
To: grante@visi.com
Cc: ecos-discuss@sourceware.cygnus.com
Subject: [ECOS] Re: Ethernet and Serial drivers for Linux target?
Date: Thu, 11 Nov 1999 09:37:00 -0000 [thread overview]
Message-ID: <199911111737.RAA02373@sheesh.cygnus.co.uk> (raw)
In-Reply-To: <19991111112313.A28718@visi.com>
>>>>> "Grant" == Grant Edwards <grante@visi.com> writes:
Grant> On Thu, Nov 11, 1999 at 05:10:35PM +0000, Jonathan Larmour wrote:
>> Grant Edwards wrote:
>> >
>> > 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?
>>
>> One other issue that no-one else has mentioned is that you
>> can't make calls to the system read() and write(), ioctl() etc.
>> directly. To do that would involve linking with glibc, and that
>> would simply not work.
Grant> I presume I could grab the source for Linux glibc read()
Grant> write() and ioctl(), strip out the stuff I don't need, and
Grant> impliment my own eCos-friendly versions of those calls...
It may be better to look at syscall-i386-linux-1.0.S in the synthetic
target HAL sources. Note that if you want more realistic device driver
behaviour, with interrupts etc., then you will want to experiment with
asynchronous I/O, SIGIO signals, etc. If an eCos thread performs a
blocking Linux read() syscall then you will block the entire eCos
application, which is probably not what you want. Of course this makes
the problem a bit more challenging :-)
>> Instead all the current interfacing is done using kernel system
>> calls directly.
Grant> Ah. That's one question about which I had begun to wonder.
Grant> I haven't looked at Linux system calls very closely, but
Grant> there shouldn't be that much of a difference in abstraction
Grant> bewteen what the kernel provides and what I need to make an
Grant> eCos serial driver work.
>> Of course, this doesn't prevent you having a separate native
>> linux program acting as a server for the client requests,
>> communicating using fd's. And that's where Bart's solution
>> would come in, in the thread in October he mentioned.
Grant> I suppose I could also just use the eCos 16550 driver and
Grant> diddle the hardware directly, but I'd rather let the Linux
Grant> drivers worrry about that so that I can utilize other types
Grant> of serial ports.
I would certainly recommend you avoid messing about with PC hardware
directly, except as an absolute last resort. The current synthetic
target provides a safe and stable development environment, not unlike
a sandbox. Fiddling with real hardware would upset this.
Bart Veer // eCos net maintainer
next prev parent reply other threads:[~1999-11-11 9:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-11-10 12:38 [ECOS] " Grant Edwards
1999-11-10 16:40 ` Gary Thomas
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 ` Bart Veer [this message]
1999-11-11 9:45 ` [ECOS] " 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=199911111737.RAA02373@sheesh.cygnus.co.uk \
--to=bartv@cygnus.co.uk \
--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).