[comp.os.msdos.programmer] DIR/ALL

peter@ecc.tased.oz (09/19/90)

Can anyone describe neatly and succintly how 286 and 386 addressing works?

I understand that the 86 uses the low 20 bits of ((16 bit CS)*4 + (16 bit IP))
which specifies a physical memory address, but how do the others do it?

does a 286 use the low 24 bits of ((20 bit CS)*4 + (16 bit IP)), or what?
does this indicate a physical memory loction, or some kind of selector?

what does a 386 use, and therefore, what is its total virtual/physical address
space?

is addressing the only benefit of protected mode?
-- 
Peter Mayne (Systems Object)               Peter@ECC.TasEd.Oz.Au
Elizabeth Computer Centre                +-----------------------------
Link Rd, Claremont                       |VAXen don't use segments.
Tasmania, 7011, Australia                |

stever@Octopus.COM (Steve Resnick ) (09/22/90)

In article <1990Sep19.151115.206@ecc.tased.oz> peter@ecc.tased.oz writes:
>Can anyone describe neatly and succintly how 286 and 386 addressing works?
>
>I understand that the 86 uses the low 20 bits of ((16 bit CS)*4 + (16 bit IP))
>which specifies a physical memory address, but how do the others do it?
>
>does a 286 use the low 24 bits of ((20 bit CS)*4 + (16 bit IP)), or what?
>does this indicate a physical memory loction, or some kind of selector?
>
>what does a 386 use, and therefore, what is its total virtual/physical address
>space?
>

And now for something completely different... :)

The 80286 and 80386 use a different mechanism for addressing in protected mode.
The addresing is the same as the 8086 in real mode. The protected mode 
addressing uses selectors to represent segments. A selector is basicly a 
bitmap indicating physical address, privlage, owner, attributes, etc.

>is addressing the only benefit of protected mode?

No. Proected mode provides a lot of benefits. Programs in real mode can
do mean and nasty things like chew your interrupt vector table, 
overwrite DOS, etc. In protected mode a program can only address memory
it owns (unless it is running in kernal mode). This provides a usefull 
debugging environment. In real mode you are, essentially, emulating an 8086
with an 8086 address space (except for an additional 62KB at the upper 
end of the 1M address space) in protected mode the 80286 has a 16M limit, 
and the 80386 has a 4GB physical address space and a 4 terabyte virtual limit.
The 80386 can also run multiple virtual 8086 tasks, which can be usefull
in implementing virtual machine operating systems.

-- Steve

-- 
----------------------------------------------------------------------------
steve.resnick@f105.n143.z1@FIDONET.ORG #include<std_disclaimer.h>
Flames, grammar errors, spelling errrors >/dev/nul
----------------------------------------------------------------------------