Mail Archives: djgpp-workers/1996/07/10/13:05:51
===============================================================================
Markus F.X.J. Oberhumer <markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at>
Subject: limited nearptr ?
To: djgpp-workers AT delorie DOT com
===============================================================================
Please excuse if some of my following ideas are complete nonsense,
but I'm no DPMI guru at all.
I've ported the nice 3d graphics library lib3d
( http://www.ozemail.com.au/~keithw ) to djgpp (sitting on top of Allegro).
For reasons of speed I'd like to add support for page flipping
using VESA 2.0 linear framebuffer. For this to work the video
memory *must* be accessed using normal pointers (ds segment) as
otherwise too much code has to be changed.
I don't want to use 'enable_nearptr' for obvious reasons of
system stability.
Let's assume I have 1 MB video memory and a DPMI host that
supports physical_address_mapping.
How realistic is the following idea:
I malloc 1 MB of page aligned memory (ds segment) and set a
physical_address_mapping for my video memory to another segment
(allocate descriptor).
Can I now somehow map my allocated segment into the ds segment
(by setting some linear base value or whatever) ?
Or can I force the address mapping into the ds segment by
doing some pointer arithmetics so that it ends up in my
allocated buffer ?
( This way I'd be wasting 1 MB, but the system is still reasonable safe. )
I know that emx (rsx under DPMI) supports a function '_memaccess'
that maps physical memory into the ds segment. Does anyone know
how they do this ?
I welcome any suggestions,
Markus
- Raw text -