Go to content Go to navigation Go to search


C# Operating System
· 2008-02-02 20:27 by Thijs Kroesbergen for Brokenwire.NET

Update: I saw a lot of visitors coming here looking for a method to identify the operating system using C#. I’ve written something down about that too! Please go here.


Just a few days ago the first bootable operating system written in C# has reached it’s first milestone! It’s name is Cosmos (C# Open Source Managed Operating System).

From the official Cosmos page:

Cosmos (C# Open Source Managed Operating System) is an operating system project implemented completely in CIL compliant languages. [...]

Cosmos’ design consists of the following key points:

Currently Cosmos works by compiling IL code (for example it’s shell) to X86 code. This is done by the IL2CPU compiler, which currently emits raw assembly files and puts these through nasm (a free assembler).

Technically this is not the first OS written in C#, Microsoft Research has been working on such a thing before, but that has never been made public. Also (the famous) Scott Hanselman has been working on a (virtual) OS in C# before.

But Cosmos is wide open to the public, if you want to get involved take a look at their codeplex page.

If you want to take a quick look at this gem you can just download the (bootable) .iso and boot that inside a Virtual PC, VMWare or Qemu. A detailed step-by-step guide on using the .iso can be found on the channel8 site.

To be able to do something more "usable" with this OS you can get started using the UserKit. The userkit installs a template into Visual Studio 2008 and using that template you can quickly build on top of the Cosmos base. All this is very well explained on the Cosmos homepage.

Although the current milestone is not yet a very complete OS, it does look like this project has quite some potential. I definitely think this is an exciting project! If this tiny project can create some community support, it could evolve in a very big thing ...

Update (2): Microsoft’s Singularity has been made public.

- Permalink -

  1. I want to write my own operating system.From where i can start,please tell me?

    Jignesh Vasoya    2008-07-22 13:44    #
  2. @Jignesh, creating an operating system is very difficult. here are some tips to get started if you are really interested.: http://search.live.com/results.aspx?q=create+your+own+operating+system&form=QBLH

    — Dan_Defacto    2008-08-21 01:37    #
  3. i want to write a os in c# how to strat plz help me

    ronit    2008-10-23 15:07    #
  4. OMFG! Finaly found it ! dude keep it up and i’ll try to contribute you as soon as I learn more about C# and programming :P

    Good luck!


    Mercurial    2009-02-17 15:12    #
  5. Hello there, I want to know how to make a kernel and what are the things I need to know to get started. Thanks for your support

    Chucks    2009-08-06 11:15    #
  6. i want to write an os in c# using .net platform.Is it possible to write boot sector code using .net.i have heard it is not possible to write system application using .net,is it true?

    felix    2009-08-14 14:55    #
  7. @Chucks & @Felix: Start by studying the work that has been done by the cosmos project. You cannot write a boot sector in .NET because .NET needs a runtime to execute its IL code. The special thing about cosmos is that the OS has the runtime at its core, and everything else is built on top of that.

    thijs    2009-08-22 10:40    #
  8. @thijs – Actually, with all due respect, Cosmos doesn’t really have a runtime. What it really does is compile the C#/IL code AOT into x86 assembly code, using, may I add, a really clever system involving the IL2CPU tool and plugs to take care of all P/Invokes.

    On the other hand, my current project, the blueprint for which you’ll find at the website mentioned above, actually has the .NET Micro Framework run on top of embedded hardware, and executes a microkernel written in C# JIT.

    Rudi    2010-04-07 09:19    #
  9. Sorry, I meant, click on my name, and it’ll lead you to my site.

    Rudi    2010-04-07 09:20    #
  10. Seems like this would be awesome on embedded devices. The only real limitation I can see in this moving foreward big-time would be a lack of driver support. Perhaps there would be an easy way to translate .INFs into classes that can be consumed by callers?

    Mhunter    2010-05-07 09:15    #
  11. Seems like this would be awesome on embedded devices. The only real limitation I can see in this moving foreward big-time would be a lack of driver support. Perhaps there would be an easy way to translate .INFs into classes that can be consumed by callers?

    A?k Büyüsü Nas?l Yap?l?r    2010-06-02 14:51    #
  12. Another one for good start is C# operating system COSMOS.

    One can install a bootable template in a visual studio project and create their own OS.

    Many people have created the GUI version for COSMOS as well.

    You can see the video of simple GUI in COSMOS the link:
    GUI OS in C# .NET

    DizitalTech    2011-05-24 11:14    #
  13. In my considered opinion, C# is scarcely flexible enough to write a web application, at least without having you tear your hair out, let alone an operating system. It is like all the other languages which try to be too high level.

    Leslie    2014-07-02 00:46    #
  Textile Help