Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News Return to the Days Of 640K With The .NET Micro Framework

Return to the Days Of 640K With The .NET Micro Framework


The .NET Micro Framework is being positioned by Microsoft for very small devices such as sensors, actuators, and wearable electronics.

Running on as little as 256K RAM and 512K of flash memory, the .NET Micro Framework represents the smallest OS released by Microsoft in over a decade. The beta currently a number of ARM7 and ARM9 processors, even ones without a Memory Management Unit (MMU).

Unlike previous versions of the .NET framework, the Micro Framework is bootable. Or in other words, the runtime can effectively be its own operating system complete with interrupt handling, threading, process management, and heap management. The .NET Micro Framework Hardware Abstraction Layer (HAL) weighs in at a tiny 20 to 30K.

If you run the Micro Framework CLR on the Micro Framework HAL instead of another operating system, there are some limitations. For example, only cooperative multitasking is supported so kernel threads will have to explicitly call yield on a regular basis. The CLR's execution will simulate threading by "offering time-sliced context switching using 20ms quantum".

An extension to Visual Studio will include emulators for a wide variety of platforms and will allow developers to alter features such as available memory and clock speeds.

The assemblies produced by the compiler are not directly usable. Rather than using IL directly, a post-processor converts the binaries into a special format needed by the Micro Framework CLR. This isn't a form of hardware specific machine code, as the CLR interprets it. Unlike other .NET frameworks, just-in-time compilation will not be available.

Reflection will be supported, as will multiple AppDomains. Only single dimension arrays will be supported and the garbage collector is non-generational. Object meta-data is stored on the heap with the object itself so that garbage collection will be faster.

One interesting note is that under omitted features is states, "No virtual tables for method resolution saves RAM". What this means for inheritance isn't spelled out.

Serialization has been reworked to provide very compact representations.

Extended weak references allow objects to pushed to and retrieved from persistent storage depending on memory demands. Objects used this way even survive reboots.

Globalization is supported via resource files. Unlike other .NET frameworks that use strings, this one uses Int16 keys to reduce space. Visual Studio generates type safe code for accessing resources to reduce the change of error.

If performance becomes an issue, individual methods may be written in native code.

A beta program is currently available.

Rate this Article