Mail Archives: djgpp/1998/03/24/06:36:07
Eli Zaretskii writes:
> Probably your best bet would be to use VDS where it's available
> and conventional memory where it isn't, since in the latter case
> you can safely assume it's plain DOS.
VDS does seem like a good option for this: I hadn't realised that
it can be used with any arbitrary memory regions, but from the
look of things it should be able to simply remap a linear region
into a consecutive range of physical addresses and tell me where
they are: exactly what I need to do!
Does anyone here have any experience of using these VDS functions?
Obviously I can just try this for myself, but I'm curious to
know roughly how much overhead there is in the buffer locking
(this will affect whether I can do it on the fly when blitting
images to the screen, or if it needs to be done in advance with
some more cunning technique to decide which bitmaps should be
prepared in this way).
>> I need some way to allocate a block of contiguous
>> physical memory locations, but unless I've missed something,
>> there are no DPMI functions to do this (using conventional
>> memory will break under Windows).
>
> Why do you think conventional memory won't work on Windows?
My understanding is that Windows may remap the conventional memory
to any part of your physical RAM: otherwise how could it run
multiple DOS boxes at the same time? It works to program the DMA
controller directly with a conventional memory address, because
Windows will recognise what you are trying to do and arrange for
the memory to be remapped in a suitable way, but it has no way of
knowing what is going on with the VBE/AF driver and graphics
controller.
Please correct me if I'm wrong about this, because it would make
my life a great deal easier (and make me feel very stupid for
asking this question in the first place :-) but I'm pretty sure
that in Windows there is no 1 <-> 1 mapping between conventional
and physical memory...
Shawn Hargreaves.
- Raw text -