Previously I blogged about running mono on the Intel Galileo board and provided the binaries. I promised the source code and wanted to make good on that. I have uploaded this experiment to github here.
Some Quick Notes on Compiling
At the moment, compiling is sort of a “two pass” deal. I’m sure someone with more gcc experience could make it a single pass, but this method works well.
Once you download the source, more or less follow the instructions here but use the source from my repo: http://www.codeproject.com/Articles/815565/How-to-build-Mono-on-Windows Those instructions will essentially build the mono runtime, compiler and .NET BCLs. The native mono runtime and other native binaries from this output is not compatible with the Intel Galileo, but it does give us valid BCL dlls.
Next open up mono\msvc_minwin\mono.sln. Compile a Release|Win32 or Release_SGEN|Win32. Copy the binary outputs (mono*.exe and mono*.dlll) to your monoinstall\bin folder. Copy your mono installation directory to your device and enjoy.
Quick Notes on the Code Changes
- Added a MONO_MINWIN preprocessor that the msvc projects define. Changes are mostly minimal and are due to win32 apis being removed totally or forced to use the methodEx alternatives. Some functionality is totally disabled until more research on removed win32 apis that have been removed (like EnumProcesses)
- Added mincore.lib and /NODEFAULTLIB:libs to each MSVC project output. mono.props modified also.
- Modified some BCLs that were pointed to advapi32.dll. These were mostly registry p/invoke
- Added /arch:IA32 so the instruction set is compatible with Galileo