delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/05/29/09:52:05

Date: Thu, 29 May 1997 16:49:58 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: djgpp AT delorie DOT com
Subject: Re: virtual memory , paging ect
In-Reply-To: <338CE8D7.7A56@nowhere.com>
Message-ID: <Pine.SUN.3.91.970529164139.17853A-100000@is>
MIME-Version: 1.0

On Wed, 28 May 1997, James Hetfield wrote:

> I'm new to protected mode programming and im trying to write a program
> that requires alot of memory. Anyway I get an error everytime that says
> I dont have enough dpmi memory. Dosn't dpmi support 
> up to 256 mbytes vmen.

That depends on the DPMI host.  If you run on plain DOS and use CWSDPMI, 
then you have 128MB + whatever is physically installed on your machine, 
provided that you have at least 128MB of free disk space.  Other hosts 
like Windows may not let you use more than 64MB.  See the FAQ for more 
details.

> If so how do I use it? Heres some partial source
> of what I'm trying to do ( this is for an emulator btw)
> UWORD *RAM[0xffffff]
> 
> RAM[0]= malloc(0x80000);  /* rom image */
> RAM[c00000] = malloc(0x10000);   
> RAM[c40000] = malloc(0x10000); 

Please post the smallest complete program that does this and fails, and 
also the exact error message that you get.  Your problem might stem not 
from malloc, but from something very different.  For example, if RAM[] is 
automatic variable, then it overflows your stack (which is by default 
only 256K).

A word or two about your system configuration (hardware and software, 
including memory managers, DPMI hosts, Windows if any, etc.) would be 
also nice.  Remember: we only know as much about your problem as you 
elect to tell us.

> Someone told me I would need to write my own virtual paging
> routines,handles ect

Based on what you tell (which ain't much), I don't think you should go 
that far.  Yet.

- Raw text -


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