Date: Sun, 10 Oct 1999 12:29:00 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Ben Davis cc: djgpp AT delorie DOT com Subject: Re: A choking start for DPMI In-Reply-To: <7tj2lg$n15$1@news7.svr.pol.co.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 7 Oct 1999, Ben Davis wrote: > I've written a rather hyperactive game using DJGPP and Allegro, in DOS. > Naturally it uses DPMI, which involves disk-swapping. Paging to disk is not supposed to happen unless your program used up all the available physical memory. How much memory do you have installed on the machine where this happens, and how much memory do you estimate your program needs to run? > I would like to know if there is a way of causing all disk-swapping to > happen before the game displays any graphics or makes any sound. Try setting the _CRT0_FLAG_LOCK_MEMORY bit in the _crt0_startup_flags variable (it is documented in the library reference). This will lock all the memory your program is using and prevent paging, unless the target machine doesn't have enough physical memory to begin with. > If I need > to specify all the variables which must be in physical memory, then I can do > it. There's a library function __dpmi_lock_linear_region which can be used to lock an individual variable or a function, and there are two helper functions _go32_dpmi_lock_code and _go32_dpmi_lock_data. Look them up in the library docs. Note that if you have lots of variables which need locking, locking them one by one might be tedious.