delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/06/07/20:03:31

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Protected Mode programming
Date: Fri, 30 May 1997 22:36:59 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 45
Message-ID: <338F568B.4176@cs.com>
References: <338db41a DOT 6844334 AT news DOT pcisys DOT net> <01bc6d5a$d98cd160$LocalHost AT vpoulain>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp105.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

POULAIN Vincent wrote:
> 
> I'm not a DJGPP expert, so I don't know if ways to not to go under
> protected mode
> exists.

They do not.  In order to run the CPU in 32-bit mode, DJGPP programs
must enter protected mode.

> You'll certainly be amazed when you'll see that a swp disk will be
> automatically created too
> if you run out of memory !
> 
> About this (this is a question this time), do these swaps happen when the
> physical
> RAM is over, or when the stack is overflowed ?
> I hope it's the second solution, otherwise, my actual project needs some
> optimizing !

All available physical and virtual memory is pooled into one huge block
of memory that your programs can draw from.  When you use more memory
than is physically available, some physical memory will be swapped to
disk; this is called virtual memory.  The stack space is finite and is
determined when your program is compiled.  The default is 256K; if you
write a program that uses large automatic variables or deeply recursive
functions, you may want to increase the size of the stack.  To increase
the stack, do one of the following:

In your program:
	int _stklen = /* size of stack in bytes */;

After compilation, run 'stubedit' on your program:
	stubedit program.exe -minstack=1024k

Remember that the stack is drawn from the same memory pool as the rest
of your program's data, so making it too large may reduce the amount of
data you can store on low memory machines.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I      |   mailto:fighteer AT cs DOT com   |
| God's final message to His Creation: | http://www.cs.com/fighteer |
| "We apologize for the inconvenience."| <<< This tagline under >>> |
|                      - Douglas Adams | <<<    construction    >>> |
---------------------------------------------------------------------

- Raw text -


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