Mail Archives: djgpp/1997/04/21/02:55:38
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 -