Cover Story

Three's the One

Windows 3.0 carries DOS into the 1990s

Jon Udell
BYTE

June 1990

Users of DOS PCs rejoice! Windows 3.0 will breathe new life into your machine. Microsoft has bundled a graphical environment, a suite of desktop applications, a DOS program switcher, a Windows multitasking executive, a V86 multitasker, and a virtual memory manager into a single package.

Windows has long aspired to change the face of DOS computing--not just for Excel or PageMaker addicts, but for the rest of us. A year ago, that transformation seemed unlikely. Today it appears inevitable. Windows 3.0 finally consummates the Windows/DOS marriage. That is good news for the 386 crowd, and it's great news for the silent majority: 286 owners who've lately been made to feel like they have bought an Edsel.

Windows 3.0 runs in three modes: real, standard, and 386 enhanced. When you type win at the DOS command line, Windows scopes out the local hardware configuration and starts up in the appropriate mode: real mode on a 640K-byte XT or AT, standard mode on an AT with at least 256K bytes of extended memory or a 386 with up to 1 megabyte of extended memory, and 386 enhanced mode on a 386 with more than 1 MB of extended memory. All modes share the same radically improved graphical user interface (GUI) and enhanced suite of Windows desktop applications. Standard mode adds the ability to run Windows 3.0 applications in 286 protected mode--that is, with direct access to up to 16 MB of extended memory. The 386 enhanced mode adds more: preemptive multitasking of DOS programs running in V86-based virtual machines, and demand-paged virtual memory.

You can override the default start-up behavior. For example, you can type win /r to start Windows 3.0 in real mode on a 286 or 386. And to run an existing Windows/286 or Windows/386 application, that's just what you'll have to do. Windows 3.0 is fundamentally a DOS extender. The DOS-extended programs that it can execute--Windows 3.0 applications--must abide by the same laws that govern all protected-mode applications. That means, among other things, that a program can't write to a code segment, perform segment arithmetic, compare segment addresses, or load a segment register with a value other than one provided by the operating system.

Most existing Windows applications--and virtually all the major ones--will require a tune-up in order to comply with Windows 3.0. But the trauma won't be as severe as you might think. In general, even ordinary DOS applications port readily to DOS extenders. Windows programs, written to a far stricter application programming interface (API) that was designed with protected mode in mind, find the transition even easier. Also, Windows developers have been working with version 3.0 for months; many have already completed their ports. At least one shipping application, Word for Windows, won't even require an upgrade--it's already 3.0-compatible.

Although Windows 3.0 costs $150, Microsoft will upgrade existing Windows/286, Windows/386, and Windows run-time users for $50 within 90 days of its release date. Application upgrade policies should be similarly reasonable in most cases. Through the end of August, users can call (800) 323-3577 to inquire about and order Windows 3.0 compatible products.

The New Windows Desktop

By design, the Windows desktop closely resembles that of OS/2 1.2. And yes, that means that like Presentation Manager, Motif, and NextStep, Windows offers what seems to have become the sine qua non of the modern GUI: buttons shaded to create a three-dimensional effect. But look more closely at the photo at right and you'll discover a far more significant enhancement. Both PM and Windows support child windows that run as windows or as icons within the boundaries of a parent window, sharing its menu bar. You can see two examples of this behavior in the photo. Both the File Manager (similar to OS/2 1.2's File Manager) and the Program Manager (Windows 3.0's primary shell) contain child windows in active and iconic states.

I've yet to see another Windows 3.0 application that exploits this technique (which IBM's Common User Access style guide calls the multiple document interface, or MDI) as fully as the File Manager and the Program Manager do. But the new Software Development Kit (SDK) includes an MDI code skeleton, and I hope many applications will adopt this style. Other GUIs' window systems pale by comparison; they limit you to a single top-level desktop. Windows 3.0 (like OS/2 1.2) supports a hierarchy of desktops. Each records the arrangement of windows and icons running in support of a task. You can collapse the entire aggregation into a top-level icon, thus sweeping away a lot of visual clutter. And you can recall the task and all its associated context with a single keystroke. Here is a practical way to manage a dozen tasks, each with one or more windows--even on a standard VGA screen.

You interact with Windows and DOS by way of five key desktop applications: File Manager, Program Manager, Task List, Control Panel, and Print Manager. File Manager, like its OS/2 counterpart, views disk drives the way an outline processor does. Its primary child window presents a directory tree; you single-click on nodes to show or hide their descendants. Double-click on a directory node, and File Manager opens a new child window that lists the files in that directory. You can opt for an iconic or a textual display, sorted in a variety of ways. As with the old Windows MS-DOS executive, you can select and launch DOS or Windows applications directly or indirectly by way of documents associated with applications. New conveniences include the ability to copy and move files and subtrees using the mouse, the ability to invoke an application by ''dragging and dropping'' a compatible document onto its icon, and the ability to search for files.

File and Program Managers

If you inspect the photo carefully, you'll see that the File Manager knows that the highlighted drive icon represents a network drive. (The same holds true for CD-ROM drives.) But that is just a glimpse of Windows 3.0's network awareness. It goes much further. The product provides extensive hooks for a variety of networks, including MS-Net, LAN Manager, NetWare, and Vines. When you install Windows 3.0 in the presence of one of these networks, it loads a corresponding driver. (NetWare users take note: You'll also need to update your network shell components by way of NetWire or the Novell hotline.)

The network driver provides many conveniences. From the File Manager, for example, you can execute Connect Net Drive. It provides a graphical interface to MS-Net's net use, NetWare's map, or whatever command your network uses for this purpose. With Browse, you can look through the list of available servers and mounted volumes for the drive to which you want to connect. The specific form that this dialogue takes will, again, vary according to your specific network.

The File Manager, like the Macintosh Finder, is fundamentally a disk organizer. The Program Manager works quite differently; it's a task organizer. If you prefer the disk-oriented approach, you can make File Manager the primary shell; just open WIN.INI and specify shell=winfile.exe. But Windows 3.0 defaults to the Program Manager, and for good reason. Its elements are groups and program items. Groups are child windows that contain iconic program items that, in turn, refer to applications and optionally to associated documents. But when you create groups, add program items, and copy or move program items between groups, you're not manipulating the applications or documents themselves; you're manipulating pointers to them. The added flexibility takes some getting used to, but it's extremely useful.

You link program items to applications by way of the Program Manager's Properties dialogue. Here you supply an application's command line: an .EXE (Windows- or DOS-executable), .PIF (a Program Information File that tells Windows how to allocate resources for a DOS program), .COM, or .BAT file, along with command-line arguments if required. Unless you declined the offer, the Windows setup program will have scanned your local (and network) drives and created program items for all your Windows applications and for the DOS applications for which Windows provides predefined .PIF files.

Like File Manager, Program Manager can tile or cascade its active child windows and arrange those that are running as icons. You can select and activate any group window or group window icon from a list. And you can minimize any group window, or minimize the Program Manager itself.

Tasks, Controls, and Printing

Task List pops up when you double-click on the desktop, press Control-Escape, or choose Switch To from any window's control menu. It can tile or cascade top-level windows, arrange top-level icons, enumerate tasks, switch among tasks, or kill a task. The several mouse and keyboard procedures for starting the Task List typify Windows 3.0. Like its predecessors, and despite its greater complexity, Windows 3.0 operates quite nicely under keyboard control. No one will want to use the product without a mouse, but power users will appreciate the dozens of keyboard shortcuts.

The Control Panel provides a suite of configuration tools. Some of the tasks you can perform here include resetting the desktop colors, installing or removing printer and screen fonts, attaching to an alternate network server, configuring communications ports, installing and configuring printers, and specifying multitasking settings for 386 enhanced mode. In the Colors dialogue, you can switch to an alternate desktop color scheme or invent your own. The Ports dialogue repairs a long-standing deficiency: At last, Windows itself supports XON/XOFF flow control.

The Printers dialogue illustrates another facet of Windows' new network awareness. Once you've specified a port (e.g., LPT1) and a printer (e.g., HP LaserJet), you can browse network print queues and connect the port to a queue that supports your selected printer. Windows intelligently offers to bypass the local spooler and print directly to the network queue. With earlier versions of Windows, you had to disable spooling entirely in order to use network queues. Now you can configure spooling on a per-printer basis.

The Print Manager handles both local and network queues. Even when you bypass the Windows spooler and print straight to a network queue, you can use the Print Manager to monitor the job's progress. Local queues display only jobs printed from Windows applications, but network queues--thanks to the intervention of the network driver--list all your print jobs. By default, a network queue won't list other users' jobs, but you can ask to see the complete list, and (again, depending on the specific capabilities of your network and its Windows driver) you can even browse network queues to which you're not connected.

The desktop applications offer extensive on-line help. Like OS/2 1.2, Windows 3.0 documents itself hypertextually and, in its SDK, provides tools and protocols that enable applications to follow suit. The Windows 3.0 applications I've seen take advantage of the help engine, which lends a nice consistency to the environment. I particularly like the way the help system enables users to annotate on-line documentation.

Wide-Open Spaces

As I write these words, I'm running Windows 3.0 in 386 enhanced mode on a 20-MHz 386 Gateway 2000 with 4 MB of memory. The Task List reports that I'm running FoxBase (in a virtual DOS machine), Epsilon (in another virtual DOS machine), five Windows 3.0 desktop applications (File Manager, Program Manager, Paintbrush, Terminal, and Notepad), and three additional Windows 3.0 applications (Microsoft's Excel, Samna's Ami Professional, and Asymetrix's HyperCard-like ToolBook). CHKDSK, which I ran in each of the two DOS sessions, reported 477K bytes of free DOS memory--scarcely less than the 486K bytes available to DOS after I booted and loaded my network drivers but before I launched Windows. Meanwhile, the Program Manager reports more than 10 MB of free Windows memory. How can this be? DOS multitasking based on the V86 mode of the 386 processor is nothing new. But add protected-mode Windows applications running in extended memory with access to virtual memory, and you're really pushing the envelope.

It's a different story on a 286, but not too different. On the DOS side, you substitute program switching for DOS multitasking and give up hardware protection, and you get somewhat less DOS memory. Running Windows in standard mode on a 1-MB Compaq Deskpro 286e, I found that a secondary DOS session saw 44K bytes less free memory than did the boot session. On the Windows side, you give up virtual memory. Yet although standard mode appears limited when you compare it to 386 enhanced mode, it legitimizes the 286 in a way that no other software product ever has. You can still run multiple DOS applications reasonably, side by side with Windows applications. And those Windows applications, using as much extended memory as you care to install, will really be able to stretch their legs.

DOS extenders come in two flavors. The 286 extenders, such as Rational Systems' DOS/16M, break through the 640K-byte memory barrier and enable programs to run in extended memory on a 286 or a 386. But they still form addresses with 16-bit offsets, so they can't manipulate data objects larger than 64K bytes. The 386 extenders, such as Phar Lap's 386DOS-Extender, also break the 64K-byte segment barrier. They run only on a 386, but they can form addresses with 32-bit offsets and thus present a ''flat'' 4-gigabyte address space to applications. Windows 3.0 is a 286 extender. It runs programs in extended memory, but even on a 386 those programs don't see the flat address space that is characteristic of 386DOS-Extender, Unix, or OS/2 2.0. To manipulate very large bit maps, for example, Windows 3.0 programs must still resort to the huge memory model that tiles segments.

Although Windows 3.0 offers 386-specific features--V86 multitasking and demand-paged virtual memory--the 286 is its true target platform. While the 64K-byte segment limit may be inconvenient, the 640K-byte limit has been Windows' ball and chain. That's gone now, and both 286 and 386 users will reap the benefits. Existing Windows applications, once converted, will enjoy what amounts to a free lunch. Developers who couldn't contemplate working in real-mode Windows will think much harder about developing for Windows 3.0.

Living with Windows 3.0

Like many people, I've always thought of Windows as an application launcher, not a working environment. I'm no fan of DOS shells; the ones I've tried feel like straitjackets. But the notion of a dual environment in which DOS and Windows applications coexist was always alluring. So with each successive version of Windows, I've put the win command into my AUTOEXEC.BAT file, just to see how long it could survive there. Earlier versions of Windows never lasted more than a day. This one's a keeper. For the first time, the Windows/DOS coexistence entails relatively few compromises. DOS sessions see more memory than in previous versions of Windows--in standard mode as well as in 386 enhanced mode. Even more important to me is that access to network services removes what had been a major obstacle to sustained use of Windows. For example, Windows used to simply reject a message sent over a network. Now it fields the message and presents it in a Windows alert box. The only major sacrifice--and this will be a problem for many users--is that you can't use protected-mode memory managers like QEMM and 386Max with Windows 3.0's standard or 386 enhanced modes.

Some of the things I've learned about Windows aren't new to version 3.0. Like Windows/386, 3.0 supports cut-and-paste operations between windowed DOS programs and Windows applications. One evening, while connected to BIX by way of the Terminal accessory (see below), I used the BIX search command to generate a list of messages. The next step was to reformat the message numbers as a comma-separated list and feed that list to the file command. I copied the search output from Terminal's buffer to the clipboard, pasted it into my DOS text editor, built a macro to reformat the numbers, and pasted the result back into Terminal.

What's new--to me, anyway--isn't the cut-and-paste feature itself, but the opportunity to use it. You'd never load Windows just to cut and paste between applications. And you'd never load it just to run one of its accessories: Notepad, Write, Terminal, Paintbrush, Calendar, Calculator, or Cardfile. But if you establish the Windows desktop as your working environment--and 3.0 makes that eminently practical--you'll find that it has a lot to offer.

I've always used Notepad for quick text-editing tasks in the Windows environment, but now I find Write perfectly adequate for memos and correspondence. Paintbrush, derived from ZSoft's PC Paintbrush, operates in color and improves on the old Windows Paint program in a number of other ways. Since it supports both .PCX and .BMP (Windows bit-map) formats, it serves as a gateway between DOS- and Windows-based image-processing programs.

Terminal now handles binary file transfers; while it's not a full-featured telecommunications program (it has no scripting capability), it's nevertheless quite useful. The new Calculator adds a scientific mode. It supports trigonometric and statistical functions and can operate in binary, octal, and hexadecimal number systems. Even Cardfile--a sort of Rolodex that can store scraps of text and black-and-white images--turns out to be surprisingly handy. Like the Mac's Scrapbook, Cardfile holds a persistent collection of clipboard items.

Raster Rainbows

Right out of the box and running on a standard VGA display, Windows 3.0 looks more colorful than its predecessors. Tasteful use of color has much to do with that impression. Although you can change the desktop's color scheme, you will be hard pressed to come up with a better one. But there are also more colors to work with. Earlier versions of Windows could use just eight of the 16 pure colors available in the VGA 640- by 480-pixel by 16-color mode; Windows 3.0 uses them all.

Behind the scenes, there's a whole new color architecture waiting to be exploited. The new Windows API defines 1-, 4-, 8-, and 24-plane device-independent bit maps. These formats, which are compatible with OS/2 color bit maps, extend the device independence that Windows applications enjoy to the realm of color imagery. Hardware color capability, not Windows itself, becomes the limiting factor.

To support color-intensive Windows applications, the new API also defines a set of palette management functions. These functions facilitate orderly arbitration among applications competing for the use of a limited supply of colors. An application can define a list of colors that it requires, in order of importance. When it runs in the foreground, the application gets first choice of the colors available in the system palette. Background applications contend for the remaining colors; they receive consideration in reverse order of activation. If the system palette runs out of free colors, Windows maps some or all of their requests to the closest colors already in use, taking each application's specified color priorities into account.

Windows reserves a pool of 20 static colors; that's the default palette used for window titles, menu bars, and other standard desktop elements. That means most applications won't need to concern themselves with the intricacies of palette arbitration. On a 16-color VGA display, it's not even an issue. But as Windows 3.0 drivers designed for more capable video boards arrive, and as Windows applications begin to exploit 256 and more colors, the palette manager will come into its own. Video Seven and 8514/A drivers are included with Windows 3.0, by the way. But most users of better-than-VGA display hardware will have to wait a while to find out what Windows 3.0 can really do with color.

Running DOS Applications

When you run your DOS programs under Windows 3.0, the standard and 386 enhanced modes correspond closely to Windows/286 and Windows/386. In standard mode, DOS programs run full-screen and uninterrupted. You can have one or more DOS sessions; each swaps to disk when you switch away from it. Standard mode improves on Windows/286 in several ways. There's more memory for DOS programs because Microsoft has dropped a little-used feature of Windows/286--the ability to window well-behaved applications. The Program Manager and Task List make it easier to find and switch to your DOS applications. Windows 3.0's 386 enhanced mode, like Windows/386, creates a powerful hybrid environment. The Windows session, within which Windows applications multitask cooperatively, itself multitasks preemptively with one or more virtual DOS machines. A DOS program can run full-screen or in a window; Alt-Enter toggles between the two display modes. You can run textual and (with restrictions) graphical displays in windows.

Each virtual machine inherits and can customize the boot DOS session. Since the original TSR memory hit propagates to all virtual machines, it's best to start lean (e.g., with just network drivers) and then load extras on a per-session basis. There is no AUTOEXEC.BAT file for virtual machines, but you can use .PIF files in conjunction with .BAT files to tailor your DOS sessions for specific purposes.

The 386 enhanced mode outclasses Windows/386 in several respects. Virtual memory enables you to run more DOS sessions. And you've got greater control over how those sessions multitask. A Windows/386 .PIF file offers three options. Foreground means run only in the foreground while background tasks run concurrently. Background means run in the foreground or the background while background tasks run concurrently. Exclusive means run only in the foreground and halt all other tasks. Windows 3.0 preserves and extends these options. You can adjust each DOS task's (or Windows' own) foreground and background time slice. A new form of the exclusive mode gives a DOS task all the cycles it wants while active, but it enables Windows to switch away from it when idle. When there's an interrupt pending to a virtual machine, Windows temporarily boosts its priority to maintain crisp keyboard response. In special cases, you can speed up a DOS program by locking its EMS, Extended Memory Specification, or conventional memory.

Virtual machines require virtual devices. Windows provides drivers for the basic ones--disk, video, and keyboard--but you might run into a problem with a less common device. For example, my floppy disk drive controller based tape drive won't work with Windows 3.0 in 386 enhanced mode, so I can't run tape backups in the background.

What about DOS-extended programs? For now you have to drop down to standard mode to run 286 DOS-extended programs like Lotus 1-2-3 release 3.0, and to real mode to run 386 DOS-extended programs like Interleaf Publisher. But there's hope of better things to come. DOS-extender vendors are working hard to comply with the new DOS Protected Mode Interface, which will enable Windows 3.0 (or any other DPMI server) to multitask protected-mode applications. It sounds even scarier than the Virtual Control Program Interface, but the current popularity of DOS extenders and the likely success of Windows 3.0 will probably make DPMI a reality.

The OS/2 Killer?

Has Microsoft, which also sells OS/2, committed corporate fratricide? Yes and no. Windows 3.0 addresses, and satisfies, many pressing needs. Rarely does an operating-system upgrade render existing hardware so much more useful. Windows 3.0 will delight longtime Windows fans and win many new converts. Developers are flocking to the platform and, in some cases, shifting their focus from OS/2's PM to Windows. The Windows momentum that has been building is about to become a tidal wave.

But scratch the elegantly polished surface and you'll still find creaky old DOS. OS/2 really is much better. Its multithreaded architecture, 32-bit programming model, High Performance File System, and rich Graphics Programming Interface should eventually earn it the respect it deserves.

Windows 3.0 could be the best thing that ever happened to OS/2. It's ideally positioned to draw huge numbers of DOS users into the realm of GUI-based multitasking. Many will remain happily within the Windows fold. As client/server applications evolve, the Windows 3.0 client workstation--communicating with servers running OS/2 or its competitors--seems destined to become an important industry standard. But power users who yearn for a better foundation under the graphical desktop will find the move from Windows to OS/2 natural.

In the meantime, on both technical and strategic grounds, Windows 3.0 succeeds brilliantly. After years of twists and turns, Microsoft has finally nailed this product. Try it. You'll like it.

Editor's note: BYTE's Windows 3.0 coverage continues next month with hands-on descriptions of specific applications that have been redesigned to work with the new graphical environment. The selection will include applications for word processing, databases, spreadsheets, and developers' tools, among others. In the months beyond, look for articles that tell the Windows 3.0 story in still greater depth and breadth.

COMPANY INFORMATION

Microsoft Corp.
1 Microsoft Way Redmond, WA 98052
(206) 882-8080

-- Jon Udell is a BYTE senior editor at large. You can contact him on BIX as ''judell.''

Photograph: Running Windows 3.0 on a 386, you can multitask windowed DOS programs along with Windows protected-mode applications. Even on a 286, Windows 3.0 applications use extended memory. With its powerful new shell, protected-mode capability, color palette manager, and network awareness, Windows 3.0 gives DOS-based computing a powerful shot in the arm.

Copyright 1990 McGraw-Hill, Inc.