A lot of people assume that MinWin is a Microsoft effort to completely rewrite the Windows Kernel from scratch. That may be based on earlier (limited) explanations about what it does, or it may have a lot to do with people assuming, due to people’s efforts with open source software, that rewriting the kernel will solve all of Windows problems. Well, Mark Russinovich, Microsoft Technical Fellow and guru of all things NT Kernel, attempts to set the record straight in this 45 minute video from Channel 9. Now, the whole talk is about advancements in Windows 7, and has great info about the new event-based model for Windows Services (dunno what took so long on that one, but I’m glad its there now), and other things. but for the purposes of this discussion, you want to jump in at 28:20, which is where MinWin first comes up.
I’m going to attempt to use my Geek-to-Layman Translator to break down what Mark said:
It turns out that Windows Server Core is not a clean separation of the true core of Windows. When Microsoft first set out to make Server Core, they discovered that lower-level systems were dependent on some higher-level calls, which is a no-no in systems design. When they looked deeper, they found out this was happening all over the place. They realized it was going to take too much effort to make a clean break for Server Core, so they literally ripped out anything that wasn’t necessary for the Server Roles they wanted to support. That’s why you’re not supposed to run any other apps on Server Core (or WinPE, as it turns out) because it might make a call to something that doesn’t exist, and it will fail. If it fails low enough, well, that could be bad for the OS.
That system is not scalable or testable in any way, and makes it very difficult to innovatively deliver future iterations of Server Core. So Microsoft started to chart out the entire Windows dependency graph. And as they saw things that started calling up the stack when they weren’t supposed to, they rearranged the APIs to create a clean separation in the OS.
MinWin is the result of that work. It is not a complete rewrite of the kernel, but a reorganization of the APIs, so that components only call down the stack, and not up it. It is isolated in the build tree from the rest of Windows, so it can be innovated on by itself. It is fully bootable, 25-40MB of disk space, and contains the executive systems, memory management, networking, and optional file system drivers. It’s fully testable, and Microsoft is working on a large suite of test cases to run against it. And it *is* indeed in Windows 7.
Mark also said that, though MinWin is finished, their work in this process is not. Now they’ve gone up in the stack, and are looking at where the next boundary needs to be drawn. Apparently, it is part of a much larger effort to reorganize all of the Windows codebase, and keep things clean and separate.
As an aside, for those of you wondering, a lot of the MinWin magic happens in KernelBase.dll. It contains a lot of the functionality that was refactored from Kernel32.dll, so for compatibility with older programs, they left “forwarders” in there that pass the calls down to KernelBase.dll as necessary.
So rejoice, armchair kernel enthusiasts! Microsoft is tidying house inside “Cutler’s NT”, and Windows 7 is the next step (the first being the componentization work from Windows Vista) in the massive decade-long operation to optimize and refactor the Windows codebase.