www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/21/02:55:38

Date: Mon, 21 Apr 1997 09:44:57 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Dim Zegebart <zager AT post DOT comstar DOT ru>
cc: DJGPP Mail List <djgpp AT delorie DOT com>
Subject: Re: Some dpmi questions ?
In-Reply-To: <3356BA7C.972@post.comstar.ru>
Message-ID: <Pine.SUN.3.91.970421094358.2725A-100000@is>
MIME-Version: 1.0

On Thu, 17 Apr 1997, Dim Zegebart wrote:

> Just a couple of questions ;)

Since nobody replied this for a long time, I will try my best.  I
suggest you send these questions to Charles Sandmann
<sandmann AT clio DOT rice DOT edu> who is the author of most DPMI-related stuff
in DJGPP, and ask him to help you, in case you have any further
questions.

> What is diference between _go32_dpmi_lock_data and
> _dpmi_lock_linear_region ?

Look at their sources in djlsr201 (on src/libc/go32/gopint.c), it's
pretty obvious.  In a nutshell, `__dpmi_lock_linear_region' needs a
linear address, so you need to add the base address of the appropriate
selector (DS for data, CS for code); the `_go32' variety does that for
you.

> *mem
> [...]
> mem=malloc(n*sizeof(typeof(mem)))
> _go32_dpmi_lock_data(mem,n*sizeof(typeof(mem))) ???? How can I use
> _dpmi_lock_linear_region here

See above.  You need to call `_my_ds()', get its base address, etc.

> [...]
> tmp=remalloc(mem,new_n*sizeof(typeof(mem)))
> mem=tmp
> _go32_dpmi_lock_data(mem,n*sizeof(typeof(mem))) ???? What happen
> here?

`realloc' may move the block.  If it does, you need to lock the new
one.

> Do I have to 'unlock' first mem ?

That depends on your application.  If you want to lock as few memory
as you can, you need to check whether `realloc' moved the block and if
so, unlock the previous address.

> What is the field 'handle' in _dpmi_meminfostructure

It's needed to handle the memory which is sbrk'ed from the DPMI host.
You will need to ask Charles for the details.

- Raw text -


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