www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1993/01/23/14:01:11

Date: Sat, 23 Jan 93 19:03:49 +0200
From: Grzegorz B. Mazur <gbm AT ii DOT pw DOT edu DOT pl>
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: VESA driver development

After getting some messages I assume that:
1. No VESA driver exists
2. I will get your blessings to create one with any >=256 capability.

If above is true, here is a short summary of what I know and what
I am planning to do. HELP and COMMENTS INVITED.

  Most of todays VGAs are VESA compatible - this includes new Tsengs,
Trident 8900 with BIOS v >=3.00, and really NEW boards, like the one
I am currently falling in love with, Cirrus AVGA3 (CL-GD5422). For all
older boards you can get a software VESA driver, so it really looks
like a standard. VESA supports any direct color modes, including
32K, 64K, 16M (currently implemented) and anything one can imagine.
Mode numbers are standarized as well as mode switching and bank switching.

  After analyzing GO32 and driver code I found two problems:
1.(this can be false) The variable holding no. of colors inside graphics
driver is 16 bits long, and cannot express neither 64K nor 16M. It would
be much nicer if its meaning was "bits per pixel" - single byte would be
enough (even for Silicon Graphics systems with >120 bits :-) ).
2.(The REAL problem) Bank switching can be done in one of two ways:
- by invoking int 10h,
- by calling real mode function with 16 bit far return (faster),
under current circumstances (the architecture of go32 and its graphics
interface) none of these methods can be used.
It seems to me that the simplest method would be as follows:
- use new graphics driver interface,
- create extended real mode init function, getting all the necessary VESA
  parameters,
- create special bank switching code segment descriptor in GDT during
  graphics driver init - this would be possible if we can slightly extend
  the extended graphics driver interface (.grn),
- call the function in paging routine, depending on flag set by init
  (either old-style, simple one or the new, with its own descriptor).
The bank switching routines in VESA BIOSes I examined so far are
very well-behaved and can work in protected mode. This is not a VESA
feature, but it seems to be dependable. Anyway, we are hackers...

The first thing I tried was to call int 10h from graphics driver's 
bank switching routine. I wasn't surprised with the result (or rather
no result), but let me ask a question: Why not allow "int xx" passing
from any context to DOS?

That's all for today... I wait for your comments.
If anyone is interested, I can post my vesa graphics C module,
containing mode switching, putpixel and putimage functions.
It works with Watcom C 386 and Borland, and sometimes with DJGPP, using
any mode to 1024x768x256, 800x600x32/64K & 640x480x16M.


- Raw text -


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