www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/30/01:41:57

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Extra Memory
Date: Wed, 30 Apr 1997 00:35:45 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 37
Message-ID: <336693E1.5F85@cs.com>
References: <33669DFE DOT 78AB AT worldnet DOT att DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp107.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Patrick J. Morris wrote:
> 
> Does DJGPP automatically use conventional memory then RAM or do I have
> to make it use RAM/EMS. If so then how?

You don't need to do anything.  DJGPP uses 32-bit flat model Dos
Protected Mode Interface (DPMI), which gives it completely transparent
access to all remaining physical memory, and also allows use of hard
drive space for virtual memory.  Technically, DJGPP programs run
entirely in extended/expanded memory, except for a tiny amount of
conventional memory for the DPMI host and the real mode stub.

What this means is that you can write a program like:

int main( void )
{
    char *p = malloc( 16 * 1024 * 1024 );
    printf( "%c", p[12345678] );
    return 0;
}

without ever needing to worry about memory models, segments, or anything
like that ever again, and even if you don't have 16 MB of RAM!  Enjoy
freedom like you've never experienced before.  ;)

But before you get too carried away, please download and read the DJGPP
Frequently Asked Questions list (v2/faq210b.zip), for a detailed
explanation of how DJGPP uses memory, and what you need to do (and don't
need to do) to make it work.  There's a lot more to protected mode than
just a 32-bit flat memory model.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |     mailto:fighteer AT cs DOT com     |
| Plan:  To find ANYONE willing to |   http://www.cs.com/fighteer   |
| play Descent 2 on DWANGO!        | Tagline: <this space for rent> |
---------------------------------------------------------------------

- Raw text -


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