<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Hi<br>
<br>
Your results bothered me enough to investigate some this weekend.<br>
This is with the git master and newly built tools. I am just
referring<br>
to hello and minimum found in testsuites/samples. minimum is<br>
a simple application that does a system start up and shutdown. Its<br>
size is usually more indicative of BSP complexity and unexpected<br>
or unnecessary references in the core part of the BSP.<br>
<br>
The size info I am showing is the output of the size command. The<br>
numbers are text, data, bss, total in decimal and total in hex.<br>
<br>
Configuring with networking and POSIX disabled, hello and minimum<br>
have these sizes:<br>
<br>
SIZE: 36759 1212 1653 39624 9ac8
minimum.exe<br>
SIZE: 74831 1496 2057 78384 13230
hello.exe<br>
<br>
Moving from -O2 to -Os resulted in:<br>
<br>
SIZE: 32599 1336 1653 35588 8b04
minimum.exe<br>
SIZE: 65467 1620 2057 69144 10e18
hello.exe<br>
<br>
hello is 9364 bytes smaller which is over 10% reduction in size.<br>
<br>
Getting a bit more aggressive and into something you would have<br>
to confirm still works on target hardware... I turned on GCC
function<br>
and data sections. This lets GNU ld leave out unreferenced symbols.<br>
Unfortunately, unless the linker script is 100% correct, it can
accidentally<br>
leave out things you need. We will likely be turning this on in
the future<br>
as it gets tested on a board per board basis. But on sparc/erc32,
I<br>
got this to work and every test ran. On larger RTEMS tests, this
was<br>
averaging around 50% reduction in .text size.<br>
<br>
SIZE: 24081 476 1637 26194 6652
minimum.exe<br>
SIZE: 60318 1472 2049 63839 f95f
hello.exe<br>
<br>
Overall, that's a sizeable drop in hello -- from 75K to 60K and
all are<br>
smaller than yours. <br>
<br>
As one final example, I tinkered with
testsuites/samples/samples/hello/init.c<br>
to use printk(), call rtems_shutdown_executive() not exit() and to
turn off<br>
the console device driver (thus avoiding termios). This dropped
the <br>
hello executable further to: <br>
<br>
SIZE: 46009 1392 1809 49210 c03a
hello.exe<br>
<br>
That gets us from 75831 to 46009 which is approximately 40%
smaller<br>
and about 1/3 of your original size. <br>
<br>
Each of the 5 tasks in your app will require a stack whose size
you can<br>
specify, I would guess about 3K for semaphores and task control
structures<br>
as a safe estimate. You should follow the minimum example and let
the<br>
init task become the idle task and only configure 16 priorities.
If you don't<br>
need termios, disable the console and use printk() for debug.<br>
<br>
I have attached a diff to the rtems master showing what I did
along<br>
with a text file with the sizes of all the samples. I do need to
repeat<br>
that the function sections change would need to be tested to
ensure<br>
the executables are still OK. But since they only have reasonable<br>
reductions in size, they should work. I saw one BSP where my
executables<br>
when to 0x80 bytes in all cases. Obviously there were linker
script<br>
issues I had to fix. :)<br>
<br>
--joel<br>
<br>
On 05/31/2013 05:57 AM, Gempeler Stefan wrote:<br>
</div>
<blockquote
cite="mid:AE70B6C06C76584786A79592214C3E0A3054D4@srv01.nanotronic.local"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<meta name="Generator" content="Microsoft Word 14 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.E-MailFormatvorlage17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal">Hi, <o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">First I would like to introduce myself: the
last couple of years I developed software for PCs and embedded
systems (always worked on "bare metal" ARM etc. or on a
runnung "big" OS). Therefore I never had to use and set up an
OS on an embedded system. <span lang="FR-CH">Now I have to
evaluate one for a space project which should run on the
following hardware:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">- Xilinx Virtex4,
PowerPC405<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">- Evaluationboard: ML410<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">- final design: RAM:
max. 192 kB for program and data<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">Our system should
support (estimation):<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">- 5 threads<o:p></o:p></span></p>
<p class="MsoNormal">- accurate system time<o:p></o:p></p>
<p class="MsoNormal">- around 5 interrupts: peripheral (UARTs +
IO)<o:p></o:p></p>
<p class="MsoNormal">- around 5 mutex<o:p></o:p></p>
<p class="MsoNormal">- around 5 semaphores<o:p></o:p></p>
<p class="MsoNormal">- …<o:p></o:p></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">I came across the RTEMS
project which seems to be very interesting. Since I'm quite
unexperienced in setting up such a system, I went through
the documentation and some websites which made me build a
"running" system:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal">- built the rtems system with the system
builder:<o:p></o:p></p>
<p class="MsoNormal">>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/ftp/pub/rtems/people/chrisj/source-builder/source-builder.html">http://www.rtems.org/ftp/pub/rtems/people/chrisj/source-builder/source-builder.html</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- set up eclipse inspired by <o:p></o:p></p>
<p class="MsoNormal">>
<a class="moz-txt-link-freetext" href="http://www.rtems.org/pipermail/rtems-users/2012-February/009439.html">http://www.rtems.org/pipermail/rtems-users/2012-February/009439.html</a><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- working on RTEMS commit
e67025e3900f23e1b9a25b939d7bff37a9c5e9f0<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- made some changes on BSP "virtex"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">- took the init.c from examples-v2/hello
(tested all 3: Classic, POSIX, Classic+POSIX)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><span lang="FR-CH">-> now I've got a
"Hello World" application running on the evaluation board
using an UART as stdio </span><span
style="font-family:Wingdings" lang="FR-CH">J</span><span
lang="FR-CH"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal">So far so good, now my Questions:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">1. When I try to add some code the system,
it does not work anymore. Well, I'm not surprised when I
consider my tinkering ;-)<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">2. The test program is only a simple "Hello
World" and it already consumes 2/3 of our memory, which is a
no-go:<o:p></o:p></p>
<p class="MsoNormal"> <span lang="FR-CH">text data
bss dec hex filename<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"> 126520 1724
4004 132248 20498 o-optimize/rtems-app.exe<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"> Ok, I'm sure that the
system I put together is not optimized at all, but I'm still
quite surprised...<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="FR-CH">3. I also got stuck (and
confused) using interrupts: rtems_interrupt_catch() as
mentioned in the RTEMS C User’s Guide seems to be
deprecated. </span>Tried the
BSP_install_rtems_irq_handler(), but didn't succeed either...<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">4. Most important: To have a good feeling
about the correct setup of the system, I would appreciate to
get in touch with an expert who helps me to move on setting up
for evaluating RTEMS. Where can I get such additional support
for our system (<a class="moz-txt-link-freetext" href="http://support.rtems.com/">http://support.rtems.com/</a> and
<a class="moz-txt-link-freetext" href="http://www.rtems.com/support.html">http://www.rtems.com/support.html</a> seems to be down)?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thank you very much!<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Kind regards<o:p></o:p></p>
<p class="MsoNormal">Stefan Gempeler<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research& Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35806
Support Available (256) 722-9985</pre>
</body>
</html>