Windows Research Kernel @ HPI

news, howtos and labdescriptions

January 30th, 2010

Numbered Queued Spinlocks in the WRK

In a recent post, we covered the implementation of in-stack queued spinlocks, the recommended method to use queued spinlocks in drivers. In this article, we would like to extend the discussion to a second class of queued spinlocks: numbered queued spinlocks. These well-known locks use per processor, pre-allocated memory to store the processor’s queue item. In this article, we will give a short overview over the existing queued spinlocks in the WRK, how they are initialized and how they are used.

Read the rest of this entry »

December 28th, 2009

Queued Spinlocks in the WRK

A few days ago, we came up with a discussion on the advantages of queued spinlocks over normal spinlocks. The biggest advantage in our oppinion is that queued spinlocks guarantee a FIFO ordering among competing processors while normal spinlocks don’t. In this article, we show the implementation of queued spinlocks in the WRK. We present the source code of the 64-bit version for two reasons: first, the 64-bit version contains the implementation in plain C and not in the Assembly language, and second, in the 32-bit version, queued spinlocks are implemented in the HAL, which is not available as source code. The rational behind the implementation remains however the same.

Read the rest of this entry »

November 14th, 2009

Windows 7 and Server 2008 R2 Kernel Changes (TechEd Europe 2009)

Michael and I got the chance to attend TechEd Europe 2009 in Berlin, where Mark Russinovich was giving a great talk about the changes within the Windows 7 and Server 2008 R2 kernels. And although this blog is about the WRK and its details, we thought it might still be valuable to stay up to date with current OSes.

Mark’s talks can also be found on Web: PDC 2009 talk, Channel 9 talk.

For those who don’t have the time for watching the whole 70 minute presentation, here is a summary of the changes:

Read the rest of this entry »

October 26th, 2009

Resolved: A Performance Issue in Windows Timer Management

Two years ago, I wrote an article about spurious timer table entries. Those entries occurred in the global timer table and resulted in unnecessarily scheduled DPCs. During a recent visit in Redmond, I had the chance to meet with one of the Windows kernel developers. By coincidence, he remembered my article and told me that with Windows 7 the issue has been fixed. Here is how they did it.

Read the rest of this entry »

September 30th, 2009

NtCreateThread – memory allocations in kernel mode

In this post we try to determine how much kernel memory is required when creating a new thread. This amount of memory is relevant for the upper bound of the number of possible threads in the system as investigated in detail by Mark Russinovich.

For a starting point we looked at the system service call implementation of NtCreateThread and followed every possible code path down to memory allocation functions such as ExAllocatePoolWithTag.

Read the rest of this entry »

August 13th, 2009

WRK @ HPI First Hit on Bing

Well, it required us some work, but finally it pays off :)

At least on the US version of bing, our blog is the first entry on the result list. As Bing is sometimes strange and does not work properly if you do not set its locale to English (US), here is a screen shot to prove my claim:

Read the rest of this entry »

July 31st, 2009

(SINGLE_)LIST_ENTRY & CONTAINING_RECORD

Lists are a basic data structure in any operating system kernel, e.g. used for thread queue management. The WRK provides a set of struct definitions and list related functions/macros. In this post a short survey of these elements is given.

Read the rest of this entry »

June 30th, 2009

How To: Debug the WRK on Mac OS X Using VirtualBox

This article describes how to configure VirtualBox on a Mac OS X system that allows both developing and debugging the WRK at the same time.

Read the rest of this entry »

May 4th, 2009

Howto: Adding a new kernel module

The Windows Research Kernel contains multiple kernel modules, e.g. for memory management or for the executive layer. Each module has its own subdirectory in base/ntos. If you want to extend the WRK it might be useful to collect all your new files in a new kernel module. This post explains the necessary steps for adding a new kernel module. Basically, all it takes is tweaking a few makefiles.

Read the rest of this entry »

April 6th, 2009

WRK at 2009 Asia Pacific Workshop

Recently, Microsoft Research Asia organized the 2009 Asia Pacific Windows Core Workshop, where universities presented what they are doing with the WRK in their lectures and research.

Clicking on this link provides you with an idea of the projects that are going on in Asia Pacific with the WRK.