[comp.os.msdos.misc] Can one prevent emm386 from using VM86 mode ?

cm@jet.uk (colin manning) (06/28/91)

When you run emm386, it always seems to run DOS in virtual 8086 mode.

If you are only using emm386 in order to make upper memory blocks available, 
which do not need paging or any other facilities of protected mode in order to 
be accessible, is it possible to prevent it moving the 386 to virtual 8086 
mode ? I.e have emm386 make UMB's available, but leave the 386 in real mode.

There are two reasons for wanting this:

1. Virtual 8086 mode is slower for certain operations.
2. You cant run software that likes to switch in and out of protected
   mode itself.
-- 
- Colin Manning, cm@jet.uk
- Disclaimer: Please note that the above is a personal view and should not 
  be construed as an official comment from the JET project.

veit@du9ds3.uni-duisburg.de (Holger Veit) (06/28/91)

In <1991Jun28.124744.27009@jet.uk> cm@jet.uk (colin manning) writes:

>When you run emm386, it always seems to run DOS in virtual 8086 mode.

>If you are only using emm386 in order to make upper memory blocks available, 
>which do not need paging or any other facilities of protected mode in order to 
>be accessible, is it possible to prevent it moving the 386 to virtual 8086 
>mode ? I.e have emm386 make UMB's available, but leave the 386 in real mode.

>There are two reasons for wanting this:

>1. Virtual 8086 mode is slower for certain operations.
>2. You cant run software that likes to switch in and out of protected
>   mode itself.
>-- 
>- Colin Manning, cm@jet.uk
>- Disclaimer: Please note that the above is a personal view and should not 
>  be construed as an official comment from the JET project.

Apparently, the existing version of emm386 has not such a switch. Is is 
possible to write an emm386 driver with the requested features? I think, no.
The iAPX386 data sheet doesn't say it exactly, but the paging feature of the 386
which is used in the ems driver is working in protected mode and V86 mode only.
The paging unit is necessary to map memory from >1MB into the declared EMS
page frame. There may be other possible solutions for that, e.g. mapping 
existing memory into the EMS page by means of special features of the 386-AT
chipset and then using the INT15 copy each time there is an EMS page fault,
but this is much more slow. And what happens with INT15 when the processor is
already in protected mode...
I'm not quite sure, but heard, that the main part of the DPMI software is 
located in the EMM driver, so a software which uses this standard should
coexist with EMM386 (most commercial DOS-extenders already do or will do
in the next release; does of course not help with existing software).

Holger Veit

--
|  |   / Holger Veit             | INTERNET: veit@du9ds3.uni-duisburg.de
|__|  /  University of Duisburg  | BITNET: veit%du9ds3.uni-duisburg.de@UNIDO
|  | /   Fac. of Electr. Eng.    | UUCP:   ...!uunet!unido!unidui!hl351ge
|  |/    Dept. f. Dataprocessing | 

mir@opera.chorus.fr (Adam Mirowski) (06/29/91)

In article <1991Jun28.124744.27009@jet.uk>, cm@jet.uk (colin manning) writes:
%% When you run emm386, it always seems to run DOS in virtual 8086 mode.
%% 
%% If you are only using emm386 in order to make upper memory blocks available, 
%% which do not need paging or any other facilities of protected mode in order to 
%% be accessible, is it possible to prevent it moving the 386 to virtual 8086 
%% mode ? I.e have emm386 make UMB's available, but leave the 386 in real mode.
%% 
%% There are two reasons for wanting this:
%% 
%% 1. Virtual 8086 mode is slower for certain operations.
%% 2. You cant run software that likes to switch in and out of protected
%%    mode itself.

No, it is impossible.

First, Intel 386 manuals tell so. :-)

Second, even if you would like to use the method already signaled in
a recent Dr. Dobbs article to access extended memory as an array in
real mode by not flushing a cache (the segment cache) when retuning
from protected mode, it is not possible because the cache for pages
(TLB) has only 32 entries, which is not enough to map the entire real
mode memory. Very quickly a cache miss would occur and would have to
access the page directory and the page tables, which precisely aren't
in its address space anymore...
Anyway, I believe this cache is automatically flushed and disabled when
386 returns to real mode, so I stop these divagations just here. :-)

-- 
Adam Mirowski,  mir@chorus.fr (FRANCE),  tel. +33 (1) 30-64-82-00 or 74
Chorus systemes, 6, av.Gustave Eiffel, 78182 Saint-Quentin-en-Yvelines CEDEX