This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
RE: Network programming for eCos under linux
- To: "'Andrew Lunn'" <andrew dot lunn at ascom dot ch>
- Subject: RE: [ECOS] Network programming for eCos under linux
- From: "Trenton D. Adams" <tadams at theone dot dnsalias dot com>
- Date: Wed, 8 Aug 2001 08:56:52 -0600
- Cc: "'eCos Discussion'" <ecos-discuss at sourceware dot cygnus dot com>
> #includes are different. eCos just needs <networks.h> where as linux
> needs a big collection of include files.
Yep, I know what to include for a Linux program.
>
> You need to stick to the very basic sockets API. Things like
> gethostbyname(), getdomainname() are not implemented on eCos.
>
Yep, that too! ;)
> 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.
>
Very weird
> Watch out for endianness issues. i386 linux is little endian. Whats
> the endianness of your target? Things like this affects network
code.
>
This shouldn't pose a problem since I've configured my ARM as
little-endian. However, htons (), htonl (), etc should solve that
problem anyhow, shouldn't it? I mean as far networking code goes that
is. I would obviously have to be careful about data types between the
two if they were different. It's nice to have the ARM with 32-bit
little-endian! Makes my life a lot easier since I'm sending data to a
PC.
> 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 :-)
>
I would imagine it is faster using Linux.
What about threads? How do those work under Linux? Are they similar at
all?