Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!cernvax!chx400!bernina!neptune!inf.ethz.ch!brandis From: brandis@inf.ethz.ch (Marc Brandis) Newsgroups: comp.windows.ms Subject: Re: Performance degradation in 386 enhanced mode Message-ID: <22076@neptune.inf.ethz.ch> Date: 21 Jan 91 11:10:38 GMT References: <4491@mindlink.UUCP> Sender: news@neptune.inf.ethz.ch Reply-To: brandis@inf.ethz.ch (Marc Brandis) Organization: Departement Informatik, ETH, Zurich Lines: 49 In article <4491@mindlink.UUCP> a752@mindlink.UUCP (Bruce Dunn) writes: > On some machines, but not all, tasks running in 386 enhanced mode are much >slower than in standard mode. This can be seen by using the computational >index from the Norton Utilities in both standard mode and 386 enhanced mode. >It can also be seen for some programs such as the Microsoft Flight simulator, >which become extremely sluggish in 386 enhanced mode but are ok in standard >mode. When I get you right, the problem occurs only when you are running DOS programs in a DOS window. If this is true, then I have an explanation for you. > There seems to be some correlation with the speed of machines - one report >has stated that the problem occurrs on 16 MHz machines but not on 20 MHz >machines. > I have the problem on a 16 MHz 386 (not a 386 SX). I wonder if the >problem is because my memory above 1 megabyte is not on the motherboard, but is >on a memory card on the bus which can only be accessed at bus speed. My >hypothesis is that when run in standard mode, Windows runs mainly in the 1 >megabyte of easily accessible memory on the motherboard, but when I ask for >enhanced mode much more use is made of the memory which can only be accessed >through the bus. Windows does completely different things when running DOS programs under standard mode or under enhanced mode. In standard mode, the CPU switches back to real mode and lets the program run in real mode as if it were under plain DOS. This is the same method that is used in OS/2 1.x for the DOS box. In enhanced mode, a virtual machine in which to run the DOS program is created. There are two important differences between a program running in real mode and one running in a VM86. First, in real mode, only the first megabyte of memory can be accessed, forcing your program into this first megabyte. In VM86, the memory that your program sees can be located anywhere. It uses virtual addresses, which are relocated to wherever the OS likes it. That is, in standard mode, the DOS program goes always into the first megabyte, while in enhanced mode it may not. On your machine this seems to make a big difference, as the memory above 1 Meg is much slower. The other difference is that while in real mode, the CPU has full access to all resources, in standard mode certain accesses cause traps to the underlying OS (in this case, to Windows, which means a switch to another task running in protected mode). If the program relies heavily on direct hardware accesses, you may notice a performance degradation due to these traps. Marc-Michael Brandis Computer Systems Laboratory, ETH-Zentrum (Swiss Federal Institute of Technology) CH-8092 Zurich, Switzerland email: brandis@inf.ethz.ch