[ECOS] Re: ecos mem footprint with HTTPD support

Sergei Gavrikov sergei.gavrikov@gmail.com
Wed Jul 15 13:14:00 GMT 2009

John Dallaway wrote:
> Hi Mandeep
> Mandeep Sandhu wrote:
> > Just as I got a rough estimate of how much mem (worst case) my hello world
> > app along with the rest of the ecos libs take, is there any sample prog which I
> > can use to ascertain the runtime size of my app which uses the HTTPD pkg?
> Note that the HTTPD package is intended for use with the eCos FreeBSD
> TCP/IP stack, not lwIP.
> The lwIP TCP/IP stack provides its own HTTP server test. Simply
> configure eCos for lwIP networking and then build eCos and the eCos
> tests for lwIP. Run "arm-eabi-size" (assuming an ARM target) on the
> resulting "httpd" test executable file.

To know its sizes and to peace a linker I use a trick (workaround for
"section .bss is not within region ram" error).

Let's call it "How much is The Fish". It is

sed -i '/ram.*LENGTH/s,$,0,' isntall/lib/target.ld

it just multiply target's ram size on 16 :-)

I run this 1-line sed script before to build the tests.

The below is just an example (I have no target)

ecosconfig new sam7ex256 lwip_eth
ecosconfig tree
sed -i '/ram.*LENGTH/s,$,0,' isntall/lib/target.ld
make -C net/lwip_tcpip/current/ tests TESTS=tests/httpd

   text	   data	    bss	    dec	    hex	filename
  71240	   5428	 102808	 179476	  2bd14	httpd

Ups... But, AFAIK, lwip's pbufs sucks RAM. Default number of pbufs is
60, its default size is 1K. 60x1K... Well, let's reduce amount of the
buffers, i.e. import the below

    user_value 6

and rebuild the test

   text	   data	    bss	    dec	    hex	filename
  71240	   5428	  46648	 123316	  1e1b4	httpd

It is something more interesting, but, I could break down the lwip
networking. I do not know. To reduce text segment you can disable udp,
raw ethernet support, etc., etc. (it's eCos).

Hey, do not forget to revert ld script! It's easy if you use bash

sed -i '/ram.*LENGTH/s,0$,,' isntall/lib/target.ld

And now, without jokes. Look at Adam Dunkel's uIP TCP/IP stack

and his invention, - Protothreads (Stackless Threads in C)

I have a dream to try eCos together with Adam's Protothreads. If it will
allright, it will be possible to get unbeatable sizes for small memory
footprint targets.


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list