RTEMS downloadable image size

Joel Sherrill joel.sherrill at OARcorp.com
Wed Jul 6 13:25:01 UTC 2011

On 07/06/2011 12:01 AM, Steve Battazzo wrote:
> Sorry, I said Motorola SREC format but it could be Intel HEX as well, 
> but the same reasoning applies either way...
Depending on how the conversion is done, you can often specify the
number of bytes to put per line to the utility doing the conversion.
This can significantly reduce the size of the hex file.

But ~128K is pretty good for a BSP that no one has ever cared
about the size of executables on.  And it is a more complicated
BSP because it can deal with hardware variations.  It even has
boot command line processing in it.

> Steve
> On 07/06/2011 01:59 PM, Steve Battazzo wrote:
>> Where do you get 246kB for the hex file? Is that the size of the file 
>> itself?
>> In that case you can expect it to be a little more than double the 
>> size of the actual code, because it's in Motorola S-REC format, which 
>> has the whole code in ASCII hex, where you need two characters for 
>> each byte of code.
>> What you see underneath "dec" is the base 10 representation of the 
>> code size. I see 130,328 bytes for the .exe and 122,573 for the hex. 
>> This is the size you should be worried about for downloading code 
>> into ROM, right? And the exe should just barely fit into 128kB 
>> (131072 bytes).
>> I wonder if there is any issue with the lack of text and bss sections 
>> when you convert to hex.. maybe somebody else will know about that.
>> Steve
>> On 07/06/2011 01:31 PM, S Akhtar wrote:
>>> I am sorry for the mistake in sizes mentioned
>>> The correct sizes are
>>>      text          data          bss        dec          hex       
>>> filename
>>>    118665       3908          7794    130328      1fd3f       hello.exe
>>>      text          data          bss        dec          hex        
>>>  filename
>>>       0           122573         0       122573       1de92      
>>> rtemshello.hex
>>> On Wed, Jul 6, 2011 at 8:51 AM, S Akhtar <crystaldoll85 at gmail.com 
>>> <mailto:crystaldoll85 at gmail.com>> wrote:
>>>     Hello all
>>>     I am using RTEMS 4.10 for my i386ex custom board. Host operating
>>>     System is ubuntu 11.04
>>>     I have configured my RTEMS as
>>>     --target=i386-rtems4.10 --prefix=/opt/rtems-4.10 --disable-itron
>>>     --disable-posix --disable-networking --disable-multiprocessing
>>>     --enable-rtemsbsp="i386ex"
>>>     By this configuration, i get sample application "hello world"
>>>     executable of size 1.02 MB
>>>           text          data          bss        dec        filename
>>>        118665       3908          7794     1fd3f       hello.exe
>>>     By converting it into downloadable hex file
>>>     i386-rtems4.10-objcopy -O ihex hello.exe hello.hex
>>>     packhex <hello.hex >rtemshello.hex
>>>     The final downloadable image is rtemshello
>>>          text          data          bss        dec            filename
>>>             0         122573         0         122573      
>>>     rtemshello.hex
>>>     The file size of rtemshello.hex is 246KB, whereas the available
>>>     ROM in my board is 128K, is there any way i can reduce this size
>>>     upto 128K so that i can download it into ROM?
>>>     Thank you for your time
>>>     Regards
>>> _______________________________________________
>>> rtems-users mailing list
>>> rtems-users at rtems.org
>>> http://www.rtems.org/mailman/listinfo/rtems-users

Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
    Support Available             (256) 722-9985

More information about the users mailing list