Puneet Varma (Editor)

Singularity (operating system)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Developer
  
Microsoft Corporation

Source model
  
Shared source

Working state
  
Abandoned

Singularity (operating system)

Written in
  
Assembly language, C, C++, C#, Sing#

OS family
  
Language-based operating systems

Latest release
  
2.0 / November 14, 2008; 8 years ago (2008-11-14)

Singularity was an experimental operating system built by Microsoft Research between 2003 and 2010. It was designed as a highly-dependable OS in which the kernel, device drivers, and applications were all written in managed code.

Contents

Workings

The lowest-level x86 interrupt dispatch code is written in assembly language and C. Once this code has done its job, it invokes the kernel, whose runtime and garbage collector are written in Sing# (an extended version of Spec#, itself an extension of C#) and runs in unprotected mode. The hardware abstraction layer is written in C++ and runs in protected mode. There is also some C code to handle debugging. The computer's BIOS is invoked during the 16-bit real mode bootstrap stage; once in 32-bit mode, Singularity never invokes the BIOS again, but invokes device drivers written in Sing#. During installation, Common Intermediate Language (CIL) opcodes are compiled into x86 opcodes using the Bartok compiler.

Security design

Singularity is a microkernel operating system. Unlike most historical microkernels, its components execute in the same address space (process), which contains "software-isolated processes" (SIPs). Each SIP has its own data and code layout, and is independent from other SIPs. These SIPs behave like normal processes, but avoid the cost of task-switches.

Protection in this system is provided by a set of rules called invariants that are verified by static analysis. For example, in the memory-invariant states there must be no cross-references (or memory pointers) between two SIPs; communication between SIPs occurs via higher-order communication channels managed by the operating system. Invariants are checked during installation of the application. (In Singularity, installation is managed by the operating system.)

Most of the invariants rely on the use of safer memory-managed languages, such as Sing#, which have a garbage collector, allow no arbitrary pointers, and allow code to be verified to meet a certain policy.

Project status

Singularity 1.0 was completed in 2007. A Singularity Research Development Kit (RDK) has been released under a Shared Source license that permits academic non-commercial use and is available from CodePlex. Version 1.1 was released in March 2007 and version 2.0 was released on November 14, 2008.

Similar projects

  • Inferno, first created in 1995, based on Plan 9 from Bell Labs. Programs are run in a virtual machine and are written in Limbo instead of CIL/C#.
  • JavaOS, a legacy OS based on the same concept as Singularity.
  • JNode, an OS similar in concept to Singularity, but with Java instead of CIL/C#.
  • JX, a Java OS that, like Singularity, uses type-safety instead of hardware memory protection.
  • Phantom OS, a managed OS.
  • SharpOS, a former open source effort to write an operating system using C#.
  • MOSA, a .NET compiler and operating system using C#.
  • Cosmos, an open source "building blocks" toolkit for developing an OS using C#
  • References

    Singularity (operating system) Wikipedia