[Mono-dev] Best practices for porting Mono, and a couple of questions
Ben Carter
benml at saillune.net
Thu Aug 2 16:20:14 UTC 2012
Hi,
I'm new to this ML, so I hope that this isn't an FAQ or anything, but
searching the archives didn't turn up much in the way of answers so
fingers crossed...
I'm currently looking into porting Mono to an ARM-based embedded system
that sadly doesn't have much of a POSIX layer. Therefore, as far as I
can tell, there are three main areas of the code that I need to touch
(leaving ABI stuff off to one side for the moment):
1) eglib
2) pthreads (since it's used in lots of places, it seems easier to write
a pthreads-compatible wrapper than try to change the code to use the
native threading API)
3) io-layer
Now, the first couple of those are fairly straightforward, but the
third has me a little confused - specifically, the current io-layer
seems to be a mix of support code for various OSes (Win32, Linux and
OSX, primarily) with #ifdefs to sort it all out. However, that is
presumably because those all share enough common posix-base code that
the advantages of keeping them together outweigh the disadvantages...
Thus, for this new system, my instinct is that I should be creating an
entirely new io-layer directory and writing all the necessary code
there. However, I can't see any obvious way to switch the build process
over to using an alternative directory (other than replacing the
existing one)... is there something I've missed that allows swapping
OSes within a single source tree, or is the assumption that each OS
should have its own branch with a unique copy of io-layer?
(or am I barking up the wrong tree entirely here... would it be simpler
to write some posix emulation wrapper code in the same way that I'm
handling pthreads?)
On a slightly different topic, I found a post from a few years back
about porting Mono to a new OS (http://www.skyos.org/?q=node/464) that
mentions mmap being a requirement. Thus far I've yet to spot anything in
the current source code that looks like it would fail critically without
mmap, but again I could be missing it entirely - does anyone know if
lack of it will cause insurmountable problems?
Any information on these or indeed advice on porting strategy in
general would be very gratefully received - many thanks in advance!
--
Ben Carter - ben at saillune.net
More information about the Mono-devel-list
mailing list