Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Allocate memory above 1 Mb

9 views
Skip to first unread message

Igor

unread,
Jun 13, 2003, 7:48:18 AM6/13/03
to
Is it possible to allocate large memory buffer (2 Mb or more) above
first meg. of memory and get it physical address? I need to do it for
old PCI device driver. Target: PM / MS DOS 6.22, compiller: Watcom C
11c (or
OpenWatcom).

The first thing I did is the google messages base search for this
topic...
But I found only one answer - use DPMI DOS memory allocation function
(DPMI 0.9 / 0x0100). It works, but I can't to allocate more than 1 Mb
in address space and get it physical address.
Another idea I found is to use DPMI memory mapping (DPMI 0.9 /
0x0800), but it seems wrong in my situation (my device is not memory
mapped, I only need to get the physical address of large memory block
I alocate to put it into the device registers). Can anybody in two
words (without details, I find it) explain me what I must to do?

---== Posted via the PFCGuide Web Newsreader ==---
http://www.pfcguide.com/_newsgroups/group_list.asp

Stephen Howe [TeamSybase]

unread,
Jun 14, 2003, 1:31:37 PM6/14/03
to
> Is it possible to allocate large memory buffer (2 Mb or more) above
> first meg. of memory and get it physical address? I need to do it for
> old PCI device driver. Target: PM / MS DOS 6.22, compiller: Watcom C
> 11c (or
> OpenWatcom).

I assume this is using DOS4GW.

Lets talk about the PCI board first. Do you need to allocate 2MB and then
somehow inform the PCI board of the physical address or does it comes with
its own 2MB?

If the latter, all you need to do is call DPMI 800h with the physical
address. You will be handed back a linear address which after you set up a
descriptor, you can then use a far pointer to read/write to the memory.
Later call DPMI 801h when you have finished.

If the former, Microsoft wrote a back-door specification to DPMI called
Virtual DMA services which sound to me what you want. See here
http://www.delorie.com/djgpp/doc/dpmi/ch5.n.html
click on entry 0800h and read Notes at end for some snippets.

I personally have never used Virtual DMA and have had difficulty getting
details of how it works.

<later>

Okay, I have found details. A copy of the Virutal DMA specs is here
http://www.nondot.org/sabre/os/files/ProtectedMode/VDMA_API.txt

It also may be worth your while looking at its parent page.
http://www.nondot.org/sabre/os/articles/ProtectedMode/

Hope this helps

Stephen Howe [TeamSybase]
London, UK


0 new messages