<div dir="ltr">The reply from Russell is very good advice. Look forward when porting and<div>make sure you are porting something with a future.</div><div><br></div><div>For Mono, I did exactly what he outlined. I built native. I recall it using a </div><div>fairly normal configure script and I just added --target=XXX-rtems. I might</div><div>have added some CFLAGS but don't recall. </div><div><br></div><div>I focused on the run-time interpreter and ignored the JIT. The run-time</div><div>translated Mono calls into C library and POSIX calls. If there was a </div><div>compilation issue, I tried to fix it where ever it had to be fixed. Always being</div><div>open to adding something to either RTEMS or newlib if possible</div><div>and needed.</div><div><br></div><div>--joel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 12, 2017 at 11:03 AM, Russell Haley <span dir="ltr"><<a href="mailto:russ.haley@gmail.com" target="_blank">russ.haley@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Jul 11, 2017 at 9:31 PM, <a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a><br>
<<a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a>> wrote:<br>
> Dear Joel,<br>
> Recently, I continue to port Mono to RTEMS.<br>
> Porting consists of two parts, according to the Mono documents online, JIT<br>
> engine and OS support.<br>
> JIT part is already done, since I use ARM platform.<br>
> And I am confuesd about OS part and how to build Mono on RTEMS.<br>
> Could you recall any details about how to build Mono on RTEMS? Thank you.<br>
<br>
</span>I'm not sure that's quite right. There are really 3 parts: The<br>
application framework, the 'JIT' (Mono Runtime, or Common Language<br>
Runtime in Microsoft .Net) and the OS specific layer. The application<br>
framework and the JIT are common to all platforms. The OS specific<br>
parts are in the Mono Runtime where it translates the Interediate<br>
Language (IL) to machine specific code at ... er ... runtime. The Mono<br>
Runtime is being slowly replaced by the Roslyn compiler, which is open<br>
source from Microsoft (very very cool stuff).<br>
<br>
Building Mono requires a number of parts, including boot strapping the<br>
build and downloading binaries from nuget (last time I did it,<br>
anyway). I've never attempted to cross compile Mono. I would assume<br>
you would change the make file to point to a cross compiler such as<br>
arm-unknown-gcc (not sure about the RTEMS specifics).<br>
<br>
In my opinion the best bet is to pull the mono repository from GitHub<br>
and build it for your host platform first. Then you could look at<br>
modifying it to build on arm.<br>
<br>
That said, Mono is a dead/dying platform. Microsoft has bought<br>
Xamarian (Mono sponsor company). Now the Mono Dev Team is slowly<br>
porting everything over to the Microsoft .Net Core code. Once the<br>
majority of libraries are converted, they can then write Mono specific<br>
modules for legacy applications and then shuffle everyone over to<br>
DotNet Core. It might be wise to look at using the DotNet Core instead<br>
of Mono. There are a number of reasons to prefer the DotNet Core:<br>
<br>
- Designed to be small and use a package manager to import required<br>
external libraries. This was done with embedded systems in mind.<br>
- Better interpreter: the new interpreters (Rosylin and the other that<br>
I don't remember the name of) are very efficient compared to the Mono<br>
mc.<br>
- More efficient runtime. The Mono Runtime is known to be slow.<br>
<br>
 Here would be a good place to start with the DotNet Core as they have<br>
nightly arm builds.<br>
<br>
<a href="https://stevedesmond.ca/blog/net-core-on-arm" rel="noreferrer" target="_blank">https://stevedesmond.ca/blog/<wbr>net-core-on-arm</a><br>
<br>
<br>
HTH,<br>
<br>
Russ<br>
<div class="HOEnZb"><div class="h5"><br>
> ______________________________<wbr>__<br>
> Best wishes,<br>
> <a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a><br>
><br>
><br>
> From: Joel Sherrill<br>
> Date: 2017-05-24 20:19<br>
> To: xuelin.tian<br>
> CC: <a href="mailto:rtems-users@rtems.org">rtems-users@rtems.org</a><br>
> Subject: Re: Has anyone tried to port Mono to RTEMS<br>
><br>
><br>
> On May 23, 2017 8:58 PM, "<a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a>" <<a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a>><br>
> wrote:<br>
><br>
> Dear all,<br>
> Is that possible to port Mono to RTEMS? Has anyone tried this before?<br>
> As I notice that there is an open project in RTEMS projects.<br>
><br>
><br>
> Sometime ago, I was asked to provide an estimate for this. It had to be<br>
> between five and ten years ago because we were at the old office but after<br>
> we had done a few years of GSoC. I did enough work preparing the estimate<br>
> where I had the code building without too much effort. I saw the challenge<br>
> as getting the test suite running since you would have to create a test<br>
> harness and build/assembly helper that packaged the interpreted code with<br>
> the interpreter in order to run it. At that time, I envisioned having to<br>
> create a base image and a filesystem image per test.<br>
><br>
> Our POSIX was good enough then to avoid much trouble. It should only be<br>
> easier now since the POSIX support has improved.<br>
><br>
> There were a lot of Mono tests and I expected most to pass quickly. But<br>
> there was no way to know how many issues would be encountered and how many<br>
> root causes there would be. I expected to fix one or two things and then run<br>
> all the tests. That was where I expected time to be consumed.<br>
><br>
> FWIW I recall the GSoC date part because they thought we could magically get<br>
> students to do testing for free on a schedule. :)<br>
><br>
> I hope that helps. It is feasible but the key is testing.<br>
><br>
> --joel<br>
><br>
><br>
> ______________________________<wbr>__<br>
> Best wishes,<br>
> <a href="mailto:xuelin.tian@qkmtech.com">xuelin.tian@qkmtech.com</a><br>
><br>
> ______________________________<wbr>_________________<br>
> users mailing list<br>
> <a href="mailto:users@rtems.org">users@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
><br>
><br>
><br>
> ______________________________<wbr>_________________<br>
> users mailing list<br>
> <a href="mailto:users@rtems.org">users@rtems.org</a><br>
> <a href="http://lists.rtems.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.rtems.org/<wbr>mailman/listinfo/users</a><br>
</div></div></blockquote></div><br></div>