Register
Home Projects Help

Draft Publicity Article

This is a draft of an article written by William Lahti for promoting the SharpOS project once our first milestone release is out. We aren’t sure yet where we will post it, nor is the release done yet, but please do not submit this article to any news sources as exclusivity DOES apply for many news site. Feel free to add comments or edit as you see fit, and I (Will) will do a basic final editing before submitting it to a proper news site (we’re thinking OSNews would be an appropriate venue).

SharpOS: We are the Chicken And The Egg

William Lahti <>

Only one year and two months ago, a seemingly harmless discussion was occurring on the mono-devel mailing list about how an operating system written in C# would look. The posters loosely referred to the idea as SharpOS: a project to create an entire operating system using only code written in the C# language. In a way, the project was the community’s response to Microsoft’s Singularity project, which had a somewhat similar goal, but without the requirement to produce the OS using only C#. Singularity was also not open source, which left development completely out of the hands of the people in the open source community who were interested in this kind of development.

The thread started small but quickly grew big, certainly with the side effect of disrupting normal development discussions for Mono. Michael Schurter, who saw a clear demand for a project to work on this sort of thing quickly registered the ‘sharpos.org’ domain and started a mailing list there for us to talk about it. It did the trick of getting these philosophical ranters out of the Mono developers hair, but it also launched a project that would slowly march toward its goal of creating this beast.

In the beginning there were rants. Rants upon rants, followed by additional rants—which were replied with more rants. We discussed and talked and flamed and went in circles in general. A theme began to emerge: we were fighting conceptual dilemmas that we called “Chicken and Egg” problems. If the mission of the project were to create an OS using only C#, and C# required a runtime, then what came first? The Runtime or the C#?

There were two directions being considered, both supported by various members of SharpOS. We could drop the C#-only requirement and write/adopt a Common Language Runtime written in an unmanaged language, or we could (as some called it) “pervert” C# into working as a low-level language. Or, at least that was the debate. As it turns out, C#’s existing low-level facilities were more than enough to get the job done. We took the latter, keeping C# as our exclusive language and writing the low level guts using a C# that spoke in pointers, structures, and allocations. In order to actually be able to run this low-level C# though, we would need to be able to convert IL (the platform-independent magical format used by the CLR and .NET) to native machine code that could be run without any operating system at all.

There was a problem though. We had just stuck a bunch of high-level object-oriented programmers into a project where acute understanding of assembly and operating system kernels was needed. Most of us knew not how this fabled AOT would look. Luckily two brave souls (first Johann Macdonagh and shortly thereafter, Mircea Cristian Racasan) began work on their own ambitious AOT options. Once the two were aware of each other’s projects, the other members of the project figured it would be wise for the two developers to decide among themselves which solution would be endorsed and developed by SharpOS. Johann conceded to Mircea for the time being as his was farther along in development, despite some architectural differences.

Once the AOT was at a level capable of producing a kernel, then we began writing the kernel itself. It started with the obligatory Hello World, evolved into a text mode interface, added some CPU information code, interrupts, architecture-abstraction, utility code, console input, memory management, serial ports, basic scheduling, and more. At first there were difficult limitations with the AOT, for instance for a long time strings in the kernel needed to be wrapped with Kernel.String() so the AOT could convert the string literals into byte*, such that they could be used and compared properly without any objects involved. However, later native support for ‘string’ constants removed the need for the Kernel.String() function (phew).

We decided that our first milestone would be a proof of concept to show that creating a kernel in C# using our new AOT is not only feasible, but within arms reach. Our kernel would have a demonstration shell, that would allow the user to poke around and interact with the kernel in various ways. Thanks to the contributions of many excellent developers we have completed this goal, and it is now possible to obtain the first milestone release of SharpOS from our (project website—link here). Project participation is on the rise and SharpOS is entering a new level of growth with more areas than ever available for developers to contribute.

The road ahead winds beyond the horizon though, as we are only now to the point that development of full object support in the kernel is possible, and up to this point we have been using a subset of C# that we refer to as EIC, using pointers, structures, and static classes to do the job. We have implemented an architecture abstraction interface so that both our AOT and the kernel can support multiple architectures if we decide to develop such support, but this interface needs to be further refined and tested by actually implementing more architectures. This is still an enthusiast platform, offering around 0% actual end-user value, but one day that will change and SharpOS will take over the world! For now, though, you can view our main site at sharpos.org, and we keep our Subversion repository with our SourceForge.net project.

If you want to see SharpOS in action, but don’t have the time or bandwidth to download it and run it for yourself we posted a few videos on YouTube. We recommend you start with the first installment, which was a preliminary console demonstration. For those of you who are itching to play around with it you will find all you need to know in our end user’s guide. Most importantly, enjoy!!!

Export to HTML, TXT