Mail Archives: djgpp/2000/02/29/09:52:30
On Mon, 28 Feb 2000, Damian Yerrick wrote:
> >Not true. Memory protection is built into protected mode,
> >at least to some degree.
>
> But an OS can entirely disable it (e.g. what Watcom DOS4GW or
> DJGPP nearptr do).
No protected-mode OS can entirely disable protection, because
protection is an integral part of the CPU's memory addressing and
mapping unit. It is simply impossible to disable all of the
protection and stay in protected mode, there are no instructions to do
that.
The Intel manuals have an extensive description of all the aspects of
protection. I suggest to read those parts. (The manuals are
downloadable from the Intel site.)
> >Access rights checking and segment-level protection are
> >always active, as they are inherent to PM.
>
> That is, unless the OS gives user programs access rights to all
> memory in one fell swoop, allowing them to overwrite the kernel.
It can't do that! Even with 4GB segment limit, there are still page
tables and page directories, interrupt and call gates, ring-0 vs
ring-3 access rights, etc. Your program will Page Fault if it tries
to access a page that isn't mapped in according to the page tables; it
will GP Fault if you try to call privileged code if you don't go
through one of the valid call gates, etc.
> >Page-level protection is optional.
>
> And is how Windows 9x and NT do it IIRC.
In some cases, yes.
- Raw text -