From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26080 invoked by alias); 15 Jul 2009 13:14:37 -0000 Received: (qmail 25957 invoked by uid 22791); 15 Jul 2009 13:14:36 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-bw0-f210.google.com (HELO mail-bw0-f210.google.com) (209.85.218.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jul 2009 13:14:30 +0000 Received: by bwz6 with SMTP id 6so2493158bwz.30 for ; Wed, 15 Jul 2009 06:14:26 -0700 (PDT) Received: by 10.204.112.130 with SMTP id w2mr2252617bkp.56.1247663666820; Wed, 15 Jul 2009 06:14:26 -0700 (PDT) Received: from smtp.gmail.com ([86.57.137.251]) by mx.google.com with ESMTPS id 18sm13061533fks.40.2009.07.15.06.14.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 15 Jul 2009 06:14:25 -0700 (PDT) Date: Wed, 15 Jul 2009 13:14:00 -0000 From: Sergei Gavrikov To: John Dallaway Cc: Mandeep Sandhu , ecos-discuss@ecos.sourceware.org Message-ID: <20090715131830.GA7572@sg-ubuntu.local> References: <4A5DB80E.7090604@dallaway.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A5DB80E.7090604@dallaway.org.uk> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Subject: Re: [ECOS] Re: ecos mem footprint with HTTPD support X-SW-Source: 2009-07/txt/msg00134.txt.bz2 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 make 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 cdl_option CYGNUM_LWIP_PBUF_POOL_SIZE { 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 history sed -i '/ram.*LENGTH/s,0$,,' isntall/lib/target.ld And now, without jokes. Look at Adam Dunkel's uIP TCP/IP stack http://www.sics.se/~adam/uip/ and his invention, - Protothreads (Stackless Threads in C) http://www.sics.se/~adam/pt/ 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. Sergei -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss