Meer data voor minder geld! Data recovery
  • Windows 2000 &16-Bit Applications

    It’s been a long time since 16-bit applications were commonplace. Nevertheless, even in the 21st century, there may still be instances where you want to run an old 16-bit application on a 32-bit OS (operating system) such as Windows 2000.

    When trying to run 16-bit applications on Win2000, it’s important to know that not every such application will run correctly, as Win2000 does not provide a native 16-bit environment. Rather, they run in an environment that attempts to emulate the original 16-bit OS. Because Win2000 changed the rules regarding how applications can function in order to improve overall system reliability, programs that try to communicate directly with hardware (a common practice of the era) or use virtual drivers (which have a .VXD extension) won’t work with Win2000 at all. Games and many utilities are good examples of programs that will probably be incompatible with Win2000 (or later versions, for that matter).

    Let’s look at how Win2000 accommodates 16-bit applications. To run 16-bit software, Win2000 relies on two built-in software components, one of which is the NTVDM (NT Virtual DOS Machine).

    01032273

    When you right-click a 16-bit program shortcut and select Properties, you have the option of running the application in its own private memory space.

    Machine Within A Machine

    The NTVDM is a 32-bit Windows application that emulates an Intel 486 PC running MS-DOS (version 5.0, as it happens), and it’s the underpinning of any 16-bit DOS or Windows application. When you run a DOS application in Win2000, the NTVDM starts and provides a complete emulated environment for the application to run in. The NTVDM itself is treated like any other 32-bit Windows application, and it’s preemptively multitasked, which means the OS ensures each application gets its fair share of the processor’s attention. This is in contrast to cooperative multitasking, which relies on each individual application to yield the CPU after its allocated time has elapsed.

    When you run multiple DOS applications in Win2000, each one runs in its own NTVDM with its own dedicated operating environment and memory space. (Incidentally, this is the same way DOS applications run in 16-bit versions of Windows.) Because each DOS application is thus segregated from other DOS applications and the OS, a problem with an individual application can’t cause other programs or the OS to fail.

    The number of NTVDMs that can run simultaneously is limited only by the amount of RAM you have installed, and though the maximum amount of memory that DOS can address is only 1MB, each NTVDM may consume more or less than that.

    Windows On Windows

    When dealing with 16-bit Windows applications, things are a little different. When you launch a 16-bit Windows application, Win2000 still uses the NTVDM as its foundation. Next, another component referred to as WOW (Windows on Windows) is loaded, which adds additional layers that emulate Windows 3.1 and allow 16-bit applications to function. As with a DOS application, the 16-bit Windows application’s operating environment, consisting of the NTVDM, WOW, and the application, is run as a 32-bit application and preemptively multitasked alongside other programs running on the system.

    Whereas multiple 16-bit DOS applications are always isolated from each other by Win2000, things are a little different if you run two or more 16-bit Windows applications. By default, these applications will run within the same NTVDM and WOW environment. Therefore, all the 16-bit applications running in the environment are cooperatively multitasked, and access to the CPU is managed by the applications themselves rather than the operating system. This is identical to the way 16-bit applications are multitasked when run natively on 16-bit versions of Windows.

    The downside to cooperative multitasking is that should one application have a problem, it will very likely undermine all other running applications. This is why a problem with an application in 16-bit Windows OSes often caused other programs, if not the entire system, to crash. (Because Win2000 isolates the 16-bit environment, failure of a 16-bit application can’t destabilize the overall system, but it can cause other 16-bit apps running with it to fail.)

    01032273When you right-click a DOS
    program icon and select Properties, you can customize
    the virtual memory environment the application will run in.

    Separate But Equal

    The way around the cooperative multitasking problem is to run each 16-bit Windows application in a separate memory space; that is, its own NTVDM and WOW environment. This won’t necessarily keep 16-bit applications from crashing, but it will keep errant 16-bit applications from negatively impacting each other.

    If you run your application from a command line, you can do this by typing start /separate before the path and program name. If you launch the 16-bit application via a program icon, create a shortcut to the application. Right-click it, select Properties, select the Shortcut tab, and select the Run In Separate Memory Space option.

    While improving reliability, running 16-bit applications in separate memory does have disadvantages, as well. Two 16-bit applications running in separate memory spaces will use more memory than the same two applications running in a shared environment, so running multiple 16-bit apps separately will rapidly consume system resources. Also, if your 16-bit applications use shared memory to communicate with each other, they probably won’t function correctly when run in separate memory spaces.

    Win2000 doesn’t load the NTVDM or WOW components automatically when the OS boots. This was presumably done to conserve memory.

    Once a 16-bit application is launched and the NTVDM and WOW (if necessary) components are loaded, they will remain in memory even if the 16-bit programs are later closed. This was done to save the time of setting up the emulated environment again each time a 16-bit application is run, but if you’re using an older system with limited memory, you’ll need to reboot the system or close the NTVDM and WOW processes to reclaim RAM. To see if they’re running, press CTRL-ALT-DELETE. Click the Processes tab and look for processes named Ntvdm.exe and Wowexec.exe.

    Troubleshooting Tips

    In Win2000 with Service Pack 2, Microsoft made a change to the NTVDM designed to improve compatibility. As it turns out, the change may also cause problems with some 16-bit applications, resulting in the following error message when launched: “<Program Name> caused a General Protection Fault in module KRNL386.EXE at 0001:6382 – Choose close. <Program Name> will close.”

    If this occurs, modify the Registry to disable the compatibility feature, which should allow the application to run. To do so, launch the Registry Editor by clicking Start and Run, typing regedit, and clicking OK. (Be very sure you know what you’re doing in the Registry and back up your system beforehand, as one small misstep in the Registry can render your PC unbootable.) Go to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CURRENT CONTROLSET\CONTROL\SESSIONMANAGER\APPCOMPATIBILITUY\Ntvdm.exe. In the left pane, highlight the NTVDM key and press DELETE. Click Yes and restart your PC.

    Running 16-bit DOS applications in a window can cause them to respond sluggishly to keyboard or mouse input. The screen may update slowly or display odd colors. This can often be resolved by upgrading to the most recent Service Pack (keeping the previous tip in mind). In addition, running the application in full-screen mode should eliminate the problem—press ALT-ENTER while the application is running. To start the app in full-screen mode, right-click the program icon and click Properties. Select the Screen tab, Window, and Apply.

    Many 16-bit applications that can use a printer require a default printer to be configured to work properly, so make sure your system has a default printer.

    Although Win2000 has the Config.sys and Autoexec.bat startup files, these aren’t used by 16-bit apps. Files called Config.nt and Autoexec.nt, which are in C:\WINNT\SYSTEM32, are loaded each time an NTVDM starts up. If you start a 16-bit application and receive an error message similar to “16 Bit Windows Subsystem – Hidden Console of WOWVDM. The NTVDM CPU has encountered an illegal instruction,” it usually means that one or more entries in either file violate Win2000’s software rules. To correct this, restore generic Config.nt and Autoexec.nt versions from the Win2000 CD using the Expand utility. The original files are called Config.nt_ and Autoexec.nt_.

    by Joseph Moran