How small can the Kernel get with/without TCP/IP stack? If my application does not require any ethernet connection can the TCP/IP stack, and other ethernet related code, be removed and how do I do that? Does using C++ increase the size of the Kernel in comparison to using C only? If I want to minimize the code memory usage in my application what should I or should I not do/use? In the Kernel guide you can read “For most applications, the instruction image of the NET+OS kernel is between 2 Kbytes and 15 Kbytes.” If you look at one of the examples (cpptest) the image.bin file is 255 Kbytes! If 15 KBytes is the instruction image, what is the rest?
To get an impression of amount of memory used for individual parts (or rather functions) of your program the program “gfunsize” of the GHS toolset might prove to be helpful.
Just the ThreadX kernel and the necessary startup code will indeed not use more space than a few kilobytes. The attached project does show how to start up a NS7520 based target (NetSiolicon NS7520 Dev.-Board) with only the ThreadX kernel and three tasks running. It does require only 32 kBytes of memory.
I’m not using greenhill I’m using GNU. The map file gives information about the amount of memory used and it is quite much. Even the “hello world” template, which is only one printf, has a size of 400kB so the drivers/libraries and TCP/IP stack take up a lot of memory. You will also need quite large amount of RAM since, for example, the default allocated heap memory for the TCP/IP stack is 500kB and the total heap is 1MB. I still need to know if the TCP/IP stack can be removed or optimized!! I tried to remove the line that started the TCP/IP stack (netosStartTCP in bsproot.c) but that only reduced the size with a couple of 100 bytes and the entire TCP/IP stack was still linked. Any ideas would be helpful.
Net+OS isn’t modular. You can’t separate out the stack.