[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: TNT and extended memory under Win95
- To: Mailing List Recipients <pci-sig-request@znyx.com>
- Subject: re: TNT and extended memory under Win95
- From: Adam Barnes <amb@transtech.co.uk>
- Date: Wed, 28 Aug 1996 18:05:24 +-100
- Resent-Date: Wed, 28 Aug 1996 18:05:24 +-100
- Resent-From: pci-sig-request@znyx.com
- Resent-Message-Id: <"YWJgl.0.Z31.Gx79o"@dart>
- Resent-Sender: pci-sig-request@znyx.com
>> Thank you for your response. I've tried this and it came back with
>> error 130 for the _dx_map_phys() call meaning this is not supported in
>> my DPMI. I am running Windows/95, so what else can I do?
>> By the way, I am using v7.0 of the TNT DOS Extender.
>> Thanks again
>> Henry Lau
OK. The problem here is that you are trying to use TNT's
device mapping capability in a DPMI environment (0.9)
that does not support it.
First, try your program in a raw DOS session to prove that
there are no other obstacles.
We then need a way of doing device mapping under
DPMI 0.9 and I believe this is possible. You will
need the DPMI specs - check out Intel's web site
(www.intel.com). Using DPMI calls you should
be able to map in your card. The only gotcha
is that the linear memory will not be simply
tacked on to the end of your program's existing
data segment (as TNT does under DOS, and
as my previous example assumes). You
will therefore need to create a new selector
(using the DPMI calls) and use this with
the PokeFarDword etc functions to access
the mapped memory.
Adam Barnes
Transtech Parallel Systems Ltd
amb@transtech.co.uk
PS: I am also using TNT 7.0 and MSVC 2.0
PPS: The following code fragment (which I just found)
may point the way:
/*******************************************/
union _REGS regs;
int linear;
FARPTR myfarptr;
regs.x.ax = 0x0000; // DPMI Allocate LDT Descriptors
regs.x.cx = 1; // I require just 1
int86(0x31, ®s, ®s);
if (regs.x.cflag == 1)
fail("failed allocating LDT descriptor");
selector = regs.x.ax;
regs.x.ax = 0x0800; // DPMI Physical base Mapping
regs.x.bx = (base >> 16) & 0xFFFF;
regs.x.cx = base & 0xFFFF;
regs.x.si = (size >> 16) & 0xFFFF;
regs.x.di = size & 0xFFFF;
int86(0x31, ®s, ®s);
if (regs.x.cflag == 1)
fail("failed mapping physical memory");
linear = regs.x.cx | ((regs.x.bx) << 16);
regs.x.ax = 0x0007; // DPMI Set Segment Base base
regs.x.bx = selector;
regs.x.cx = (linear >> 16) & 0xFFFF;
regs.x.dx = linear & 0xFFFF;
int86(0x31, ®s, ®s);
if (regs.x.cflag == 1)
fail("failed setting segment base");
regs.x.ax = 0x0008; // DPMI Set Segment Limit
regs.x.bx = selector;
regs.x.cx = ((size-1) >> 16) & 0xFFFF;
regs.x.dx = (size-1) & 0xFFFF;
int86(0x31, ®s, ®s);
if (regs.x.cflag == 1)
fail("failed setting segment limit");
// you may now use the following to poke:
// FP_SET( myfarptr, address, selector );
// PokeFarDWord( myfarptr, data );
// where
// address = offset in mapped memory
// data = data
// peeking etc is similar
/*******************************************/
¤ ¸ ¨