I would like my prog to detect the DPMI it is running on.
Found out:
"Int 31H Function 0400H
Get Version [0.9]"
http://www.delorie.com/djgpp/doc/dpmi/api/310400.html
and
"Int 31H Function 0401H
Get DPMI Capabilities [1.0]"
http://www.delorie.com/djgpp/doc/dpmi/api/310401.html
Will fail on CWSDPMI, work on HDPMI (?)
How to use theese features in FB, having the result in BASIC
variables ?
Are there other possibilities of dection of DPMI config ?
Detect DPMI
IIRC those functions are available only if DPMI is installed. You would, at least normally, call Interrupt 2Fh function 1687h to determine if DPMI is installed. You can find the necessary information in Ralf Brown’s Interrupt list.
An HTML version is here:
http://www.ctyme.com/rbrown.htm
And the download version here:
http://www-2.cs.cmu.edu/~ralf/files.html
This is quick and dirty, and *not* tested:
An HTML version is here:
http://www.ctyme.com/rbrown.htm
And the download version here:
http://www-2.cs.cmu.edu/~ralf/files.html
This is quick and dirty, and *not* tested:
Code: Select all
option explicit
dim as short rAX, rBX, rCX, rDX, rDI, rSI, rES
asm
mov ax, &h1687
int &h2f
mov [rAX], ax
mov [rBX], bx
mov [rCX], cx
mov [rDX], dx
mov [rDI], di
mov [rSI], si
mov [rES], es
end asm
if rAX = 0 then
if rBX and 1 then print "32-bit programs supported"
print "processor type = "; rCX and &hff
print "DPMI major version = "; rDX shr 8
print "DPMI minor version = "; rDX and &hff
print "paragraphs required for private data = "; rSI
print "DPMI mode-switch entry point segment = "; rES
print "DPMI mode-switch entry point offset = "; rDI
else
print "DPMI not installed"
endif
sleep
Interesting, but ...
"IIRC those functions are available only if DPMI is installed"
I had thought that FB would run ALWAYS uder DPMI in DOS.
What you suggest seems to be the REAL-MODE INT used by the "stub"
BEFORE switching into PM.
I had thought that FB would run ALWAYS uder DPMI in DOS.
What you suggest seems to be the REAL-MODE INT used by the "stub"
BEFORE switching into PM.
Yes, if there is no DPMI host, then your program won't be running in the first place.
You can use the DJGPP DPMI wrapper functions to do this easily:
You can use the DJGPP DPMI wrapper functions to do this easily:
Code: Select all
#include "dos/dpmi.bi"
dim version as __dpmi_version_ret
__dpmi_get_version(@version)
with version
print "major: "; .major
print "minor: "; .minor
print "flags: "; .flags
print "cpu : "; .cpu
end with
dim flags as integer
dim vendor_info as zstring * 128
dim vendor_name as zstring ptr
print "DPMI 1.0 capabilities: ";
if __dpmi_get_capabilities(@flags, @vendor_info) = 0 then
print
print "flags: "; flags
print "major: "; vendor_info[0]
print "minor: "; vendor_info[1]
vendor_name = @vendor_info + 2
print "name : "; *vendor_name
else
print "not supported"
end if