Five years after it began work on Singularity, an operating system research project focused on constructing dependable systems, Microsoft has released a research development kit (RDK) to the academic and research community.
The terms of the license make Singularity free software, not open source software.
Singularity is written in Sing#, an extension of C# that “provides verifiable, first-class support for OS communication primitives as well as strong support for systems programming and code factoring. The sound verification tools detect programmer errors early in the development cycle,” its developers said.
Two other operating systems, COSMOS and SharpOS, which are also written in C#, were recently released.
Both of these are open source.
Singularity is “a research project focused on the construction of dependable systems through innovation in the areas of systems, languages, and tools,” the developers, Galen C. Hunt and James R. Larus, said.
The research project was “extending programming languages, and developing new techniques and tools for specifying and verifying program behavior,” they added pointing out that advances in languages, compilers and tools make it possible to significantly improve software.
C#, in which Singularity was written, executes only verifiably safe programs; Singularity’s kernel and runtime libraries are the only parts that contain unsafe code, and even then most of the code there is written in C#.
Singularity achieves good performance “by reinventing the environment in which code executes,” the developers said, pointing out that, while existing systems have safe code fenced off with its own collection of services, Singularity “has architected a single world in which everyone can be safe, with performance comparable to the unsafe world of existing systems.”
Singularity processes start empty and add features only as required, unlike current language runtimes, which come with huge libraries and expressive, dynamic language features such as reflection, all of which incur massive overhead.
Singularity uses type-safe languages and an abstract instruction set to enable what the researchers call Software Isolated Processes (SIPs).
SIPs “provide the strong isolation guarantees of operating system processes — isolated object space, separate garbage collectors and separate runtimes) without the overhead of hardware-enforced protection domains,” the researchers said. In the current Singularity prototype, SIPs are “extremely cheap.”
Because SIPs are so cheap to create and enforce, Singularity runs each program, device driver or system extension in its own SIP and SIPs are not allowed to share memory or modify their own code, so “we can make strong reliability guarantees about the code running in an SIP,” the researchers said.
Dependability and Trustworthiness
Singularity was designed from scratch, and the researchers followed three guidelines to offer improved dependability and trustworthiness.
First, they used safe programming languages exclusively, which “eliminates many preventable defects such as buffer overruns.”
A buffer overrun or overflow results when a process tries to store data beyond the boundaries of a fixed-length buffer. The extra data overwrites adjacent memory locations, and can cause erratic program behavior, a memory access exception and termination of the application (also called a crash), or a possible breach of system security, if it was deliberately caused by a malicious user. Buffer overflows cause many software vulnerabilities and form the basis of many exploits, or hacker attacks.
Next, they used sound program verification tools to “further guarantee that entire classes of programmer errors are removed from the system early in the development cycle.”
Finally, the improved system architecture of Singularity “stops the propagation of runtime errors at well-defined boundaries,” making it easier to achieve robust and correct systems behavior.
Correcting Current Problems
The Singularity project was launched in 2003 to “re-examine the design decisions and increasingly obvious shortcomings of existing systems and software stacks,” the researchers said.
The move to a new direction is not surprising: “Microsoft said from the beginning of the multi-core era in 2005 that new programming models and a new generation of engineers trained on these models would be required to support these multi-core environments,” Jim McGregor, research director and principal analyst at In-Stat, told TechNewsWorld.
“This sounds like a step in the direction of such a programming model to allow multi-core and virtualized environments. Microsoft’s big play is to get out of the OS business and into the Internet portal and content business,” McGregor added.
A New OS, Perhaps?
Will Singularity be the operating system that replaces Windows?
No; Microsoft has already clearly said it is a research project. Windows 7, the next version of the Windows platform, which will be the successor to Windows Vista, has its own kernel, MinWin.
That doesn’t mean Singularity won’t be used in future by Microsoft: “Singularity appears to be a research project to test out ideas that might be useful in future operating systems,” Dan Kusnetzky, principal analyst at The Kusnetzky Group, told TechNewsWorld.
“It clearly is not an operating system that is ready for production work today.”
More to the point, it’s unlikely that a new OS would catch on readily, even if it were designed to eliminate many of the problems current operating systems cause.
Most data centers run applications on many different operating systems that were written in many different computer languages, and it’s “unlikely that organizations would rehost what they were doing to a new operating system now” because the cost and workload for doing so would be prohibitive, Kusnetzky added.