porting a function to a embedded system
Tue Dec 7 16:41:00 GMT 2010
Thanks for your reply. Yes, sorry for not mentioning that, but there
is no operating system. I was planning to use the code under newlib to
implement the function, but I was asking because I don't know if it is
possible, or a correct way to do it. I just want a function that does
the same to that one, but I suppose it is good enough for me to lookup
names or addresses in local tables
For example, there is another function called gethostbyname, very
similar to the one that I need, that has been ported to this platform
already. It is included in the development kit, in a library called
dswifi. It is a static library, so you can link to it and you can use
the function. Well, I want to do something like this.
Thank you and have a nice day!
On Sun, Dec 5, 2010 at 6:02 PM, Jean-Marc Saffroy
> Hi Antonio,
> On 12/04/2010 11:54 AM, Antonio Escanuela wrote:
>> 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.
More information about the Newlib