Linked by Thom Holwerda on Fri 8th Feb 2008 22:47 UTC
.NET (dotGNU too) "Developers are working to create experimental open-source operating systems with modular microkernels using the C# programming language. The SharpOS and Cosmos projects both announced their first major milestone releases last month, demonstrating the technical viability of the concept. Although some previous research has been conducted in the area of VM-based operating systems, the Cosmos and SharpOS projects break a lot of new ground. One particularly notable prior effort in this field is Microsoft's Singularity experiment, a research project that that began in 2003 with the intent of creating a managed code operating system that uses the Barktok compiler and leverages static analysis and programmatic verifiability to ensure high dependability."
Thread beginning with comment 300188
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE[3]: C#...OS?
by google_ninja on Sat 9th Feb 2008 16:25 UTC in reply to "RE[2]: C#...OS?"
google_ninja
Member since:
2006-02-05

Sorry, I should have said 40 years (I wasn't really thinking). A longer timeframe actually supports my argument though.

The basic difference is that the transition from assembly to C had huge advantages, and minimal (if any) disadvantages. They ran no slower, but were much easier and faster to develop, didn't require rewriting for new architectures, and so on. Most importantly, an OS written in C would be compatible with the same OS written in assembly, and would be able to run existing applications, or have existing applications adapted to it.


You are wrong here. They ran way slower. But it was a higher level, and more importantly, a portable language. C was the big, revolutionary thing UNIX had going for it when it came out. K&R kind of decided that the machines were fast enough at that point that the additional cost in performance was outweighed by the numerous advantages.

here is a quote from the UNIX wiki

In 1973, Unix was rewritten in the C programming language, contrary to the general notion at the time "that something as complex as an operating system, which must deal with time-critical events, had to be written exclusively in assembly language".[4] The migration from assembly language to the higher-level language C resulted in much more portable software, requiring only a relatively small amount of machine-dependent code to be replaced when porting Unix to other computing platforms.
(http://en.wikipedia.org/wiki/Unix#1970s)

Using something like C# offers more advantages (mostly in regard to safety and potential security, with a very small possible speed advantage), but crippling disadvantages - basically, it's incompatible with every piece of software developed over the past 40 years, and it's nearly impossible to adapt existing code to run on it.


I'm not quite sure what you are talking about here. it is very easy to work with C code in C# (here is a site that gives you method signatures for most of the common windows APIs http://pinvoke.net/). What C# has going for it over C is improved security, stability, interoperability and theoretically, portability. The price you pay is some additional overhead at runtime for actually managing the process.

The argument isn't about interop, it is about performance.

Edited 2008-02-09 16:30 UTC

Reply Parent Bookmark Score: 4

RE[4]: C#...OS?
by Nelson on Sat 9th Feb 2008 18:04 in reply to "RE[3]: C#...OS?"
Nelson Member since:
2005-11-29

Speaking purely from the point of view from a Managed OS, I'd say you lose said advantages when you start P/Invoking unmanaged code.

The ideal situation would be to disallow non-managed code completely.

Reply Parent Bookmark Score: 2

RE[5]: C#...OS?
by google_ninja on Sat 9th Feb 2008 19:23 in reply to "RE[4]: C#...OS?"
google_ninja Member since:
2006-02-05

That is true, but the parent implied there is no way to interop with older C stuff.

Reply Parent Bookmark Score: 1

RE[5]: C#...OS?
by PlatformAgnostic on Sat 9th Feb 2008 19:45 in reply to "RE[4]: C#...OS?"
PlatformAgnostic Member since:
2006-01-02

Singularity also provides HIP (Hardware Isolated Processes) that can be used in lieu of SIPs to isolate native code from the kernel and other programs. So it is entirely possible to use native code in the place of garbage-collected managed code.

OTOH, managed OSes are hopefully going to bring us to a day when we can forget about TLBs, virtual memory protection, and all the other costly artifacts of unsafe languages. Computers could become about 10-20% more efficient at accessing memory if they didn't have to go through the whole virtual-to-physical translation that's necessitated by allowing pointers as data elements. Compatibility in this world would be maintained by just having one or two compatiblity cores on the machine running a hypervisor or VM with the old OSes. An OS distributed as bytecode would also allowspecialization of the software at the end-user's machine, making the particular ISA of a processor matter a little less as long as it meets the needs of the program.

Reply Parent Bookmark Score: 3

RE[5]: C#...OS?
by modmans2ndcoming on Sun 10th Feb 2008 23:17 in reply to "RE[4]: C#...OS?"
modmans2ndcoming Member since:
2005-11-09

managed code in the kernel can work fine with unmanaged code in userland. As long as the kernel space is protected it will be hard for a buffer overun to cause problems system wide.

Reply Parent Bookmark Score: 1