<div dir="ltr"><div><div><div><div><div><div><div><div><div>Wow! a lot of stuff here.<br></div> I do not even know what RSB is, could you please point me to that? I thought a cross compiler built from NB would work but after read some documents I decided to follow RTEMS instructions to build. It looks to me a "standard" MIPS cross compiler, but anyway, I think is done.<br>
<br></div> I want to work with Posix API, so I do not really care much about classic API but in RTEMS "Getting Started" document is set for classic API so that is what I followed.<br></div><br> I did not find much info (in fact nothing) about build RTEMS toolsuit under NetBSD (that does not necessary mean that it does not exist)<br>
</div> I had a very bad time trying to set up the tools, but I realized that everything is well documented, the problem was my lack of knowledge.<br><br></div> I am looking forward to be able to build my first "hello" and make it run on gdb.<br>
<br></div> I want to apologize in advance because I guess I will ask a lot.<br></div><br></div> Regards,<br></div> Ivan<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/8/27 Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Ivan Temp wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
thanks for your reply.<br>
Actually I am writing a simple text with my experience, just in case<br>
could help to build RTEMS on NetBSD. I am trying a couple of fresh<br>
install of NetBSD versions right to test whether it works with several<br>
options. Everything is embryonic now.<br>
</blockquote>
<br></div>
Did you look at the RSB on NetBSD ?<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  Anyway I used this to build gcc:<br>
<br>
cd ../gcc-4.8.1<br>
ln -s ../newlib-2.0.0/newlib .<br>
cd ../b-gcc<br>
<br>
../gcc-4.8.1/configure \<br>
--target=${TARGET} \<br>
--with-gnu-as --with-newlib \<br>
--verbose \<br>
--enable-threads \<br>
--enable-languages="c,c++" \<br>
--prefix=/usr/rtems/rtems-4.11 \<br>
--with-gmp=/usr/pkg \<br>
--with-mpfr=/usr/pkg \<br>
--with-mpc=/usr/pkg \<br>
<br>
  I needed to set LD_LIBRARY_PATH to /usr/pkg where gmp, mpfr and<br>
mpcomplex were installed using pkgin. and added<br>
/usr/rtems/rtems-4.11/bin to PATH.<br>
  I also installed "isl" but I do not know if is really needed, I have<br>
to check a bit more.<br>
<br>
  Because I did not use /opt directory I have to set also<br>
--prefix=/usr/rtems/rtems-4.11 to the rtems build, I have seen some<br>
default configurations that point directly to /opt.<br>
</blockquote>
<br></div>
You can also use /usr/local/rtems/4.11.<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  This is the command I used for RTEMS build with no success:<br>
<br>
VirtualNetBSD# ../../rtems/configure --target=$TARGET<br>
--enable-rtemsbsp=jmr3904 \<br>
--enable-tests=samples --disable-posix \<br>
--prefix=/usr/rtems/rtems-4.11<br>
<br>
  Then I enabled posix following Chris recommendation (thanks) and at<br>
least now compiles. I am ok setting posix but, do not you think it<br>
should work with posix disable?<br>
</blockquote>
<br></div>
It depends on the patches you use to build gcc. I have a recent patch that switches gcc from the RTEMS thread model to POSIX. The RTEMS thread model is broken with SMP and requires lots of work to make it SMP safe and what is saves you over the POSIX interface will be questionable. The POSIX support in GCC need only minor changes to work.<br>

<br>
The background is POSIX was consider a extra overhead in terms of code size and memory footprint if all you needed was the classic API. This is still true because an extra piece of memory is allocated in each TCB with POSIX enabled. In terms of code size the overhead is becoming less as time goes on because the classic API needs functionality that POSIX has. The plan is to move code in the POSIX API to the score so it can be used by both APIs. The move to SMP is the reason. The classic API does not have a condition variable and the libblock cache needs this because the current code is broken with SMP. The classic API's task variable API should be depreciated and removed from RTEMS as it is not SMP safe and replaced with something like the POSIX keys.<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   I am going to test gdb now, I will let you know.<br>
<br>
  By the way, I am not an expert at all but want to learn.<br>
<br>
</blockquote>
<br></div>
Excellent and welcome.<span class="HOEnZb"><font color="#888888"><br>
<br>
Chris<br>
</font></span></blockquote></div><br></div>