[En-Nut-Discussion] Porting Linux Apps to NutOS
Bob Wirka
bobwirka at yahoo.com
Sat Nov 5 22:34:24 CET 2011
Am I headed for disaster?
Using ethernut-4.8.9, Eclipse Helios, and the Codesourcery arm-none-eabi-xxx toolchain.
We're porting a few applications from Linux to NutOS. All apps use networking (socket, bind, etc.). Trying to compile these projects using the headers from the compiler toolchain and ethernut is a nightmare. There is no socket support in the toolchain, and ethernut sockets don't fit the bill.
However, if you compile these applications as libraries (without any ethernut include paths) and specify the compiler toolchain include path first, followed last by a handy Linux include path, they will compile with only a little tweaking. Very clean.
Now, when you link a library like this to a "core" program written for ethernut, you end up with a bunch of unresolved symbols; specifically the networking, threading, semaphore, and mutex functions. Then, if you write stub programs that transform those standard functions into Nut calls, you can get a good link. And, believe it or not, the programs run.
I'm thinking that since everyone agrees on the sizeof() things, this should work. Is there something lurking in all of this that will doom this approach?
Has anyone done this before? Any thoughts?
Thanks,
Bob Wirka
More information about the En-Nut-Discussion
mailing list