delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1996/07/10/13:05:51

From: k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at (Oberhumer Markus)
Message-Id: <199607101655.SAA07591@c210.edvz.uni-linz.ac.at>
Subject: limited nearptr ?
To: djgpp-workers AT delorie DOT com
Date: Wed, 10 Jul 1996 18:55:11 -0200 (MET DST)
Return-Read-To: markus DOT oberhumer AT jk DOT uni-linz DOT ac DOT at

===============================================================================
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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019