Microsoft during its TechFest held earlier this year showcased a new
operating system kernel concept called 'Singularity'. This isn't going to be a
new version of Windows or DOS, rather it is released to bring forth
possibilities of an operating system that is highly safe and reliable compared
to contemporary OSes. The safe and dependable operating system would mean that
it won't be marred with memory problems like buffer over flow; memory leaks etc.
that result in system crashes. With Singularity, Microsoft has built an OS that
uses .NET framework as a base of its architecture as 95% of the kernel code is
written in C#. Singularity 1.1 Research Development Kit (RDK) was released
earlier this year. Here we will see how Singularity is safe from hackers and how
to deploy this RDK.
How Singularity is safe-OS
The Singularity project has started from ground up rather than being based
on any existing kernel of an OS. The designing of contemporary operating systems
-including Microsoft Windows, MacOS X, Linux, and UNIX-trace their lineage back
to an operating system called Multics that originated in the mid-1960s. The
researchers at Singularity project didn't follow the decade-long tradition of
designing the operating system but took a whole new approach that reflects
today's computing needs and requirements.
Direct Hit! |
Applies To: Developers and Researchers USP: Use of type-safe languages to make secure OS Primary Link: www.codeplex.com/singularity Keywords:Singularity On DVD: PCQ_PROFESSIONAL\ Labs\Singularity |
This prototype operating system is primarily different from other operating
systems because its kernel is almost entirely written in Sing# which is an
extension of C#, a modern high-level programming language. This ensures a
dependable computing environment as C# provides Singularity with security
advantages over contemporary operating systems that have been written in
lower-level languages such as C or C++. By the use of C#, the researchers have
been able to prevent a class of errors known as buffer overruns, thus being able
to eliminate an area of vulnerability that was generally exploited by viruses
and worms.
To improve upon dependability factor of Singularity three key architectural
features have been incorporated. The first is a pioneering concept of Software
Isolated Processes (SIP) that helps protect programs and system services. SIPs
enable programs to be broken down into components that are isolated from other
software components running on the same device. Singularity runs each program,
device driver, or system extension in its own SIP. SIPs are not allowed to share
memory or modify their own code. This enables pieces of a system to fail without
risking a total system failure.
The second architectural feature relates to the fact that a program's many
SIPs need to communicate and share information as they work on shared resources
or on shared objectives. As objectives are shared, there can be situations of
miscommunications happening between the processes. To avoid such
miscommunications that can result in errors and system crashes, the developers
for Singularity project devised a mechanism for communication under which they
defined how the communication should take place between two processes and
through static analysis they checked the codes of the processes at compile time
to ensure any miscommunication of the processes.
To configure the network connection for Loopback Adapter, change it's IP properties with values shown abovel for IP address and Subnet Mask |
The third architectural feature is called as 'manifest-based programs'. The
contemporary OSes do not analyze a program's composition or the resource that it
is going to utilize, being presented with a series of bits, the OS simply
executes them. While in case of Singularity, researchers have emphasized upon
system dependability and because of that each program that is to be executed by
Singularity is checked and analyzed for not breaching or breaking the processes
of the OS.
Thus due to some of these architectural design incorporations, Singularity is
safe and as it's based on .NET Framework it will also be safe from hackers and
will not be having memory problems that results in crashes.
Pre-requisites for installation
With this month's PCQ_Professional DVD we are providing the Singularity RDK
1.1 which is also available for download from the Codeplex site. Within the same
Singularity folder in the DVD you'll also find the requisite tools that are
needed to install and run Singularity. The Singularity RDK zip folder contains
the source code and the tools required to build and boot it. The other tools
required are:-
For installing the complete Singularity operating system, the msb command will build the World.proj |
- Microsoft Debugging Tools for Windows
- Microsoft Virtual PC
- Dot NET Framework 1.1
Before starting up with building and booting of Singularity, you will have to
install all these three tools. If you have a higher version of . NET Framework
installed, Singularity requires CLR version 1.1, so Dot NET framework 1.1 is
required. After installing Virtual PC and . NET Framework 1.1; when you install
the Windows Debugging Tools, you'll have to add the path of WinDbg.exe to the
system variables “path”. Now we can proceed with building and booting of
Singularity.
Building Singularity
Unzip the contents of the Singularity-6709.zip to your local drive. Within
the root directory is a script configure.cmd. When this script is executed from
Windows command prompt it creates the shortcut to launch a shell with the
configuration required to build Singularity. Also create a new environment
variable called as “SINGULARITY_ROOT” and to its path add the path of the
location of the root directory where singularity folder was extracted (for eg.
C:\Singularity-6709).
From the boot directory, bootd command will start the DHCP server and open ports on 10.99.99.1 IP address for loading Singularity's build file |
Now double-click on the Singularity RDK 1.1 icon on the desktop. This will
initiate a command line window that is ready to receive commands and prepare for
building the Singularity OS. The following command will initiate the build of
complete Singularity OS.
msb /t:Clean Distro\World.proj
With World.proj, the build process takes a long time to complete. On our
system having Pentium-4 2.6 GHz processor and 768 MB RAM, the build process took
about half an hour to complete. If you want to build quickly, use Tiny.proj in
the command line instead of World.proj. Once the build process is completed
successfully, you can find the build ISO file in the %SINGULARITY_ROOT%\Base.obj\Distros
folder.
Now before booting this build file we'll have to configure the Loopback
Network Adapter on the Host operating system.
Configuring Loopback Adapter
As we will be using Microsoft Virtual PC to boot Singularity OS, we will
need Loopback adapter that will allow Virtual PC to connect to the host PC for
booting via network. Through the “Add Remove Hardware” wizard the Microsoft
Loopback Adapter can be installed. After the wizard is complete, a new network
connection for loopback adapter gets created on the host operating system. This
new network connection will be having an auto generated name like Local
Connection 2 and having device name of Microsoft Loopback Adapter. Now open its
properties dialog box, and under the General tab select the Internet Protocol
(TCP/IP) and then click its properties. Now in the Internet Protocol Properties
window, select the option “Use the following IP address” and enter 10.99.99.1 as
value for IP address and 255.255.255.0 as value for the Subnet Mask. Leave
Default Gateway and DNS server as blank and click OK to set the properties.
The Windows debugger shows the trace log of the boot process in the Command paneand the “break” command's code can be seen on the debugger |
Booting Singularity
Now when we are having Virtual PC and debugging tools installed, and also
the Loopback adapter has been configured on the host PC we can boot the
Singularity OS on the Virtual PC. To boot Singularity we will first start the
port from which the Singularity build file will be loaded onto the virtual
machine. The following command will do that at the Singularity shell prompt;
cd boot
bootd /dhcp /tftp
Now open a new Singularity 1.1 command prompt and there enter the following
commands.
cd boot
boottest.cmd pxe.vmc
The boottest command loads the ISO image file of the operating system from
the network from the IP address “10.99.99.1”. And just for that purpose only we
started the port on the loopback adapter. The Singularity OS boots up in a new
Virtual PC window.
Now as Singularity does not come with any debugging tools, we had installed
the Windows Debugging Tools separately for that purpose only. To see how we can
start the debugger for Singularity to see how the boot process and all commands
execute, we will have to run the following commands.
cd build
dbg.cmd /pipe
The dbg.cmd command in the build directory sets up the source code, symbols,
and Singularity specific debugger extensions, and then invokes the WinDbg. The
debugger has two parts, one part shows the debug strings which come as trace
logs. The other part shows the code for the command on which you are currently
working. The debugger can be used to navigate through the stack, memory and
current registers etc. to view the source code.
Thus we have built and deployed Singularity OS using a Virtual PC. Now it
would be interesting to see how new possibilities are explored to make this
prototype OS an operating system of the future.