Archive

Archive for the ‘.NET / CLR / C#’ Category

Microsoft Releases Singularity 2.0 Research Development Kit (RDK)

November 18th, 2008

Microsoft has just unleased the initial release of the Singularity 2.0 Research Development Kit (RDK). Singularity is a research operating system started around 2003 by Microsoft Research to write an OS in managed code. The inner-workings of Singularity taken from Wikipedia:

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 extension of C#) and runs in unsafe mode. The hardware abstraction layer is written in C++ and runs in safe 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#, an extended version of Spec#, itself an extension of C#. During installation, Common Intermediate Language (CIL) opcodes are compiled into x86 opcodes using the Bartok compiler.

This new release brings some funky changes:

  • Support for AMD64 64-bit platforms
  • Updates to the Bartok MSIL-to-native compiler and the Sing# compiler
  • A new, more modern and extensible bootloader
  • Several new applications and application documentation
  • Eventing support
  • More extensive ACPI support
  • A unit testing library
  • A ramdisk device
  • An SMB client service
  • Can now check out the most recent version of the Singularity RDK directly from CodePlex source control

Its released under Microsoft’s shared source academic license which in basically means you can do what you like, just don’t make any money out of our hard work.

For convenience there’s even an ISO already baked ready to slap into a Virtual Machine :-)

There are others that deviate from Singularity that tackle the use of a managed operating system slightly differently and I wrote about them a while ago.

.NET / CLR / C#, Developer, Kernel / Internals, Operating Systems, Windows , , , , , , , , , , , , , ,

Going Deep: Inside Windows 7 with Mark Russinovich

October 29th, 2008

If you like discussions about deep internals you’ll most definately have subscribed to the Going Deep series on Channel 9. Today they just released a fascinating interview with Kernel Guru, Mark Russinovich - of Sysinternals fame, who is now a Technical Fellow at Microsoft. One of my favourite books would have to be Windows Internals 4th Edition, and reference it quite frequently. Cant wait for the 5th edition!!!

One very important change in Windows 7 kernel is the dismantling of the Spin Lock Dispatcher and redesign and implementation of its functionality into separate components. This work was done by Arun Kishan (you’ve met him here on C9 last year). The direct result of this great work is that Windows 7 can scale to 256 processors and enabled the great Landy Wang to tune Windows Memory manager to be even more efficient than it already is. Mark also explains (again) what MinWin really is (heck, even I was confused. Not anymore…). MinWin is present in Windows 7.

There are some really interesting topics covered in this video, especially the content behind the scheduler and the thread dispatcher.

Channel 9 Going Deep: Inside Windows 7

Download Offline versions: WMV | WMV HD | MP4 (iPod) | ZUNE

.NET / CLR / C#, Developer, Kernel / Internals, Operating Systems, Security, Windows, Windows 7, software , , , , , , , , , , , , , , , , , , ,

Windows Se7en: So it begins…

October 29th, 2008

Unless you’ve been living under a rock under the Apple tree you would have heard that a little company in Redmond WA has been working on a new version of Windows dubbed Windows 7 (which is what it will actually be called for once!).

At PDC today, Microsoft finally unveiled the much-anticipated release of Windows 7 and handed out pre-beta bits to atendees (tagged 6801.winmain_win7m3.081020-1655). They demonstrated a newer build which was tagged 6933.winmain.081020-184 during PDC which unfortunately was not given out. Unfortunately I couldn’t go due to work constraints, but in case your in the same boat I’ve collected some of the best sources of info out there for you to browse through.

First and foremost, some pretty pictures of the glassy new desktop UI.

Some interesting articles out of the many out there that are recommended reading:

For the pretty screenshots, see galleries here and here. More information and probably a bit more discussion will follow soon.

EDIT:
ArsTechnica have got an updated build reviewed which goes into bit more depth too and NeoWin has posted a nice gallery walkthrough of the Win7 UI and details about Vista SP2.

.NET / CLR / C#, Developer, Operating Systems, Tools / Products, Windows, hardware, software , , , , , , , , , , , , , , , , ,

Microsoft releases Silverlight 2, and OpenOffice 3.0 goes out the door!

October 14th, 2008

A few days ago OpenOffice 3.0 got released after 3 long years of development. You should download a copy and give it ago. To be perfectly honest, because of my MSDN suby’s I never really needed OpenOffice nor did I particularly like v2.x, but v3.0 is a breath of fresh minty air with a ray of bright Sun light beaming down from the heavens. The only times I’ve ever tried was under Linux, and even then I’ve often gone for Abiword instead to avoid the bloat.

It feels far more responsive than the 2.x versions I’ve tried, heck it even loads a helluva lot faster too and doesnt seem to chew up the resources 2.x did.

The Office Word compatibility has improved greatly. Learn more about OpenOffice 3.0 on the Linux Format article.

Then if that wasnt enough, Microsoft today launched Silverlight 2, which finally heads out of beta. Havent had a great deal of time to play with Silverlight but from the demos it looks kick-ass.

.NET / CLR / C#, Developer, Linux/Unix, Operating Systems, Tools / Products, Web / Internets, Windows, software , , , , , , , ,

Mono 2.0 Released today!

October 6th, 2008

Mono has made it to version 2.0 today and brings so much goodness to the table. Some very cool new features and functionality to Mono and promises of speed improvements - which I dont doubt having tried a few things.

From the release notes:

Microsoft Compatible APIs

  • ADO.NET 2.0 API for accessing databases.
  • ASP.NET 2.0 API for developing Web-based applications.
  • Windows.Forms 2.0 API to create desktop applications.
  • System.XML 2.0: An API to manipulate XML documents.
  • System.Core: Provides support for the Language Integrated Query (LINQ).
  • System.Xml.Linq: Provides a LINQ provider for XML.
  • System.Drawing 2.0 API: A portable graphics rendering API.

Mono APIs

  • Gtk# 2.12: A binding to the Gtk+ 2.12 and GNOME libraries for creating desktop applications on Linux, Windows and MacOS X.
  • Mono.Cecil: A library to manipulate ECMA CLI files (the native format used for executables and libraries).
  • Mono.Cairo: A binding to the Cairo Graphics library to produce 2D graphics and render them into a variety of forms (images, windows, postscript and PDF).
  • Mono’s SQLite support: a library to create and consume databases created with SQLite.
  • Mono.Posix: a library to access Linux and Unix specific functionality from your managed application. With both a low-level interface as well as higher level interfaces.

Third Party APIs bundled with Mono

  • Extensive support for databases: PostgresSQL, DB2, Oracle, Sybase, SQL server, SQLite and Firebird.
  • C5 Generics Library: we are bundling the C5 generics collection class library as part of Mono.

Compilers

These compilers are part of the Mono 2.0 release:

  • C# 3.0 compiler implementation, with full support for LINQ.
  • Visual Basic 8 compiler.
  • IL assembler and disassembler and the development toolchain required to create libraries and applications.

Tools

Mono includes profiling tools, the standard development kit tools that are part of the .NET framework

  • Debugger: this is the first release when we support a debugger for managed code.
  • Gendarme: is an extensible rule-based tool to find problems in .NET applications and libraries. Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET) and looks for common problems with the code, problems that compiler do not typically check or have not historically checked.
  • Mono Linker: a linker that allows developers to reduce the size of their executables and libraries by removing features from libraries using an XML definition of the desired public API.
  • Mono Tuner: a tool to apply arbitrary user-defined transformations to assemblies. Mono uses this library to produce the Silverlight core libraries from the main system libraries.
  • Mono Documentation Tools: the Mono Documentation framework has been upgraded to support documenting generics and extension methods. The tools can be used to produce online and offline documentation for any any APIs, and are used by the project to document our own APIs.

There are so many goodies in this release if C# 3.0 with LINQ loving doesnt entice you already and the fact that Mono now provides a complete WinForms 2.0 implementation for OS X & Linux.

Whats cooler is the WebBrowser control powered by Gecko that ships with Mono, this would be an ideal drop in replacement for the MSHTML control.

Implementations of Table Layout and Flow Layout Panels and Big Arrays.

Go ahead and download a copy and give it a whirl. My how Mono has come over the years.

.NET / CLR / C#, Developer, Linux/Unix, Operating Systems, Tools / Products, Web / Internets, Windows, software , , , , , ,

HOWTO: Running ASP.NET 2.0 Ajax Toolkit 1.0.x in .NET 3.5 / SP1 IIS

October 1st, 2008

We had a bit of a dilema at work today, we just sent a version of a web application we’ve been working on for the past few months to staging (testing) to our client. Our client mentioned a move to .NET 3.5 is pending on the boxes there and that they need to ensure the products we ship are compatible. Should be right?

We use the Microsoft Ajax Toolkit throughout the product in question, which is totally rad! The last version thats for .NET 2.0 is 20229 released in late February 2008, however with .NET 3.5 SP1 System.Web.Extensions and System.Web.Extensions.Design are already included which elivates the need to _install_ the AjaxControlToolkit.msi on the server itself. The only thing is that we need to redirect all binding references to the newer 3.5 code by using <assemblyBinding> (within <runtime>) in the Web.Config also known as Assembly Binding Redirection.

Our web-server setup:

Product Setup:

  • ASP.NET 2.0 (3.5 still uses the .NET 2.0 ASP.NET engine)
  • AjaxControlToolkit - v1.0.20229.20821

Compiled with Visual Studio 2005 SP1.

Within the <configuration> elements in the Web.Config file, add the following:


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31BF3856AD364E35"/>
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>

NOTE:
If your developer machines do not have .NET 3.5 SP1 installed then the above lines will need to be commented out as the CLR will fail to attempt to load newer versions.

Thats it! You dont need to update any assemblies or any other Web.Config settings.

.NET / CLR / C#, Developer, Web / Internets , , , ,

The Slick New DeveloperFusion.com is ’soft-launched’

September 29th, 2008

DeveloperFusion.com

DeveloperFusion has just soft-launched its slick new look and feel, go take a looksy and drool. From the humble beginnings, to the golden years and the times of change we have finally come to the slick new Web 2.0 era - maybe a tad late but damn it was worth the wait!

James is now full time at DF working away at making DF the greatest community driven site around.

.NET / CLR / C#, Design Patterns, Developer, Java, Tools / Products, Web / Internets, software , , , , ,

Microsoft will support JQuery in the future!!!

September 29th, 2008

Mondays are always a drag, the weekends over, you have a full 5 days to get through before the next weekend - a steep contrast to my uni days, when all hope was pinned on waiting for the end of semester.

Yesterday Scott Guthrie posted some very exciting news about Microsoft supporting the JQuery project in the future.

I’m excited today to announce that Microsoft will be shipping jQuery with Visual Studio going forward.  We will distribute the jQuery JavaScript library as-is, and will not be forking or changing the source from the main jQuery branch.  The files will continue to use and ship under the existing jQuery MIT license.

We will also distribute intellisense-annotated versions that provide great Visual Studio intellisense and help-integration at design-time.

This is huge news and a very welcome suprise - especially for a Monday.

But wait, theres more:

Going forward we’ll use jQuery as one of the libraries used to implement higher-level controls in the ASP.NET AJAX Control Toolkit, as well as to implement new Ajax server-side helper methods for ASP.NET MVC.  New features we add to ASP.NET AJAX (like the new client template support) will be designed to integrate nicely with jQuery as well.

Can things get any better?

We also plan to contribute tests, bug fixes, and patches back to the jQuery open source project.  These will all go through the standard jQuery patch review process.

Turns out to be a not so bad Monday after all, now if we could just work on the traffic around Melbourne.

.NET / CLR / C#, Developer, Web / Internets , , , , ,

Managed Operating Systems & COSMOS - C# Open Source Managed Operating System

September 21st, 2008

Writing an operating system in Managed Code is not entirely a new concept but its quite an interesting one. The fact that we have AOT compilers gives us this ability to write such things. This post is a little guided tour or information dump on COSMOS as I worked through the initial bits this weekend.

Background Information

Unlike a JIT compiler - where the initial source (say C# or Java) gets translated into an IL (like MSIL in .NET or Bytecode in Java) which then gets to native code when run (via the .NET CLR or the Java VM), an AOT compiler transforms the source directly to native code - which implies its compiled for a specific architecture and feature-set (eg. x86 binary). Currently there are a couple (in .NET land) to choose from - SharpOS AOT and the IL2CPU project written by the Cosmos guys.

This ensures that the OS can be written entirely from managed code, unlike other attempts like JNode, JavaOS (both of which are Java based and include some ASM & C routines for the initial boot) and the Microsoft Singularity project - which uses some Assembler & C (for the interupt dispatcher) and C++ code to get things moving.

Pweety Screenshots

Side by side pretty pictures of some Managed OSs:

COSMOS

This weekend I took a bit of a look-c of COSMOS, which differs greatly from Singularity. The COSMOS compiler - called IL2CPU, written in C# - converts all the IL code generated to assembler (not to be confused with a .NET Assembly!), thereafter the assembler files are processed by NASM which generates compliant native x86 code. Eventually though, the COSMOS guys hope to generate native directly without the need for NASM. This process is quite streamlined and if you download the COSMOS User Kit you can get COSMOS + booted up and running in minutes! Its way coool!

The User Kit page has all the goss on getting it setup, I tried out Milestone 2, but some helpful  hints…

  • Dont install to the default Program Files folder (especially on Vista!) put it into a non-Windows oriented folder.
  • After installing and integrating into VS.NET, use the QEmu option to try it out - VMWare resources arent distributed it seems, as QEmu is already shipped theres nothing more to do.

After you have it installed, load VS.NET and create a new ‘COSMOS Boot’ project. The default template is shown below:


using System;
using Cosmos.Build.Windows;

namespace CosmosHelloWorld
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
var xBuilder = new Builder();
xBuilder.Build();
}
#endregion

// Main entry point of the kernel
public static void Init()
{
Cosmos.Kernel.Boot.Default();
Console.WriteLine("Welcome! You just booted C# code. Please edit Program.cs to fit your needs.");
while (true)
;
}
}
}

Essentially, this boots the COSMOS kernel and displays “Welcome! You just booted C# code. Please edit Program.cs to fit your needs.”, quite simple. Run it and you’ll get the COSMOS Build Options window to help you deploy it - for simplicity select QEMU, hit build and watch the magic of the IL2CPU and other tools come together and build your OS and run QEMU. The output should be something like this (with differing paths ofcourse!):

BuildPath = ‘D:\R&D\Cosmos User Kit\’
ToolsPath = ‘D:\R&D\Cosmos User Kit\Tools\’
ISOPath = ‘D:\R&D\Cosmos User Kit\ISO\’
PXEPath = ‘D:\R&D\Cosmos User Kit\PXE\’
AsmPath = ‘D:\R&D\Cosmos User Kit\Tools\asm\’
VMWarePath = ‘D:\R&D\Cosmos User Kit\VMWare\’
VPCPath = ‘D:\R&D\Cosmos User Kit\VPC\’
Now compiling
Initializing IL2CPU… This may take a minute so please wait for further status…

Recognized Plug methods:

System_Boolean__System_Array_TrySZBinarySearch_System_Array__System_Int32__System_Int32__System_Object__System_Int32__

IL2CPU Run took 00:00:05.3281467
Please wait…executing D:\R&D\Cosmos User Kit\Tools\nasm\nasm.exe…
Please wait…executing D:\R&D\Cosmos User Kit\Tools\cygwin\ld.exe…
Now creating ISO
Try removing ‘D:\R&D\Cosmos User Kit\cosmos.iso’
Try removing ‘D:\R&D\Cosmos User Kit\ISO\output.bin’
Try copying ‘D:\R&D\Cosmos User Kit\output.bin’ to ‘D:\R&D\Cosmos User Kit\ISO\’
Running mkisofs
Please wait…executing D:\R&D\Cosmos User Kit\Tools\mkisofs.exe…
Please wait…executing D:\R&D\Cosmos User Kit\Tools\qemu\qemu.exe…
Press enter to continue.

The Build agent runs IL2CPU which outputs the ASM, which then goes through to NASM who hands it over to GNU Linker. Then we bake an ISO which gets booted by QEMU. Couldn’t be easier :-)

A man can dream Oh yes a man can dream

There are some incredibly exciting ideas are floating around about how to make the most of COSMOS and what can be fully realised on the Scenarios Page and an interview at Obsethryl Labs on COSMOS and another on SharpOS which is interesting reading.

Next time I’ll start poking around some more and see where it gets me.

.NET / CLR / C#, Developer, Java, Operating Systems, Windows , , , , , , ,

New Microsoft Advertisment: Bill Gates feat Jerry Seinfeld - New Family

September 12th, 2008

The next addition to in the series for Microsoft staring Bill Gates & Jerry Seinfeld trying to look normal.

A shorter version is also available with part 1 and part 2 in WMV format. Compared to the first release which took the two gentlement to Shoe-Circus I think this new (longer) version is far better.

“I Love a condiment with Booze in it.” - Jerry

“Because as we discussed, you and I are a little out of it… you’re living in some kind of moon house hovering over seatle like the mothership… I got so many cars I get stuck in my own traffic.” - Jerry

“The fact that a design uses inheritance and polymorphisim doesnt make it a good design.” - Bill
“…Are there any monsters in the story?” - Little kid in bed
“Yes! but its ok, theres a firewall.” - Bill

“Power off… ok, power on.” - Jerry whilst Bill doing the Robot

Personally I quite like this one, and the fact that Mr Gates does the robot - I mean come on….

.NET / CLR / C#, Developer, General, Its My Life, Operating Systems, Tools / Products, Web / Internets, Windows, humour , , , , , , ,