Mail Archives: djgpp/1997/04/30/01:41:57
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 -