Posted By: The Channel 9 Team | May 13th, 2005 @ 12:19 PM | 285,787 Views | 109 Comments
MS Researchers Jim Larus and Galen Hunt lead an intriguing project where they've built an OS using managed code. The project is known as Singularity. In their own words:

Singularity is a research project focused on the construction of dependable systems through innovation in the areas of systems, languages, and tools. We are building a research operating system prototype (called Singularity), extending programming languages, and developing new techniques and tools for specifying and verifying program behavior.


Besides Singularity's kernel being successfully written in C# (how cool is that!), there are all kinds of interesting lessons learned with respect to what a managed OS enables. Again, this is a prototype research OS, not a full fledged OS that can run the typical applications you've come to expect of an OS (or even provide a user interface beyond, say, that of DOS).


Enjoy.

Download Size: 168 MB
Media Downloads:
Rating:
1
0

This isn't the CLR.  In our world, we compile entire MSIL for the kernel into x86 instructions at installation time.  There is no libc at the bottom. 

However, we do have around some assembly code.  Like a kernel written in C, our C# kernel needs assembly code to handle the lowest part of the interrupt dispatch on the x86.  But once the assembly code has finished, it dispatches directly into compiled C# (no C).  BTW, there is some C code in the system, primarily for the debugger stub.


In Singularity, you can add new code to your application.  However, instead of loading it into your own process, you load it into a child process.  The OS facilitiates setting up channels between the child and its parent. 

While this is still very much a work in progress, the results so far look promising.  For example, we have a dynamic web server that uses child processes.  Also all of our device drivers run in child processes.
I would kill (or pay) to get my hands on the source code. I am having such trouble learning about OS concepts using MINUX, being able to look at these ideas in C# (or original ideas) would be wonderful. But frankly that isn't going to happen so I'll just move on. Smiley

This type of system has some great potential in areas where you need to be able to rely on the system to be secure and stable. It might not be a speed demon but it is what I would like running on an ATM machine I am using or on the hospital monitor equipment.

figuerres
figuerres
???
Dang! this sounds good... must watch and then comment....  I'd love to see this taken further...

an OS Keneral based on code that has been verifiied and has built in to it some aspects of the managed code ala .net could be the next step in making a much more "Bullet Proof" windows OS later.
Can some similar system to Singularity be implemented as a device driver in the existing NT kernel?  Perhaps the singularity runtime could run all of its code and "lightweight processes" in kernel mode and all calls out of managed code would be simple function calls to normal NT device drivers without changing processes or switching VM spaces. 

Also, singularity has no shared memory;  does it have shared type instances?  Or is the best one can do more like proxy objects?  Does singularity even have a JITer in the kernel (perhaps for application and upper level code)?   

This project seems great!
Charles
Charles
Welcome Change
Beer28 wrote:
comment withdrawn.


THis is not good practice, Beer (replacing a post's text with "comment withdrawn").

C
Charles
Charles
Welcome Change
Beer28 wrote:
I just finished it, at the end Charles commented on the OS having a webserver asking if it "parsed html and stuff." (52:10)
A webserver reads the file off the disk(the document portion of the http request header), optionally shoots it to registered functions of interpreters loaded as modules in it's proc address, like mod_php or mod_perl, or even mod_mono, or does cgi piping(older style) to an interpreter process, then takes that output and throws it back down the tcp line with send(socket,,);
An http server doesn't do any type of document processing on it's own, that's the browser on the client side that parses it, and sets it up for drawing to the client area. That's why the guy came back right away and said "http".


Did you listen to the reply to my vague/misleading question, Beer? That should suffice.

C
It was just lots of edits as he watched the video, very messy, no loss.

Charles
Charles
Welcome Change
Manip wrote:
It was just lots of edits as he watched the video, very messy, no loss.



I don't like the practice of removing what you post because you decide you don't want it to be there any more. Live with what you say. Have some onions and accept it when you look like a fool or whatever. Hey, I do!

C
Microsoft Communities