Linux Distro built on the .NET Framework

630 Views Asked by At

I am a computer science engineering student and I've been programming on the .NET Framework for 2-3 years but I haven't used Linux. I thought, for my final year project, a Linux distro would be good.

I was thinking of a few ways to implement it, when this crazy idea occurred to me:

Can we implement the .NET Framework first on the Linux Kernel and build the rest using it?

This could be the weirdest question but please be give me a way if I am right in asking the question and correct me if am wrong.

7

There are 7 best solutions below

1
On BEST ANSWER

The functionality of the .NET framework is too rich to make sense to build it all on top of a bare Linux kernel without substantial userspace helpers starting with libc. Not impossible, but way too ambitious, IMHO, for a single student's PhD thesis (and much more so if you're aiming at a lower degree than a doctorate).

Look at mono for a Windows-independent implementation of .NET and all it depends on -- and think of how you could reduce (not eliminate;-) userspace dependencies on your own, within your thesis' span, in a fork of Mono of your own (assuming any thesis advisor would sign up to support you in that, of course).

0
On

What makes the Linux kernel run is the c runtime libraries, so add in the mono libraries and other dependencies and I guess it make be possible to get it to work(at least with C#).

1
On

For the first part of your question you might want to checkout the mono project which is an implementation of .net in c#.

As to the second part, I don't know why you'd want to implement the Linux Kernal in .net. It seems like a bit of a backwards way of approaching the thing.

If you're interested in implementing an operating system in c# check out Singularity which is a research operating system developed in c#

0
On

You could try to modify the kernel, that he uses the mono-framework and runs only managed code in userspace.

0
On

you can do this using combination of Visual Studio .NET + Grasshopper. Plase check this linke for more information. http://dev.mainsoft.com/Default.aspx?tabid=45

0
On

The CLR (aka .NET framework) has been implemented at least once on Linux, in Mono.

True, you could make a Linux distribution which ships Mono, or uses .NET for some of its startup scripts / daemons. That would be fine. Someone has probably already done this.

I don't see exactly what advantage trying to run managed code in the kernel would confer, probably none. Running managed code in the kernel would be very difficult because in many parts of the kernel memory allocation needs to be done carefully - you'd probably not have enough control. Moreover, the kernel stacks are probably too small by default etc. There are some contexts in the kernel where heap memory allocation must not be done at all.

0
On

The .NET framework contains a lot of utility classes like strings or collections.

As transitioning from user space to kernel space comes at a cost, performance would actually get worse, unless you manage to run your whole application in kernel space.

Wouldn't wanna do a syscall every time I add something to a list, or check the length of a string.