[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Linear address mapping

Jim Ulrich wrote:

> If you are allocating the buffers on the host PC then try using the
> DPMI function INT.31 FUNC.0100 to allocate your buffers.
>         to call:
>         AX = 0x0100
>         BX = number of paragraphs (16-byte chunks) to allocate
>         returns:
>         AX - Real mode segment of allocated block
>         DX - First selector for allocated block, if a 16-bit
>                 program calls this function multiple
>                 contiguous selectors will be allocated.
> from this you should be able to calculate the physical address of
> the memory block.
> Jim Ulrich
> Pathlight Technology
> jimu@pathlight.com

That works fine. Thank you for this.

But what if I want to allocate memory above 1M or very large
memory blocks ( multiple Mb ) ?

If I allocate linear memory above 1M I could propably get the
phsyical address through examining the page directory entry and
the page table entry in the MMU.

But this would only lead to the physical address of the first 
4K page. If I'm right I have to do this with every 4K block of 
my linear memory space because I can't be sure that the whole
linear address space is mapped into a continous address space 
in the pysical memory.

That would mean that in worst case a 512K DMA has to be broken
down to 128 4K DMAs !? There must be a better solution ! 

My only idea (at the moment) to avoid this is to disable paging
mechnism through turning off the MMU. But I didn't find a way to
do this with watcom c and the dos4gw extender either.


Tobias Stumber
Robert Bosch GmbH
31134 Hildesheim

email: tobias.stumber@fr.bosch.de