This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: porting a function to a embedded system
- From: Jean-Marc Saffroy <jean-marc dot saffroy at joguin dot com>
- To: Antonio Escanuela <cid dot high at gmail dot com>
- Cc: newlib at sourceware dot org
- Date: Sun, 05 Dec 2010 18:02:20 +0100
- Subject: Re: porting a function to a embedded system
- References: <AANLkTi=6=rnDZToyVVa=6S3miJfasSgDXoYpShuUQs=q@mail.gmail.com>
Hi Antonio,
On 12/04/2010 11:54 AM, Antonio Escanuela wrote:
> Hello,
>
> I am doing a project for the Nintendo DS, whose toolchain uses newlib.
> I want to use a standard C function called gethostbyaddr (or
> getnameinfo, since the other is deprecated), but neither of them are
> implemented in the version of newlib that is included with the
> toolchain (called devkitARM). So I was thinking in porting it by
> myself. I have tried downloading the latest version of newlib and
> tried to compile the function and its dependencies, but it does have a
> lot of dependencies! Any one could give me a piece of advice, or some
> help of how is the correct way of doing this things.
>
> Thank you very much in advance.
>
It's not clear to me if the newlib port your are using is running on any
kind of operating system, so I will assume it's running on the bare metal.
Also you don't mention which code base you plan to use to implement
resolver functions. If you use the code under newlib/libc/sys/linux then
you might have more work than you want, because this code expects a
Linux kernel that provides a full TCP/IP stack and a file system. (These
might be the dependencies you referred to.)
It would be useful that you define what you expect from your custom
port: resolver functions can be re-implemented in a rather simple way
*if* it is good enough for you to lookup names or addresses in local
tables; but if you want to query a DNS server, then you will need a
TCP/IP stack, and that's much more than what's in newlib, maybe a port
of Linux (or eCos?) would better suit your needs.
Cheers,
Jean-Marc