[comp.windows.ms] Is this real protected mode?

cdh1@eds1.UUCP (C. Daniel Hassell) (06/13/90)

Well, I sent in the Win 3.0 upgrade coupon and now I wait.
In the meantime, I have a few questions for those of you who actually
have your copies . . .

Does anyone know how the "standard" mode (286) actually works?  The
80286 doesn't have a hardware-based virtual-8086 mode, so Windows must
simply load each program as a regular protected-mode task, and then
proceed to trap and redirect all the interrupts, etc.  Although you
still have a 64K segment limit, 286 protected mode uses 24-bit memory
addresses to get a 16-MB address space.  

But this raises an interesting question.  What would happen if one of
those tasks began direct accesses to more than 1-MB?  After all, if a
DOS program's addresses are interpreted as look-ups into a segment
descriptor table, which contains the true address in 24-bit fashion,
then there is no inherent barrier at 1-MB, even within a task. 
Accessing more memory ought to be only a matter of allocating more 64K
segments for your code or data.

Maybe Windows itself imposes such a barrier to keep order (I hope
not)?  Maybe whatever remains of DOS while running in PM creates the
barrier?

Have I missed something, or is this indeed do-able?

If you can shed some light for a poor, confused soul, I'd appreciate
it.

CD Hassell
cdh1@eds1!EDS.COM
psuvax1!eds1!cdh1

gpsteffl@sunee.waterloo.edu (Glenn Patrick Steffler) (06/14/90)

In article <445@eds1.UUCP> cdh1@eds1.UUCP (C. Daniel Hassell) writes:
>80286 doesn't have a hardware-based virtual-8086 mode, so Windows must
>simply load each program as a regular protected-mode task, and then
>proceed to trap and redirect all the interrupts, etc.  Although you

Right: The two eighty six has a protect mode which allows Windows
to use 16Mb of memory.  When a DOS service is required, Windows
interprets the software/hardware interrupt and drops to real-mode
where the DOS call, or real mode interrupt gets serviced.

Windows gives its applications access to all of the extended memory
in your machine.  By giving the app a series of contiguous selectors
(64 Kb each) the program can access the memory.  GlobalAlloc returns
a selector.  If you allocated 1Mb, you would have some number of 
selectors set up consecutively such that long pointers would allow
use of all of the memory.

>still have a 64K segment limit, 286 protected mode uses 24-bit memory
>addresses to get a 16-MB address space.  

Yep.

>But this raises an interesting question.  What would happen if one of
>those tasks began direct accesses to more than 1-MB?  After all, if a

Standard mode runs in protect mode, so the memory is there...but as
selectors, NOT segments.

>DOS program's addresses are interpreted as look-ups into a segment
>descriptor table, which contains the true address in 24-bit fashion,
>then there is no inherent barrier at 1-MB, even within a task. 
>Accessing more memory ought to be only a matter of allocating more 64K
>segments for your code or data.
>
>Maybe Windows itself imposes such a barrier to keep order (I hope
>not)?  Maybe whatever remains of DOS while running in PM creates the
>barrier?

Why would a barrier have to be imposed?  Am I missing something here?

>Have I missed something, or is this indeed do-able?

This is getting recursive! :-)

>If you can shed some light for a poor, confused soul, I'd appreciate
>it.
>CD Hassell
>cdh1@eds1!EDS.COM
>psuvax1!eds1!cdh1

Lets hope what I blurbed made sense.

-- 
Co-Op    _____           "Bo doesn't know software" - George Brett
Scum   _/|__Q_\___ 
U of   | ww--+----#\    "Catch the mystery catch the spit!" - Tom Saywer (Rush)
Loo'91 ~~()~~~~~()~~                                     Glenn Patrick Steffler