[Mono-devel-list] Small Footprint Mono w/ ASP.NET

Paolo Molaro lupus at ximian.com
Thu Nov 25 09:13:26 EST 2004

On 11/24/04 Ryan Gregg wrote:
> I've recently started working on trying to get mono to build and run on
> an embedded device running a pretty standard Linux kernel.  The only
> problem is that I don't have a lot of physical storage room to keep mono
> in.  I've looked around a little, but is there any documentation for
> mono that indicates the primary requirements for various features?  I'm
> primarily looking to get System.Web and System.IO functionality
> (including xsp) so I can write very simple configuration web pages in
> ASP.NET for the embedded device.
> Should I just start hacking out modules until I find something does work
> or can someone suggest a more definitive approach?  I've only got 4MB of
> space total and obviously the framework can't take all of that up.  Am I
> shooting for a pipe dream here or does anyone think this would be
> possible?

Without any change, the minimal mono is less than 3 MB, 4.5 MB with 
System and System.Xml. Running ASP.NET requires a few more assemblies
and mcs, so you'd end up at about 7-8 MB (you need libc and the
rest of the operating system files you use).
Some of the features can be turned off in the C runtime to save
about 200 KB.
For the managed code, we need a tool that, given a set of executables,
will produce a minimal version of the used assemblies. The best way
would be by rewriting the assemblies with just the methods and
types needed: it would operate directly on the compiled assemblies,
so it would work for managed code compiled from any language.
Another option is to hack the support in mcs (or in the build system)
to exclude some types and methods from compilation: this is likely
much easier to do, but it may not be as effective.
We need a tool to do it, otherwise it's going to be too much 
manual work.
With that amount of storage you'll need to use a compressed filesystem
and probably also dietlibc or uclib: I don't know if anyone tried
compiling mono with those, if they support pthread at all.


lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better

More information about the Mono-devel-list mailing list