Mail Archives: djgpp/1998/08/13/01:31:05
On Thu, 13 Aug 1998 00:21:24 -0300, Endlisnis <s257m AT unb DOT ca> wrote:
>Steve Carter wrote:
>
>> Anyone know how to allocate a page of memory, aligned to the page
>> boundary? It would be a shame to allocate 128k to just use 64. This is
>> for DMA to my soundcard, so it's a problem that must have been solved
>> umpteen times.
>
>I need to know that too. I want to use __djgpp_map_physical_memory, but it
>says I need a page-aligned data-block. What is page-aligned and how to I
>create/calculate a page-aligned address.
AFAIK page boundrys are EMM but paragraph boundrys are for regular
ram.
A page of regular ram is 64K and always starts on a paragraph boundry.
A paragraph boundry occours every 16 bytes. In dos far pointers are
two part something like SSSS:OOOO . (segment:offset)
The absoloute memory address is calculated like so. ( SSSS << 4 ) +
OOOO
Perhaps when you read page boundry the author means paragraph boundry.
An address of 0a00:0000 where the offset has a zero value gives an
address range of 64k. if you increment the offset by 0xffff + 1 the
offset wraps around back to zero, so the 64k page.
All this mess is because of 16 bit registers and 20 address lines (of
the 8086).
Hope that helps
Cheers Richard
- Raw text -