delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/14/02:05:33

Date: Tue, 14 Jan 1997 08:40:43 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Peter Berdeklis <peter AT chinook DOT physics DOT utoronto DOT ca>
cc: djgpp AT delorie DOT com
Subject: Re: Help! __dpmi_lock_linear_region wont!
In-Reply-To: <Pine.SGI.3.91.970113103619.26934B-100000@chinook.physics.utoronto.ca>
Message-ID: <Pine.SUN.3.91.970114083112.11860F-100000@is>
MIME-Version: 1.0

On Mon, 13 Jan 1997, Peter Berdeklis wrote:

> > AFAIK, DOS memory is always locked anyway.  So why do you want to lock 
> > it?
> 
> Note that I can not find anything in the DPMI spec that says that DOS
> memory must be locked.  In fact the function "Mark Real Mode Region as
> Pagable" says, "Under some  implementations  of  DPMI,  all  memory  in
> virtual 8086 mode is locked by default."  This suggests that under some 
> implementations it isn't.

If you run that program above DOS, AFAIK it is locked by all DPMI hosts. 
Otherwise, DOS itself could have been paged out, with obvious
consequences.  Windows/NT and Linux/DOSEmu might not lock it, but would
your program at all work on these platforms?  If not, you shouldn't be 
worried by them.

> > `real_mode_int_segment' isn't a valid protected-mode address (else you 
> > could just dereference it as a pointer, instead of the farptr, dosmemget 
> > and such, right?), that's why the call fails (I think).
> 
> I know that the segment is not a PMode selector.  The function 
> __dpmi_lock_linear_region requires the _linear_ address of the memory to 
> be locked.

Yes, but real_mode_int_segment << 4 isn't strictly speaking a linear
address either, it's an offset relative to _dos_ds base.  When you lock a 
region in your program, you use linear addresses relative to your 
program's DS base, which is different.  Try enabling nearptrs and use 
__djgpp_conventional_base + (real_mode_int_segment << 4) as the argument 
to the locking call.

- Raw text -


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