Microsoft dropped a mini-bombshell on Monday, announcing that it is contributing thousands of lines of code for inclusion in Linux.

But lest anyone think Microsoft suffered a massive head trauma over the weekend, the code it is releasing isn't really about helping Linux compete better with Microsoft. The drivers are really geared at making Windows a better host for Linux.

"The Linux device drivers we are releasing are designed so Linux can run in enlightened mode, giving it the same optimized synthetic devices as a Windows virtual machine running on top of Hyper-V," Tom Hanrahan, director of Microsoft's Open Source Technology Center, said in a statement. "Without this driver code, Linux can run on top of Windows, but without the same high performance levels."

As noted by CNET Blog Network writer Matt Asay, Microsoft is releasing three drivers for Linux under the GPL that governs Linux.

Although Microsoft has released open-source code in the past, the company has generally favored licenses other than the GPL. That said, the GPL is the way into the Linux kernel and Microsoft wants this code in Linux.

In an article on its press Web site, Microsoft acknowledged the departure. The company has also been going after Linux for years, both on the marketing and legal fronts.

"Today, in a break from the ordinary, Microsoft released 20,000 lines of device driver code to the Linux community," Microsoft said. "The code, which includes three Linux device drivers, has been submitted to the Linux kernel community for inclusion in the Linux tree."

The move comes at a time of mixed signals from Redmond when it comes to Linux. Microsoft has said that the browser-based versions of Office, which are due out next year as part of Office 2010, will support Firefox, bringing at least a portion of Office to Linux for the first time.

It has also made peace with a number of Linux companies, most notably a 2006 pact with Novell, but has continued to rattle its legal saber at those with whom it has not struck patent deals.

After years of making claims that many Linux implementations violate Microsoft patents, Microsoft finally took a case to court in February, filing suit against navigation systems maker TomTom.

The two sides later settled, but the settlement left many unanswered questions and Microsoft hasn't said if it will take similar action against other companies.

Although the latest move is clearly designed to bolster Windows as a hosting environment for servers running both Linux and Windows, to me there is something slightly discordant about adding code to something you feel is already infringing on your intellectual property. Perhaps, though, that's just the very definition of co-opetition.

Microsoft is in an interesting position--seeking to compete with Linux while also understanding that many companies run both operating systems. Not only is it about making its business customers happy, but there is good money to be made by owning the management and virtualization layers, even if there is some Linux running atop Microsoft's stack.

For those that want to hear Microsoft's take on the news, here's a video of Hanrahan discussing the move with Sam Ramji, the company's senior director of platform strategy. (Note: Silverlight is required.)

Get Microsoft Silverlight