views:

153

answers:

6

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.

A: 

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#).

Recursion
+5  A: 

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).

Alex Martelli
Mono is for more operating systems than just Windows (just in case that wasn't clear from the answer).
Mike Chess
+3  A: 

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#

lomaxx
I agree. The correct answer (IMO) is that it is possible to implement *a* kernel in .NET, but not the Linux kernel, which relies heavily on C. It just wouldn't be worth it.
Matthew Scharley
A: 

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

BeowulfOF
A: 

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

Kombuwa
+1  A: 

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.

MarkR