www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/08/02:47:20

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Protected Mode
Date: Sat, 08 Nov 1997 11:42:55 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 41
Message-ID: <3464503F.4D38@cs.com>
References: <3463F799 DOT 5ACF AT mailexcite DOT com>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp240.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

BlueShade wrote:
> 
> I have done a lot of programming in DJGPP, and I still don't get what
> the heck the difference is between protected mode and real mode, and
> what you need to do to write code in protected mode.  Got any
> suggestions as to where I could look?

The DJGPP Frequently Asked Questions list contains a lot of information
about protected mode vs. real mode in chapters 17, 18, and others.  The
DJGPP Lexicon at http://www.delorie.com/djgpp/doc/lexicon/ defines
protected mode along with many other useful terms:

<snip>
protected mode 
      This is when the computer is running in a mode whereby the
operating system can protect its resources from the program that runs.
This allows the OS to run multiple programs at the same time, without
letting them interfere with each other. 
      In addition to that, protected mode is also the only way to make
programs too big for low memory. 
<snip>

In protected mode, your program has complete and total freedom to roam
around its own address space, but when it begins poking around outside
of its assigned space, it needs to use special techniques to tell the
operating system that what it's doing is okay.  DOS adds additional
complications, since it is a 16-bit operating system and DJGPP programs
run as 32-bit applications.  To talk to DOS, 32-bit programs must do
lots of complicated and time-consuming things (see the FAQ).  The
tradeoff is that, while in protected mode, programs can run quite a bit
faster than in real mode, manage memory much more efficiently, and the
programmer can take comfort in the knowledge that a stray pointer won't
accidentally wipe out his hard drive.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
|    *  Proud user of DJGPP!  *    |   http://www.cs.com/fighteer   |
|    ObJoke:  If Bill Gates were a robber, not only would he        |
|     shoot you, but he'd send you a bill for the bullets.          |
---------------------------------------------------------------------

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019