How can you encourage the use of 64-bit platforms for those native applications that can leverage the extra performance and larger address space, while still supporting a huge installed base of 32-bit apps—many of which wouldn't really benefit from migration anyway? That's the challenge faced by chipmakers and operating-system vendors, as well as software developers and IT professionals. Let's face it: Few customers will be easily persuaded to kiss off their entire collection of 32-bit apps.
Fortunately, you don't have to walk away from 32-bit code in order to embrace 64-bit software. The AMD64 architecture, found in the Opteron and Athlon 64 processors from Advanced Micro Devices, extends the popular x86 instruction set to support 64-bit memory addressing, enabling compatible operating systems to run both 64-bit and 32-bit applications at full speed on the hardware. That's native-instruction-set execution, folks—not mere emulation of 32-bit software by using 64-instructions.
Such compatibility isn't something that you can or should take for granted with all 64-bit processor architectures. For example, Intel's Itanium 2 processor is also a 64-bit chip, but because its architecture is not at all similar to that of x86-based systems, it can only run 32-bit apps by emulating the x86 instruction set. This results in a significant performance degradation for 32-bit apps running on that processor. The AMD64 architecture imposes no such performance hit, because it can execute x86 instructions, and applications, natively.
|
Things You Can't Do Yet
The combination of 64-bit Windows and an AMD64-based processor gives developers, systems administrators and end users a powerful combination: You can run 64-bit apps on the platform, to get the utmost performance and scalability—and you can run 32-bit Windows apps and threads at the same time, using native AMD64 processor instructions.
However, with the first versions of 64-bit Windows XP and Windows Server 2003 for 64-bit Extended Systems, there are some limitations that you should be aware of:
- You can't run applications that use a 16-bit installer. Many older apps developed before Microsoft developed its Windows Installer technology used a 16-bit installer to maintain compatibility with 16-bit Windows and to reduce the installer's footprint. While 32-bit versions of Windows can run the 16-bit installer, the 64-bit versions can't. One common app with a 16-bit installer is SQL Server 2000, up through Service Pack 3. With Service Pack 4, Microsoft gave SQL Server 2000 an MSI-based installer that works with 64-bit Windows.
- You can't use apps that install or require 32-bit kernel-mode drivers. That includes Exchange Server 2003.
- Microsoft hasn't yet ported the .NET Framework to 64-bit Windows, and the 32-bit version will not run on that environment—so, you can't run any .NET apps on 64-bit Windows. For example, you can't run the Office SharePoint Portal Server 2003, BizTalk Server 2002 or Project Server 2002 on 64-bit Windows at this time. This is expected to change in late 2004, with a future release of the .NET Framework compatible with 64-bit Windows.
|
In fact, in many cases 32-bit apps run faster on the 64-bit AMD64 architecture than they would on an equivalent 32-bit x86 processor. This is due to the fact that AMD64 processors eliminate the front-side bus architecture that dominates in x86-based systems today. By integrating the memory controller, and using industry-standard HyperTransport technology for chip-to-chip communication, AMD64 processors reduce the bottlenecks and latencies commonly found in other x86-based systems.
Note that earlier I said that you need to have a "compatible" operating system in order to run both 32-bit and 64-bit applications on the AMD64 architecture. That's because while 32-bit apps run at full hardware speed, the operating system has to know how to load, execute and manage those applications, and also how to perform the necessary translation functions to allow 32-bit apps to call 64-bit OS functions, and to enable inter-process communication (IPC) so that 32-bit apps can interoperate with 64-bit apps.
The subsystem in 64-bit Windows that accommodates that loading, execution, and management of 32-bit apps is called WOW64, or Windows-32-on-Windows-64.
Microsoft Corp. is currently offering two operating systems compatible with the AMD64 architecture that provide the WOW64 capability. Those operating systems are Windows XP for 64-bit Extended Systems and Windows Server 2003 for 64-bit Extended Systems.
Thanks to WOW64, both have the look-and-feel of "ordinary" 32-bit Windows, but can leverage the capability of the AMD Opteron and Athlon 64 processors to run most of todays popular 32-bit apps and the emerging class of 64-bit applications. (There are a few limitations of the current versions of 64-bit Windows in terms of running 32-bit Windows apps; see sidebar, "Things You Can't Do Yet.")
WOW64's Place Within Windows
The WOW64 subsystem is a lightweight translation layer that has similar interfaces on all 64-bit versions of Windows. Its primary purpose is to create a 32-bit environment that provides the interfaces required to allow 32-bit Windows apps to run unmodified in the 64-bit system. Technically, WOW64 is implemented using three DLLs: Wow64.dll, which is the core interface to the NT kernel that translates between 32-bit and 64-bit calls, including pointer and stack manipulations; Wow64win.dll, which provides the appropriate entry points for 32-bit apps; and Wow64cpu, which takes care of switching the processor from 32-bit to 64-bit mode.
Despite its outwardly similar appearance on all versions of 64-bit Windows, WOW64's implementation varies depending on the target processor architecture. For example, the version of 64-bit Windows developed for the Intel Itanium 2 processor uses Wow64win.dll to set up the emulation of x86 instructions within the Itanium 2's unique instruction set. That's a more computationally expensive task than the Wow64win.dll's functions on the AMD64 architecture, which switches the processor hardware from its 64-bit mode to 32-bit mode when it's time to execute a 32-bit thread, and then handles the switch back to 64-bit mode. No emulation is required!
The WOW64 subsystem also handles other key aspects of running 32-bit applications. For example, it's involved in managing the interaction of 32-bit apps with the Windows registry, which is somewhat different in 64-bit versions of the OS, and in providing an interface to the storage subsystem.
WOW64 also ensures that 32-bit apps, utilities, dynamic link libraries (DLLs) and other files are stored in the appropriate directories, as 64-bit Windows has separate program and system directories for those "legacy" apps. (We'll learn more about those in the second article in this series.)
Don't Rely Upon 32-bit Drivers
While 64-bit Windows can run 32-bit apps and utilities with ease, the same is not true of device drivers. You must have 64-bit drivers, even for 32-bit apps that are running via the WOW64 environment. This may be an issue for legacy hardware for which no 64-bit drivers is available, and for which the hardware vendor is unwilling to or unable to provide an updated driver. (Of course, those older devices will rarely be encountered in a brand-new 64-bit PC anyway.)
More Memory. Lots More.
One of the extra benefits of running 32-bit applications on a 64-bit AMD64-based computer and 64-bit Windows is the potential for having more application memory made available to the 32-bit apps! On a 32-bit Windows system, the maximum memory available is 4GB, which must be shared between the operating system, memory-resident drivers, applications and application data.
Typically, that means that even with a max'd out system, the most memory available to an application running on a 32-bit OS is 2GB or so, maybe up to 3GB with special operating-system and compiler options.
By contrast, on a 64-bit system, the WOW64 infrastructure can allocate as much 4GB of RAM to a 32-bit Windows application—and that address space does not need to accommodate the operating system and drivers. That gives the full 4GB to the application, a significant increase for resource-hungry applications.
The 64-bit versions of Windows and WOW64 also handle the memory pool and virtual memory more efficiently than 32-bit versions of Windows, also improving performance for 32-bit apps.
Coming Next Time
In the second article in this series, we'll look at more WOW64 internals, including registry and file-system redirection, interprocess communication, installers, and the special function calls available to allow 64-bit apps to communicate with 32-bit apps.
A former mainframe software developer and systems analyst, is principal analyst at Camden Associates, an independent technology research firm focusing on networking, storage, and software development.