Board index » delphi » DPMI physical address mapping (VESA linear frame buffer)

DPMI physical address mapping (VESA linear frame buffer)

Hello,

I'm using DPMI fn. 800h to map physical video memory address into linear
address space. Works fine, except when I run my program from IDE or from DOS
prompt with RTMRES loaded, linear address returned by the function is
increased by 1Mb (or whatever memory I'm trying to map) on every call and
eventually program halts (doesn't return from int 31h).

This only happens when I'm in DOS and there's himem, himem + emm386 or qemm
in the background.  With a clean boot (ctrl-F5) or when the program is run
from W98 DOS box everything works OK (I allways get the same linear
address).

If I run program twice I get addresses 80002000h and 80102000h. If I run it
again, I get 80202000h, but if I exit from IDE and get back in (or type Exit
and then again RTMRES), I get 80002000h again. Looks like DPMI16BI.OVL (?)
is keeping mapped memory and doesn't free it when program terminates.
There's a DPMI function that should do that (801h, Free Physical Address
Mapping), but it is version 1.00 function and not implemented by BP's DPMI
(returns CF=1).

Any ideas on what could be wrong here or how to get around it? I tried
replacing dpmi16bi.ovl and rtm.exe but it doesn't help.

Robert

 

Re:DPMI physical address mapping (VESA linear frame buffer)


Quote
> I'm using DPMI fn. 800h to map physical video memory address into linear
> address space. Works fine, except when I run my program from IDE or from
>....

... and in the end you have to program it yourself!  :-)  If anyone else is
having the same problems, I grabbed int 31h, saved first fn. 800 mapping
result into the LDT and returned it on all other 800h calls. I uploaded the
sources (2 units, 2 examples, 2 .exes, 37Kb) to
http://www.geocities.com/SiliconValley/Campus/1234/DPMI800.ZIP

Robert

Re:DPMI physical address mapping (VESA linear frame buffer)


Quote
> I'm using DPMI fn. 800h to map physical video memory address into linear
> address space. Works fine, except when I run my program from IDE or from
>....

... and in the end you have to program it yourself!  :-)  If anyone else is
having the same problems, I grabbed int 31h, saved first fn. 800 mapping
result into the LDT and returned it on all other 800h calls. I uploaded the
sources (2 units, 2 examples, 2 .exes, 37Kb) to
http://www.geocities.com/SiliconValley/Campus/1234/DPMI800.ZIP

Robert

Other Threads