Windows 7 and the 64-bit computing era

Windows 7 is a successor of Windows Vista. This is because although Windows Vista has many new technological advantages, it is not at all successful in the market. There are many reasons behind the failure in the market. The first thing is that it consumes too much resources. The second thing is that when it was released, Microsoft did it too eagerly so it contained a lot of problems, and these problems were not solved until SP1, and that's why Windows Server 2008 is released with SP1 --- there is no RTM version. Another sad thing is Jim Allchin left the team soon after the launch of Windows Vista. Windows Vista was released in year 2007, and 1GB RAM desktop machines only began to be popular.

Windows 7, on the other hand, has succeeded in the market. It is actually an enhancement over Windows Vista, but it is different from Windows Vista --- many people were relunctant to upgrade from Windows XP to Windows Vista, because Vista consumed too much resources. However Windows 7 uses 2/3 the amount of resources as Vista, and by the time Windows 7 is released, hardware are also cheaper, making it easier to find a computer that runs Windows 7 well. Windows 7 was released in year 2009, and 2GB RAM desktop machines were popular by then.

As Microsoft releases the server version Windows together with the client version, Windows Server 2008 R2 is the server counterpart of Windows 7. Unlike Windows Server 2003 R2, which is merely new services on Windows Server 2003, Windows Server 2008 R2 is a new platform, not using the same base as Server 2008. Server 2008 R2 only has 64-bit editions, while Windows 7 is still released with both 64-bit and 32-bit. Newest Intel CPUs all support 64-bit, so it's a good choice to try out the 64-bit edition if the RAM is 4GB or more.

Let's examine in what aspects Windows 7 64-bit differentiates from older versions:

Major Kernel Changes

64-bit is supported. The first time PC applications changed was 16-bit (20-bit with long pointers) address space to 32-bit address space. On Intel platform this means we raised application memory from 1024KB space to 4GB space, and at the same time, the 4GB address space is virtualized --- that's virtual memory. However, with hardware configurations today, 4GB is also not enough. Thus IT companies worked out 64-bit address space solutions, which allows 16EB RAM, an amount you needn't worry about within 50 years to come. Remember that IBM already had the idea of 64-bit computers years ago --- because they do mainframes. With 64-bit, there are some differences. I'll talk about them later in this article.

Better multi-core and NUMA support. Windows 7 enhances its locking mechanism in multiple-CPU environment, optimizing the algorithm, resulting in less contention and thus higher concurrency. In 2006, Microsoft bought a computer with 2TB RAM and 64 cores (see on Mark's blog), and perhaps that computer was used for such testing. Of course there are also other computers with 8 cores or more for performance testing.

Better ReadyBoost performance. I heard about it, though have not tried it out yet. If you have Windows 7 and a USB thumb drive, why not give it a try?

MinWin is used. MinWin is a core of Windows 7 kernel. In an interview with Mark Russinovich, he mentioned MinWin is a 25MB binary, and consumes 40MB RAM when launched. MinWin is a modularized Windows kernel. This is because in previous versions, the Windows DLLs have some hard-wired calls from lower-level to higher-level, making it hard to be modularized. MinWin eliminates these low to high calls and re-factored the code to make them cleaner. This is good for future development of Windows. Note that MinWin is not Server Core (a concept since Server 2008).

Side note - Server Core. Server Core is a simple Windows Server system with bare services and management tools, making it suitable for a server, but not suitable for a client. Server Core is about 2GB in size. Many client applications are not found in it, such as Internet Explorer, Windows Explorer, etc.

64-bit changes

Firstly, on Windows 64-bit, 32-bit applications are still supported. They're hosted inside a virtualized environment called WOW64. For 32-bit applications, there are 32-bit Windows DLLs for them to use. These 32-bit DLLs use 32-bit pointers and 32-bit handles, but since some of them need to call 64-bit APIs, there must be a conversion mechanism between them. According to Microsoft, Wow64.dll is the core dll that implements such interface. Wow64win.dll provides API entry points for 32-bit applications (not sure what it exactly contains yet, all APIs? Or virtualized system calls?). Wow64cpu takes care of switching the CPU from 32-bit to 64-bit mode. To see what applications are 32-bit, you can open Task Manager. 32-bit processes are postfixed with "*32". For more information, see articles: AMD article 1 and AMD article 2.

16-bit applications are not supported in the x64 architecture when the OS is 64-bit. They are supported if the OS is 32-bit.

For native 64-bit applications, they use 64-bit pointers and 64-bit handles. Thus their memory consumption are usually higher than 32-bit applications that implement the same functionality, because there needs to be more space for these pointers and handles. However, since 32-bit applications are virtualized, the virualization layer itself will consume some memory. That's why the 64-bit edition Windows 7 is not recommended unless you have more than 3GB RAM.

There is file system and registry virtualization for 32-bit applications. Firstly, since 32-bit applications need DLLs in the System32 directory for system APIs, the System32 directory is virtualized. This is because 64-bit applications, with backward-compatibility consideration, still use the same directory for DLLs. The real directory for 32-bit applications is SysWOW64 under %SystemRoot% directory (by default C:\Windows), but the virtualization layer makes 32-bit applications see the directory as System32. A similar registry virtualization is done through mapping HKLM\Software to HKLM\Software\WOW6432Node for 32-bit applications. If you really want to see the real System32 directory from a 32-bit application, use the directory name Sysnative. There are two versions of cmd.exe existing in the system, one 64-bit version and one 32-bit version. Don't confuse them because the 32-bit version reflects different environment variables (such as pointing %ProgramFiles% at "C:\Program Files (x86)") and launches 32-bit tools from the SysWOW64 directory.

32-bit applications are installed under "C:\Program Files (x86)". However this directory path is not virtualized. If an application has both 64-bit components and 32-bit components, it's well OK to install it under "C:\Program Files". Note however, that 32-bit DLLs and EXEs work together and 64-bit DLLs and EXEs work together, but you cannot mix them. To communicate with a different word length application, you can use IPC mechanisms. Currently, 64-bit Windows uses only 32-bit handles (but they're sign-extened to 64-bit when a 64-bit application uses them). All three types of handles (user, GDI and kernel) are implemented this way. RPC can be used. COM local servers can be used if both 32-bit and 64-bit DLLs are registered for all interfaces used. Shared memory can be used. CreateProcess() and ShellExecute() APIs can be used but they have some limitation. Source: MSDN article.

Because Windows Explorer is a pure 64-bit application, it doesn't support loading 32-bit shell extensions. Thus, if you use applications with shell extension features, their shell extensions won't work. However, as there are still a lot of 32-bit ActiveX controls for Internet Explorer, Microsoft released it in both 32-bit and 64-bit versions.

Hyper-V virtualization server and Windows VPC

One important addition in Windows Server 2008 and Windows Server 2008 R2 is Hyper-V. Hyper-V is the virtualization host developed by Microsoft. Before Hyper-V there were Virtual PC and Virtual Server, but they are not as powerful as Hyper-V is. Hyper-V supports virtualizing an x64 CPU, and it's much faster than Virtual PC in kernel mode operations and disk I/O. In order to achieve the high performance, Hyper-V requires hardware-assisted virtualization (HAV) support in the CPU, such as Intel VT and AMD-V.

Hyper-V is not as good as VMware in the kinds of operating systems officially supported for virtualization. Hyper-V focuses on Windows operating systems since Windows 2000. Recently Hyper-V also added support for RHEL (RedHat Enterprise Linux). But the systems that Hyper-V supports best are Server 2008 and higher, because Hyper-V was shipped with Server 2008, and Server 2008 itself is equipped with Hyper-V integration services in it, so when it is used as an OS in a Hyper-V V1 virtual machine, it automatically enables the integration services.

Server 2008 needs 2GB RAM to run well. Thus when Hyper-V is used to virtualize it, the host computer should have 4GB or more RAM. Once in a while, I used servers with 16GB RAM to run Hyper-V, and it ran quite happily. With Hyper-V, dynamically-expanding VHDs (virtual hard disk files) have more advantage than fixed-size VHDs. This is because when Hyper-V compacts a VHD, it doesn't need to copy the data from the original VHD file to another VHD file. It does the compaction in-place, which is quite convenient. In addition, for partitions of the NTFS file system in the VHD, Hyper-V recognizes the file system structure and you don't need to run a pre-compact tool to zero-fill the free space before compacting. However you're still recommended to defrag the partition inside the VM before you compact it if you want the smallest size. Remember not to defrag unless you will do compaction right away, because it will temporarily use up a lot of space. Also don't defrag unless you have enough free space in your physical disk.

If the virtual machine uses Server 2008, the need for VHD compaction is reduced because when Server 2008 is run inside a Hyper-V VM, it tries not to scatter files around. To compact a VHD, the VM must be shut-down first. I still hope that Hyper-V supports online compaction so that I don't need to shut down the VM.

Virtual machine memory overcommitment is not supported until Hyper-V V2 SP1 (coming with Server 2008 R2 SP1). However as this feature is not quite useful, you can often ignore it.

To provide users more compatibility with old applications, Microsoft released Windows Virtual PC and Windows XP Mode --- free downloading for Windows 7 Professional, Enterprise and Ultimate editions. It is a Windows XP running inside Windows VPC. Note that Windows VPC uses different integration services than those in Microsoft Virtual PC. Windows VPC supports Windows XP Mode well, but if you want to run older systems such as Windows 2000 or Windows NT 4.0, I still recommend Virtual PC 2007 SP1. Note that you cannot install both products at the same time, otherwise Windows will report compatibility problems with Virtual PC 2007.

A side note: how to enable Superfetch on Server 2008. To enable Superfetch on Server 2008, browse to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\PrefetchParameters]. Set "EnableSuperfetch"=dword:00000003 and "EnablePrefetcher"=dword:00000001. Credit of Aaron Tiensivu.

Maturer WPF, WCF and WF

With the advent of Windows 7, Visual Studio 2010 and .NET Framework 4.0, WPF (Windows Presentation Foundation), WCF (Windows Communication Foundation), WF (Windows Workflow Foundation) and Windows CardSpace are better supported.

At a first glance, WPF supports declaration-based UI, like a more advanced Windows resource compiler (RC) but with XML format and new UI elements. Of course, it still supports programmatic creation and manipulation of UI elements.

WCF unifies and purifies the interface for cross-process communication, unifying Web-services, TCP.Net, named pipes, MSMQ, etc. The benefit of using WCF is that it unifies all communication mechanisms. But the price is that its configuration is much more complicated. WCF contracts are more restricted and standardized than ASP.NET Web Services WSDL specifications, so not all Web Services can be called from WCF, but all WCF Web Services can be called by clients supporting WSDL.

WF allows an application to present to the user the design of a workflow, and execution of a workflow.

CardSpace is identity management. It manages smart card identities as well as domain users. It supports other kinds of digital certificates (such as X.509 certificate), too. Its purpose is to provide securer Web log on --- no longer based on user name and password.

As I'm not quite familiar with the topics yet, I'll keep this part empty for now.

A little bit code names: Visual Studio 2002 was called Rainier, which is a mountain near Seattle. Visual Studio 2003 was called Everett, which is a city about 60 km to the north of Seattle. There were many woods there when I visited it in year 2008. Visual Studio 2005 was called Whidbey, which is north to Everett. Visual Studio 2008 was called Orcas --- an island near San Juan island (pronounced "San Huan"), north to Whidbey. Visual Studio 2010 was called Dev10 --- not a place, but because its version was 10. Well, why not go further north into Canada? (I'm kidding...:-) An interesting thing was once a test driver assumed Visual Studio setup time out is 3 hours. Once Visual Studio 2010 setup timed out, but actually later it finished installing. That's really Enterprise-Class software.

New Visual Effects

Aero is more advanced with many enhancements and redesigns. The task bar "pin" feature allows you to pin applications on the task bar, so that you can start them more easily (for me it may not be an often-used feature, because I'm used to the Start menu). IE implemented preview of its tabs by hovering the mouse pointer on the task bar. If you right-click and hold down the mouse on an application title bar, and then shake it, all other windows will be minimized. If you drag a window to the border, it will be docked (I find this feature annoying, however, so I always disable it in Ease of Access Center in Control Panel). There is a rectangular button on the right end of the system tray (or task bar, if you wish). By hovering the mouse pointer over it, the desktop will be visible, while the border of all windows will be shown on it with transparence. By clicking it, all windows are minimized and the desktop will be shown (that's the "show desktop" feature, actually).

New Applications

New paint brush. The UI is redesigned, so that it is more convienient to use. You can have it a try.

New magnifier! This is a completely new design. Before Windows 7, the magnifier can only display in a "lens" mode, which means the screen is split into two parts, with one part displaying the magnified content and the other displaying the desktop. In Windows 7, the magnifier has a new mode, called "full screen" (effective only with Aero mode --- remember Windows 7 Home Basic also supports Aero mode as long as the display adapter supports it). In this mode, all screen space is used as the magnified part, which means the desktop is essentially the same size as before magnification. This saves your screen space a lot. Furthermore, it can invert all colors, making better contrast.

New calculator. The UI looks better, and it is truely compatible with non-privileged user. The old one in Vista actually needs UAC virtualization to run well; otherwise it cannot save the settings well.

Conclusion: Windows 7 is an optimization based on Vista, and it is nice to have if you have a new computer.

Return to Windows 9x/NT Overview