www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/12/02/06:31:09

From: hjohnsen AT cicomore DOT fr
Message-Id: <9612021128.AA07256@mail.cicomore.fr>
Date: Mon, 02 Dec 96 11:59:54 -0400
To: djgpp AT delorie DOT com
Subject: Re: Simulation a linear frame buffer

>> I'm writing a graphics library, but my SVGA card does not support a linear
>> frame buffer. I want to write a program that allows me to write routines
>> which need not worry about bank switching in VESA video modes.

>Your choices are limited.  You can:
>
>1) Use DJGPP V1.x, and use (or write) a GRX type graphics driver to provide
>   the linear frame buffer emulation.  Note, this only works in non-DPMI mode,
>   so you can't use your program under Windows, or any other DPMI environment.
>2) Use DJGPP V2.x, and write a page fault handler for for CWSDPR0 or PMODE.
>   (Thus, you are still limited to DOS-only type execution).  You must use
>   one of those DPMI providers, since you need to be able to directly
>   modify the page tables, install an interrupt hook (instead of an exception
>   hook) at ring 0 for speed, and use the instructions to recover CR2.
>   Most of the code can be copied verbatim from the setup/drivers from V1.x.
>   It's actually possible (since the source to CWSDPMI is available) to 
>   do this in ring 3 also, but it's more complicated (so you would get it 
>   working under ring 0 first).
>
>I had originally planned to do this for V2.x to provide GRX compatibility in
>DOS, but there just aren't enough hours in the day.


I have started (but not finished) a GRX20 compatible driver that nearly
simulate a linear frame buffer under DPMI 0.9 . It would be easy to handle
a real linear frame buffer under DPMI 1.0 but I use W95 wich provide only
DPMI 0.9 ! My implementation use a 64K selector (fs or gs) mapped on the
video memory and an offset in this selector (a global reg). The only thing
to do before accessing the memory is to call an init func with the x and y
coords, after that you don't need to handle by hand the switching of banks
via VESA calls even if you cross banks. Indeed, crossing banks will
generate page faults (because offset will be <0 or >64k !!! what a great
idea !!), handled by the driver.

Send me mail if you want the source but be aware that this driver is not
finished (and I don't want to finish it yet because i'm working on a
graphic user interface, beta available in a couple of weeks).


-----------------------------------------------------------
Harald JOHNSEN
FRANCE
-----------------------------------------------------------


- Raw text -


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