The ability to run Windows and Macintosh software is the order of the day, and the name of the game is "multiple personalities"
Frank Hayes
The new breed of operating systems won't just do the same old things better. Instead, they'll offer capabilities that we've never expected before. Some of these (e.g., microkernels and objects) will live deep in the bowels of the systems, and users may never know they exist. But one new capability will affect almost every desktop computer user: the ability to run foreign applications.
Currently, add-on software lets Mac and Unix users run DOS and Windows applications. But in the generation of operating systems now emerging, the ability to run foreign software will be a standard part of the system and will work well. Your choice of operating system will no longer drastica
lly limit your choice of applications. The collision of user interfaces that occurs when Mac, Windows, and Unix applications all share the same screen will take some getting used to. Still, multiple operating-system personalities are here to stay, and soon they'll be as standard as mice and menus.
What won't be standard, though, is the way in which operating systems implement their ability to run nonnative applications. OS/2, Windows NT, Unix, Workplace OS, and the Mac will all take distinctively different tacks. These differences will affect how well you are able to take advantage of the wider range of applications that the extra personalities will support.
There are two competing sets of requirements. The mission of a foreign personality is to run existing applications, so it must support them as fully and faithfully as possible. But the needs of those applications may conflict with the design of an advanced operating system. Specialized device drivers may be at odds with the need for security
. Memory management schemes and windowing systems may conflict. Business issues (e.g., the cost of licensing code and threats of legal action) also affect the design of foreign personalities. But the biggest potential issue is performance: A personality must run applications at an acceptable speed.
The Emulation Equation
For one computer to run software intended for another (e.g., a Mac running DOS software), the computer must perform instructions that it doesn't natively understand. For example, a Mac's 680x0 processor must execute binary code that was intended for a PC's 80x86 CPU. The 80x86 comes with its own instruction decoder, registers, and internal architecture; it executes each instruction through hard-wired circuitry or by executing a microcode routine within the CPU.
The 680x0 doesn't understand 80x86 code, so typically it has to collect each instruction, decode it to determine what it's intended to do, and perform the equivalent routine using external 680x0 code rather than inter
nal microcode. Because the 680x0 also doesn't come equipped with exactly the same registers, flags, and internal arithmetic and logic units as an 80x86, it must also imitate those elements, either in its own registers or in memory. And it must accurately reproduce the results of each instruction, which requires 680x0 routines specifically written to make sure that the emulated registers and flags will be exactly the same as they would be on a real 80x86 after executing each instruction.
For the CPU, it's not hard work, just exacting and very tedious--the sort of job at which computers excel. But it's also very slow work, because the microcode inside a real 80x86 runs at a much faster clip than the external 680x0 instructions that must emulate it. In the time it takes the 680x0 to perform one 80x86 instruction, a real 80x86 CPU might be able to execute dozens of instructions. The result: A DOS program running under pure emulation on a Mac is certain to be incredibly slow compared to one running on a PC.
The problem isn't the Mac, though--Macintosh software being emulated instruction-by-instruction on a Unix workstation runs like molasses, too. The emulation equation is easy to understand: The processor's ordinary performance, minus all the overhead of emulation, will equal how much work it can do. Thus, unless the processor performing the emulation is spectacularly faster to compensate for the emulation overhead, the software running under emulation will simply be very, very slow.
A Dime a Dozen
What makes the new personalities better than emulation in the past? Faster processors help, of course. But the big difference is that many of today's applications run under GUIs like Windows, the Mac, or Unix's Motif. That means the new personalities can "cheat" on the emulation process.
An application running under a GUI spends much of its running time doing some very predictable things. It repeatedly makes calls to the GUI's libraries to manipulate windows and perform other GUI-related func
tions. And that's where a personality can make up for some of the time lost doing instruction-by-instruction emulation. A carefully crafted personality can come complete with libraries that mimic the GUI's own internal libraries but that are written in native code. Some vendors call this approach translation, to distinguish it from the slower process of emulating code one instruction at a time.
For example, on a Mac executing a Microsoft Windows program, performance might be very slow when it's interpreting 80x86 instructions. But when a call is made to open a window, the personality module could switch to a precompiled 680x0 window-opening routine. Because the GUI libraries don't have to decode and imitate each 80x86 instruction, performance can speed up dramatically in sections of the code that call the GUI's ABI (Application Binary Interface). The result is that in those sections of the code, the application can approach (or possibly exceed) its performance on its native processor.
And there'
s a lot of code that calls the GUI ABI in typical applications today. Apple claims that a Mac application spends up to 90 percent of its processing time performing Mac toolbox routines, rather than executing code that's unique to the application. SunSelect says that Windows applications spend 60 percent to 80 percent of their time in the Windows kernel. As a result, there can be a much smaller performance penalty for emulation of GUI-based applications. In fact, SunSelect claims that its new Windows personality, Wabi (Windows Application Binary Interface), can outperform real Microsoft Windows on the same hardware when running some benchmarks, thanks to highly optimized libraries.
The rise of GUIs has also resulted in another change in the way most desktop applications software is written today. Until the advent of the Mac, most desktop software treated operating-system calls with a sort of "do-it-yourself" philosophy. If the programmer didn't think the operating system would perform the routine fast e
nough, he or she would often dispense with the available operating-system calls and write an equivalent routine that directly manipulated hardware or software. This approach was commonly used for time-critical functions like display scrolling and getting data from a serial port.
"Programming on the metal" for performance was a nightmare for emulator writers, because they had to mimic software that was going directly to hardware that usually didn't exist on the computer doing the emulation. It was also a major problem for computer makers such as IBM and Apple, because it locked them into using exactly the same hardware architecture in generation after generation of the IBM PC and the Apple II. Changing many hardware details was out of the question, even if the changes would mean dramatic improvements, because changes would also break lots of software.
Lessons Learned
Apple learned its lesson from the Apple II experience. With the Mac, Apple worked hard to discourage programmers from "going to
the metal" or otherwise departing from a strict set of programming guidelines. (Apple's programmers weren't immune to the temptation to program on the metal, though. Some Apple telecommunications software for early, relatively slow Macs programmed the hardware directly.) The result of that discouragement was that Mac applications software was much less likely to break the rules than PC software. With fewer hardware dependencies, Apple has been able to evolve the architecture of the Mac over time.
The biggest reason programmers used the Mac's "toolbox" of GUI library routines was not a stick, but a carrot. The toolbox routines were so complex and powerful that using them was significantly easier than writing your own version of the code. Microsoft Windows also included a powerful GUI ABI, as did Microsoft and IBM's OS/2 Presentation Manager and Unix GUIs based on the X Window System. When Windows rocketed to popularity in 1990, the tide turned for emulation. Finally, a large body of applications softwar
e that spent a large part of its time in a GUI ABI could be mimicked.
With the technical barriers down, there are pressing business reasons why vendors believe multiple personalities are a crucial part of any successful new operating system. DOS, Windows, and Mac programs pack the shelves in software stores; obtaining shelf space for a new incompatible type of software is practically impossible. More important, users have plenty of Windows and Mac software, and they're not about to give up the software they know well, no matter how impressive a new operating system promises to be. In fact, for an increasing number of business customers, the ability to run particular PC applications (e.g., Lotus 1-2-3 and WordPerfect) is becoming a standard requirement for desktop computer purchases, even if the purchase also requires technical applications available only under Unix.
Luckily, the modularity of the new generation of operating systems makes it far easier to support multiple personalities. Unlike ol
der operating systems, which often consist for all practical purposes of a single large block of code divided into arbitrary parts, newer systems are modular, with clearly defined interfaces between the parts. That makes it much easier to design additional modules that bundle together processor emulation and GUI library translation.
So the pieces have all come together, both technological (software style, processor speed, and modular operating systems) and business (popular "must-run" software packages). Multiple personalities are the wave of the future for operating systems.
Who's Got What?
Among the advanced operating systems that will specifically incorporate multiple personalities are IBM's OS/2 2.x and Workplace OS; Microsoft Windows NT; the PowerOpen Association's PowerOpen; and versions of Unix from Sun Microsystems, IBM, and Hewlett-Packard. In addition, some companies are repackaging their user interfaces as personality modules, and still other vendors offer emulation and personality
-translation products that can run as applications.
Perhaps the most familiar multiple-personality operating system is also the one that opened the floodgates by showing that the ability to run other systems' software can be a big plus. OS/2 2.0 ran DOS and Windows 3.0 applications, and version 2.1 improved on this, upgrading to Windows 3.1 software and making the Windows windows a regular part of the desktop.
At first glance, IBM developers would seem to have had a comparatively easy task in adding the Windows personality to OS/2. After all, like Windows, OS/2 runs on 80x86 CPUs, so no processor emulation was required. In addition, IBM had access to actual Microsoft Windows source code and the right to use it, for a licensing fee, in OS/2. So IBM's work largely consisted of integrating the Windows code into OS/2.
But it still wasn't easy. The requirements of the two environments created difficult problems, some of which IBM has never satisfactorily resolved. For example, Windows incorpor
ates its own memory manager. So does OS/2. Unable to modify the Windows code to use OS/2's memory management services directly, the OS/2 developers settled on using the Windows memory manager within the OS/2 memory manager. Windows' manipulations of memory can spill over into the OS/2 swap file. Similarly, OS/2's "seamless Windows" mode required major work on the display drivers to enable the two window systems to share screen real estate.
Windows NT offers five operating-system personalities: DOS, Windows, an advanced 32-bit version of Windows, OS/2 1.x, and a Unix-like personality that meets the IEEE's Posix.1 specification. NT runs on several different CPUs, including the Mips R4000/R4400 and DEC's Alpha, as well as the 80x86. To run DOS and Windows applications on non-80x86 platforms, NT incorporates emulation technology licensed from Insignia Solutions, which also makes the DOS emulator SoftPC for the Mac and Unix workstations. (NT's OS/2 personality is not supported on non-80x86 processors.)
Naturally enough, to provide the ability to run Windows applications, Microsoft used its own Windows source code, modified and recompiled for each CPU that NT runs on. The 16-bit Windows and DOS personalities run on top of the 32-bit Windows (Win32) NT subsystem. On 80x86 machines, where the CPU is not emulated, DOS and 16-bit Windows applications run in V86 mode, and 16-bit calls are "thunked" (converted to 32-bit versions) and serviced by Win32.
NT's major trade-off in DOS and Windows support is that, in keeping with NT's security and reliability goals, device drivers and other DOS and Windows programs are not allowed access to the hardware. As a result, some DOS and Windows programs simply won't run under NT. (In contrast, OS/2's DOS and Windows support allows more complete DOS and Windows support, but for that capability trades away robustness.)
NT's OS/2 support has special limitations compared to the DOS and Windows personalities, but it is still a thoroughly usable version. It is avail
able only on 80x86 NT, does not support the PM GUI, and is designed to handle only software written for OS/2 1.2 and earlier versions, which limits applications to 16-bit versions. In practice, though, NT's OS/2 personality can run current versions of many OS/2 packages--particularly server applications, which don't require PM.
In contrast to the OS/2 personality, NT's Posix personality isn't actually mimicking an existing operating system at all. Although there are versions of Unix (on which Posix is modeled) for each CPU that NT runs on, NT's Posix can't run shrink-wrapped Unix software; it requires programs to be recompiled before running.
The Unix Strategies
While Windows NT can't run Unix binaries, some Unix vendors are convinced they need the ability to run Windows software. That ability has been available for several years through third-party software like SoftPC (now available with Windows), which runs on Macs and Sun, HP, IBM, Next, and Silicon Graphics Unix workstations. On 80x86-ba
sed computers, Locus Computing's Merge also enables DOS applications to run under Unix. Merge runs a standard copy of Windows on top of the DOS environment.
In addition, Insignia's new SoftWindows was scheduled to begin shipping in December. SoftWindows uses a recompiled version of the Windows source code to speed up Windows applications running on Sun, HP, IBM, DEC, Next, and Silicon Graphics Unix workstations. If that approach sounds familiar, it should: It's almost exactly the same approach used for non-80x86 versions of Windows NT. But while SoftWindows and NT are conceptually close cousins, NT can also run 32-bit Windows code, while SoftWindows is limited to running16-bit Windows applications.
However, the most aggressive approach to bringing Windows and Unix together comes from Sun Microsystems' SunSelect division, which has developed Wabi. While SoftWindows uses recompiled Windows source code from Microsoft, Wabi is an attempt to reverse-engineer Windows based on its functional specificat
ions, with all operating-system-related functions (e.g., display, memory management, and interprocess communication) handled by Unix. Instead of the Windows desktop, each Windows application running under Wabi appears in its own screen window and uses the Motif or OpenLook screen appearance rather than that of Microsoft Windows.
The result is a mixed success. SunSelect initially guarantees that Wabi can run only the most popular Windows software, including Lotus 1-2-3 and Ami Pro; WordPerfect; Microsoft Word, Excel, PowerPoint, and Project; Borland Paradox and Quattro Pro; Aldus PageMaker; Harvard Graphics; CorelDraw; and Procomm Plus. The company says that the list of "certified" applications will grow. In the meantime, while some noncertified applications will run, others may not install, or may fail while the application is running due to use of unsupported API calls.
SunSelect says its focus is on running popular applications rather than mimicking Windows in its entirety. But all Windows app
lications function in a complex environment, with subtleties that may show up only when Wabi's developers tackle support for applications outside the most-wanted list. In addition, Windows will continue to be a moving target; SunSelect may be hard-pressed to keep up with future changes required by new versions of Windows software.
However, Wabi has one huge advantage in any popularity contest for Windows-on-Unix software: SunSoft is making Wabi available with every copy of its Solaris version of Unix, and SunSelect has licensed the product to IBM, HP, and Novell to include in their versions of Unix. If all these vendors include Wabi in their systems as Sun does, Wabi will be shipped with more than 70 percent of all Unix workstations.
Not to be outdone, Apple is working on its own Mac personality translator to run on Unix systems. The first version, Macintosh Application Services, will run on PowerPC-based workstations running the PowerOpen version of Unix. MAS will let PowerOpen workstations run
both Unix applications and shrink-wrapped software intended for 680x0-based Macs. (MAS should not be confused with the new PowerPC-based Macs, which also use processor emulation and GUI translation to run 680x0 Mac software.)
MAS will appear as a "Macintosh window" on PowerOpen-based workstations. Although Apple says that MAS will be compatible with X, Mac applications running under MAS will still have the distinctive Mac look and feel.
In addition, Apple has announced that it will eventually support other Unix workstations. Apple hasn't released details of its plans, and they clearly fall under the category of future product development. However, Sun, HP, and IBM have already said they hope to use the forthcoming Apple technology to let their Unix workstations run unmodified shrink-wrapped Mac software.
In the meantime, two ISVs (independent software vendors) are already emulating the Mac on Unix systems--although with limits. Andataco's Liken is a pure processor emulator; it runs on Su
n and HP workstations and mimics the Mac's 680x0 CPU, as well as the Mac hardware environment. However, Liken doesn't try to copy the Mac's toolbox GUI libraries; for that, you need a copy of System 6.0.7.
In contrast to Liken, Quorum Software Systems' Equal is designed to mimic both the 680x0 processor and all Mac system calls, so that Mac applications can run on Sun and Silicon Graphics Unix workstations. Like Wabi, Equal puts each Mac application in its own window, using X to display Motif- or OpenLook-style window decorations. Also like Wabi, Equal currently has a limited set of "certified" applications. Initially, it includes only the Mac versions of Microsoft Word and Excel, although Quorum plans to expand the list of certified software early this year to include Microsoft PowerPoint, QuarkXPress, and other popular Mac software. (According to Quorum, many "uncertified" Mac applications run with no problems.)
Closing the circle is IBM's Workplace OS, the OS/2 successor based on the Mach 3.0
microkernel. Standard Workplace OS personalities will include Unix and OS/2 (along with its DOS and Windows personalities). But IBM hints that other personalities may also be available for the system. Because the Workplace OS interfaces are being developed in close communication with Taligent, the IBM/Apple joint venture to develop an object-oriented operating environment, both Taligent and the Mac GUI are likely candidates as Workplace OS personalities.
Who Wins, Who Loses
The ability to run Windows and Mac software is no longer a minor consideration when it comes to advanced operating systems. But beyond that simple point of agreement lie a welter of strategies for putting the multiple-personalities idea to work--and some of those strategies are diametrically opposed to others. A careful examination of the strategies operating-system vendors are using makes it apparent that there's no single correct way to implement multiple personalities.
In the case of Unix, the personality translator is
typically designed to float along the surface of the operating system, like any other application. For more recent operating systems like Windows NT and Workplace OS, the personality module is much more closely linked to the operating system, although it is still highly modular. And for OS/2, with its simpler, less modular structure, the personality capability appears to be deeply embedded in the operating system.
But while operating-system vendors are juggling their approaches to run the largest number of popular applications most effectively, the biggest impact of the trend toward multiple personalities may be on applications software developers. Windows and Mac applications are likely to sell slightly better than before. The big winners will be those Windows applications that are already the most popular, because the ability to run them will be bundled with a large percentage of Unix workstations in the form of Wabi. Ironically, because they are so popular, the additional software sales may not mak
e a big impact on them.
And the big losers? They're likely to be single-user productivity applications written specifically for Unix. Unix software developers already face major problems. Popular Unix workstations sell in the hundreds of thousands, not millions (like the Mac) or tens of millions (like the PC). Few software retailers carry any Unix applications at all. The combination of low volume and limited distribution means that Unix software vendors will be hard-pressed to compete against similar Windows or Mac programs. That could spell the end of the line for applications that don't take advantage of the special features of Unix--or any other advanced operating system.
In the end, the real impact of multiple personalities will be on users, in the form of easier access to better software and more freedom of choice in operating systems. That may not be great news for all operating-system or applications vendors. But for users who have ever needed software they couldn't run, multiple persona
lities are an important step toward sanity.
Table: EXISTING AND FORTHCOMING OPERATING SYSTEMS OFFERING MULTIPLE PERSONALITIES (This table is not available electronically. Please see January, 1994, issue.)
Table: THIRD-PARTY PERSONALITY SOFTWARE (This table is not available electronically. Please see January, 1994, issue.)
Screen: Quorum Software Systems' Equal running the Macintosh version of Microsoft Word on a Silicon Graphics workstation.
Frank Hayes is a writer, communications consultant, and former West Coast news editor for BYTE. You can contact him on BIX as "frankhayes."