Message-ID: From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: Fastest bitblt? Date: Tue, 29 Feb 2000 15:16:57 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Reply-To: djgpp AT delorie DOT com Eli Zaretskii writes: >>> 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. True: every memory access goes through both the selector and page table protection mechanisms. But both of those mechanisms depend for their usefulness on the selector settings and page table contents, so the fact that the processor is making these checks is useless unless the OS has correctly set things up to prevent access to any unowned memory. A truly protected environment like Linux or NT has to make sure that the processor is always set to prevent any illegal accesses, while something like Win9x is far less strict about that. So I think it is fair to say that although some protection is always available, the Watcom setup, or djgpp with nearptr enabled (which is similar to how Watcom always works) is only very weakly protected, and a stray pointer reference is far more likely to corrupt memory rather than being trapped. When not using nearptr, djgpp is far safer, but still not perfect compared to a system where the OS itself is enforcing these rules. Shawn Hargreaves.