Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to boot code written in a managed language?

Tags:

c#

boot

The question says it all. Can I compile C# to native code and boot it? I know of Cosmos and Singularity, but I was wondering if there are more recent techniques or tools. Thanks.

like image 436
Dervin Thunk Avatar asked Jun 15 '11 02:06

Dervin Thunk


2 Answers

Apparently you can compile to native code using Mono:

http://www.mono-project.com/Mono:Runtime#Ahead-of-time_compilation

Still, you won't be able to write an OS with that. Its impossible to write an entire OS in C#, Cosmos and Singularity will have portions that aren't managed code.

Or of course, you can set your code to boot at Windows Startup - .NET applications will run just fine once Windows has booted up to the login screen and beyond.

like image 186
William Lawn Stewart Avatar answered Sep 20 '22 16:09

William Lawn Stewart


What exactly do you mean by "boot it"... If you mean "boot on a machine as an OS" you would need to set up a bootloader and re-write most of the c# functions yourself. You would also have to set up all the machine-specific features from a lower-level language (assembly/c[++]/etc). Basically, there's no way to have it boot by itself without a significant amount of work.

like image 35
Eli Avatar answered Sep 20 '22 16:09

Eli