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]

Re: Network programming for eCos under linux


> I was wondering if networking code would be portable between eCos and
> Linux?  If there are some minor differences, what are they, and what
> #defines would I need to know about in order to do both versions of the
> differences and have it compile under both eCos and Linux.

I've dones this once. I wrote some code on Linux first, made it work,
and then ported it to eCos. 

#includes are different. eCos just needs <networks.h> where as linux
needs a big collection of include files.

You need to stick to the very basic sockets API. Things like
gethostbyname(), getdomainname() are not implemented on eCos. 

I found some compiler bugs. Code that worked with the plain linux
compiler did not with the arm-elf. These were to do with access to non
aligned memory. 

Watch out for endianness issues. i386 linux is little endian. Whats
the endianness of your target? Things like this affects network code.

The code i was writting was relativly simple and did not need any of
the ecos cyg_* functions. Overall i found it a worth while way of
writing the code. It edit/compile/run/crash cycle is much faster :-)

        Andrew


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