This is the mail archive of the ecos-discuss@sourceware.cygnus.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]

Re: Ethernet and Serial drivers for Linux target?



On 11-Nov-99 Grant Edwards wrote:
> 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.
> 
> I presume I could grab the source for Linux glibc read() write() and
> ioctl(), strip out the stuff I don't need, and impliment my own
> eCos-friendly versions of those calls...
>

There is a very simple mapping of functions onto the actual system calls.
Beware of the glibc code though, it's full of macros that do all of this work :-)
 
>> Instead all the current interfacing is done using kernel system calls
>> directly. 
> 
> Ah. That's one question about which I had begun to wonder.  I haven't
> looked at Linux system calls very closely, but there shouldn't be that
> much of a difference in abstraction bewteen what the kernel provides
> and what I need to make an 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.
> 
> I suppose I could also just use the eCos 16550 driver and diddle the
> hardware directly, but I'd rather let the Linux drivers worrry about
> that so that I can utilize other types of serial ports.
> 

IMHO you should definitely stay away from touching the hardware.  Let
Linux do it for you. If you do things right, you'll be able to convince
eCos that you have access to the real hardware anyway.

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