Methods of Execution

Windows applications may be run under OS/2 Version 2.0 in six ways:

  • The original licensed Windows V3.0 or Windows V2.x may be started in a VDM, and will allow Windows V3.0 and Windows V2.x, and its applications, to be run in real mode.

  • A Single Application VDM (SAVDM) may be started, for a single Windows application. The icon supplied with the Windows application will be defined within the Workplace Shell desktop.

  • A Multiple Application VDM (MAVDM) may be started, which activates the Windows Program Manager, allowing the user to access a number of Windows applications.

  • A Separate "seamless" WIN-OS/2 VDM may be used, which is basically a SAVDM running in its own window under the Workplace Shell. See "Seamless" WIN-OS/2 VDM below for further information.

  • A common "seamless" WIN-OS/2 VDM may be used, which is a special kind of MAVDM. WIN-OS/2 will start all "seamless" WIN-OS/2 VDMs in a single session, but in separate windows running under the Workplace Shell. See Common "Seamless" WIN-OS/2 VDM below for further information.

  • A separate "seamless" WIN-OS/2 VDM may be used, and the WIN-OS/2 Program Manager may be launched from there. This will allow to launch other Windows applications from there and therefore, this would actually be a MAVDM running in its own window under the Workplace Shell. Every Windows application launched from there would run in its own window under the Workplace Shell but share the same WIN-OS/2 kernel.

    No license of Windows V3.0 or Windows V2.x is necessary to run Windows applications, as the Windows environment is an implementation of Windows V3.0 and Windows V2.x within OS/2 V2.0 (WIN-OS/2) itself. Multiple instances of any of the above methods may be started in the same system.

    However, note that in the current release, "seamless" WIN-OS/2 VDMs and common "seamless" WIN-OS/2 VDMs may only be started on machines with VGA graphics. Seamless execution of Windows applications is not supported using other graphics modes.

    The following applications are started (iconized) when the first VDM (either SAVDM or MAVDM) is started:

  • Modified Windows Clipboard Viewer Program

  • DDE Server/Agent Application

  • Presentation Manager icon

  • Task Manager (no icon)

  • Windows Program Manager (not visible in a SAVDM)

  • Clock (MAVDM only)

  • Windows Control Panel (MAVDM only).

    Each of these methods is described in the following sections.

    Single Application VDM (SAVDM)

    A SAVDM is the recommended way of running Windows applications under OS/2 Version 2.0 in a non-VGA system, such as a PS/2 with an XGA or 8514/A display adapter, because seamless execution is only supported with VGA graphics. Using a SAVDM is also recommended if the user wishes to run Windows applications in real mode (seamless execution is supported only in Windows standard mode).

    Since the Windows application runs in a self-contained Windows environment in its own VDM, it is fully protected from other applications, and the system is protected from it. This means that if the application crashes for any reason, it only affects its own VDM, and thus only that one application. Other Windows or DOS applications running in other VDMs are not affected, nor are OS/2 applications. This represents a significant improvement in reliability over DOS/Windows, in which a failure in one Windows application may bring down the entire Windows system or corrupt the data areas of other Windows programs, since all Windows applications and Windows itself share the same address space.

    Figure "Single Windows Application Running under OS/2 Version 2.0"

    Also, by running in SAVDMs, Windows applications are timesliced more effectively than in a MAVDM or native DOS/Windows environment, since each application is under the control of OS/2's scheduler and its pre-emptive multitasking. In a MAVDM environment, all Windows applications are still subject to the cooperative multitasking under Windows itself.

    Ctrl-Esc is the key combination used to display the Windows "Window List".

    Alt-Esc is the key combination used to switch to the next session as defined in the Workplace Shell.

    The SAVDM provides a simple approach to Presentation Manager integration. The application is loaded from the Workplace Shell in a very similar way to a DOS application, and the user may easily switch back to Presentation Manager, as well as share data via clipboard or DDE with other Windows or Presentation Manager applications. The icon displayed on the Workplace Shell desktop is the application's own Windows icon.

    Each SAVDM will indicate the Windows execution mode based on the file type specified in the EXE header of the Windows application. Real mode will be indicated for Windows applications written for versions of Windows prior to 3.0. Auto-Select (real or standard mode) is selected by default for Windows 3.0 applications, based on processor type.

    Multiple Application VDM (MAVDM)

    The MAVDM is almost identical to running Windows 3.0 on a DOS-based machine. The MAVDM uses the Windows 3.0 Program Manager to start multiple Windows applications within the same VDM, running on a separate Windows desktop. It therefore provides maximum "look and feel" compatibility for the DOS/Windows user migrating to OS/2 Version 2.0.

    Note that the use of a MAVDM or the common "seamless" WIN-OS/2 VDM is a requirement where Windows applications must communicate with one another via shared memory.

    Ctrl-Esc is used within the VDM to display the Windows "Window List".

    Alt-Esc is used to switch to the next session defined in the Workplace Shell.

    For a MAVDM, the Workplace Shell icon will represent the MAVDM itself, rather than the applications executing within the VDM. Terminating an application within the VDM will not terminate the VDM itself. The user must select Exit Windows in the Windows Program Manager to terminate the VDM, or close the VDM from the Workplace Shell.

    In the MAVDM and the common "seamless" WIN-OS/2 VDM environment, all Windows applications are still subject to the cooperative multitasking of Windows itself. Since several Windows applications are typically loaded in the same VDM, the MAVDM environment shares some of the pitfalls of DOS/Windows in terms of robustness. If one Windows application crashes within a MAVDM, it may cause all the applications within that VDM to fail. However, the effect is only within that VDM; other VDMs running DOS or Windows applications, and other processes executing under OS/2 Version 2.0, are not affected and continue execution. So even here there are benefits from running Windows applications under OS/2, for greater resilience from system crashes. Furthermore, the MAVDM environment provides additional error checking and handling over that provided by Windows 3.0 itself.

    "Seamless" WIN-OS/2 VDM

    One of the goals of OS/2 2.0 is to be the integrating platform of choice; that is, to provide a desktop environment from which all types of applications:

  • 16-bit OS/2
  • 32-bit OS/2
  • DOS
  • Windows

    may be executed in a uniform manner. Although OS/2 V2.0 is able to support Windows applications effectively in SAVDMs, the additional ability to launch a Windows application from a Workplace Shell object, and execute it on the OS/2 desktop along with Presentation Manager and DOS applications, achieves the goal of creating an environment that is explicitly simple and uniform enough that the end user need not be concerned with the implicit differences between the types of applications that need to be executed in it. OS/2 V2.0 will concern itself with the differences and "seamlessly" accommodate the applications. This level of support extends not only to execution but to installation and configuration of the application as well.

    Figure "Single Windows Application(s) Running "Seamless" on the OS/2 Version 2.0 Desktop"

    The appearance of Windows applications on the Workplace Shell desktop requires that the Windows video device driver and the Presentation Manager video device driver communicate and coordinate their access of the video hardware. Each device driver effectively "owns" its area of the screen. Allowing the Windows display device driver to directly access the video hardware avoids the more cumbersome process of a complete task switch. However, this hardware access poses integrity problems in the areas of simultaneous access of hardware, rectangle invalidation handling, window management, and the exchange of window state information between Presentation Manager and seamless VDMs supported by separate video device drivers.

    To address these problems, a high performance virtual device driver named (VWIN.SYS), capable of interprocess communication, was created. This VDD serializes the simultaneous accesses to the hardware, oversees the exchange of window state information between Presentation Manager and seamless VDMs, and establishes the addressability of Presentation Manager resources (either directly or indirectly) by the Windows display device driver.

    When the system is initialized, the Presentation Manager display driver calls the VWIN.SYS driver, and passes a pointer to an array of structures that specify the protocol required to enable the Windows device driver to access Presentation Manager resources. To prevent a seamless Windows application from hanging the entire Workplace Shell desktop, the Windows video device driver and the Presentation Manager video device driver together implement and monitor a VDM "heartbeat" or counter. This counter is stored in the Presentation Manager display driver's data area and is made available to the Windows display driver.

    The "heartbeat" counter information is made available to the Windows DD to indicate that hardware access is in progress by the Windows DD. The "heartbeat" counter is incremented by the Windows DD prior to the video hardware access. If a Windows application is locking up the Workplace Shell desktop, it is the responsibility of VWIN.SYS to identify the current owner of the semaphore, terminate the VDM and tell the Presentation Manager DD to clean up.

    In the event that the Presentation Manager display device driver requests hardware resources and the time interval allotted for this access to occur is exceeded, then:

  • If it is the first request, the Presentation Manager display driver records the heartbeat value, process ID and thread ID of the process in control of the hardware, and raises an internal flag.

  • If it is the second request, and the heartbeat value, PID and TID have not changed, the Presentation Manager display driver calls the Windows display driver before clearing the flag, and passes it the PID and TID.