Embedding Mono

support for the powerpc toolchain
Post Reply
Bloody_Grunt
Posts: 6
Joined: Mon Jun 01, 2009 9:19 pm

Embedding Mono

Post by Bloody_Grunt » Mon Jun 01, 2009 9:35 pm

Hi, I was looking at this:
http://www.mono-project.com/Embedding_Mono
as far as I can tell this makes it so that an independent runtime is not required to run IL produced from .net languages, so I thought about the possibility of using this on the wii. Has anybody tried this already? Would it be a waste of time, etc...?

It would be great to be able to use C# on the wii.
Thanks in advance.

Bloody_Grunt
Posts: 6
Joined: Mon Jun 01, 2009 9:19 pm

Re: Embedding Mono

Post by Bloody_Grunt » Sun Jun 07, 2009 3:32 am

Well, I've been attempting to do this myself, but am a complete linux noob (I didn't want to mess around with Cygwin.), and I'm having some issues with the make file.

In the link I posted above, it says you can just use the following macros in your makefile:

CFLAGS=`pkg-config --cflags mono`
LDFLAGS=`pkg-config --libs mono`

when I try to compile it gives me the following errors:

powerpc-gekko-gcc: pkg-config: No such file or directory
powerpc-gekko-gcc: mono: No such file or directory

I'm guessing this is something related to my Path variables, can anybody give me some help on what to do here?

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Embedding Mono

Post by WinterMute » Sun Jun 07, 2009 10:57 pm

You need to port the mono runtime to Wii before you can use it. This is unlikely to be done any time soon.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Bloody_Grunt
Posts: 6
Joined: Mon Jun 01, 2009 9:19 pm

Re: Embedding Mono

Post by Bloody_Grunt » Sun Jun 07, 2009 11:38 pm

The idea of embedding mono is to remove the need for the runtime altogether. It's actually bundled with the program, which adds some overhead and bloats the program, but I'd say the trade off is worth it.

Besides which, there actually is a mono implementation for the wii, but it's available for only for commercial wii developers.

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Embedding Mono

Post by WinterMute » Mon Jun 08, 2009 11:25 am

The embedded runtime is the runtime. It's simply a static library which needs to be ported to the Wii. The version available to commercial developers is irrelevant unless someone can obtain the mono patches.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Bloody_Grunt
Posts: 6
Joined: Mon Jun 01, 2009 9:19 pm

Re: Embedding Mono

Post by Bloody_Grunt » Mon Jun 08, 2009 5:19 pm

You are correct, the mono that gets embedded would have to be able to run on the wii. Thanks for your reply and help.

migueldeicaza
Posts: 2
Joined: Tue Jun 09, 2009 3:58 am

Re: Embedding Mono

Post by migueldeicaza » Tue Jun 09, 2009 4:15 am

To be honest, I do not know much about devkitPro or what it does, I just found this on a Google's group search while searching for Mono.

What I can say is the following: although Mono's port to the Wii is only available for licensed Wii developers, Mono's code has been properly isolated so that porting it to other environments is relatively easy (porting it to embedded operating systems, and non-Unix systems). This is achieved by excluding parts from Mono's build and writing replacements for some routines.

For example consider the file mono/mini/mini-posix.c. That file is used in POSIX systems, but if you do not have a POSIX system, you would replace this during build time with a different mini-FOO.c

Mono's trunk code has been ported to a few non-POSIX operating systems, so the code is known to work in this mode, it is just going to take some work.

Although you can use mkbundle, this is mostly a Unix wrapper around the actual embedding API (run mkbundle --keemtemp to see the temporary files generated).

Bloody_Grunt
Posts: 6
Joined: Mon Jun 01, 2009 9:19 pm

Re: Embedding Mono

Post by Bloody_Grunt » Wed Jun 10, 2009 2:55 am

Wow, thanks for the reply. It's nice to see the creator of mono taking interest in the "little people"

devkitPro, specifically devkitPPC lets you target the wii for use in homebrew.

I'm not too sure whether the Wii is a POSIX system, it might even be proprietary Nintendo. Still, the fact that there is an a official mono for the wii gives me hope. I'll try compiling the Mono sources using devkit when I get some time.

As far as mkbundle goes, is it possible to bundle a program from a different platform/architecture to another. For example if I was on Linux but wanted to bundle a program for Windows, could I do that without compiling myself?

migueldeicaza
Posts: 2
Joined: Tue Jun 09, 2009 3:58 am

Re: Embedding Mono

Post by migueldeicaza » Wed Jun 10, 2009 6:02 am

Sadly, no.

mkbundle merely does the equivalent of embedding your application in a sample C program and then links that with the libmono library. So the result is a self-contained piece of software, but it will only run on the same system that it was compiled on.

The portability layer comes at the ECMA CIL level, that is the bytecodes that are encoded in the DLL/EXE file.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests