News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

SVGA at the hardware level

Started by Bieb, May 04, 2005, 01:58:16 AM

Previous topic - Next topic

Bieb

Hi all.  I'm working on an OS now with Aero and ThomasAnthony, and it's time to get some basic SVGA graphics capability.  So, I know that I need to set the video mode, and then I'll have a certain space in memory that I can write color codes to to draw on the screen.  Problem is, I can't find anywhere how to actually set the video mode, what space in memory is used, and what format the color codes are.  I've found one premade library, but it's only for Linux, doesn't help at all at the kernel level.  So, does anyone know where I can get this info?

MichaelW

You should be able to get most of the information you need from the VESA BIOS EXTENSION (VBE), Core Functions Standard, Version 3.0, available here:

http://www.vesa.org/public/VBE/

I posted a VESA information program in this thread (16-bit DOS, but it will run OK under Windows 2000 and probably XP if you set the PIF to run it full screen):

http://www.masmforum.com/simple/index.php?topic=158.15

The link to the VESA site used to work, but they are apparently now in the middle of some major changes.
eschew obfuscation

BogdanOntanu

Your best chance is to setup the mode using VESA 2.0 BIOS in real mode before going to protected mode.
This way you will get the address of the LFB ==> the location of the screen where you can write your pixels.
Pixelformats are described in the VESA documents also. You can also obtain a list of available modes from the BIOS.

For switching in pmode you will have to either:
1) do a brief return to real mode and switch modes via BIOS
2) code a V86 moditor for the same thing

3)In the long run you will have to code a driver for each and every video card out there.

Do not hope too much for the latest NVidia and ATI cards. Information about how to setup modes, and use hardware acceleration 2D or 3D is secret and not available on the internet. Who ever has it also signed a NDA not to reveal it. Even Linux uses close source binary only drivers released by NVIdia and ATI... good luck in convincing them to release a driver for your kernel....

Also beware of the older VESA 1.2 cards that do not support LFB and require a "bank switching routine" that is specific to each and every card. For older cards you might find those routines in Linux sources... however they are buggy from my experience.

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

MichaelW

VBE3 introduced a new Protected Mode Entry Point that can be used to directly call the VBE functions as 16-bit protected mode code, but the feature is optional, and it is not supported by the one version 3.0 BIOS I have available. The attachment is an updated version of the VESA information program that includes a test for Protected Mode Entry Point support.

[attachment deleted by admin]
eschew obfuscation

AeroASM

Quote from: BogdanOntanu on May 04, 2005, 03:08:32 AM
Your best chance is to setup the mode using VESA 2.0 BIOS in real mode before going to protected mode.

Ideally we want it to be switchable anytime, because Bieb wants a CLI and a GUI.

Quote from: BogdanOntanu on May 04, 2005, 03:08:32 AM
3)In the long run you will have to code a driver for each and every video card out there.

Isn't the point of the VESA BIOS to standardise this?

thomasantony

Hi,
  It was sort of a standard in the time of the VGA. But as time went on and technology advanced, standards ceased to exist or there are many standards as everyone wants their own standards. This is one of the reasons why the VESA modes of both MenuetOS and SolOs doesn't work on my system. The VESAInfo tells me I have VESA 3.0

VbeSignature = 'VESA'
VbeVersion = 0300
OemString = 'Intel(R) 8xx Chipset Video BIOS'
Capabilities:
  DAC width is switchable to 8 bit per primary color
  Controller is VGA compatible
  Normal RAMDAC operation
  No hardware stereoscopic signaling support
Supported VBE display modes:
  0109h, 010Ah, 010Bh, 010Ch, 011Dh, 010Eh, 0100h, 0127h,
  0128h, 0101h, 0110h, 0111h, 0112h, 0102h, 0103h, 0113h,
  0114h, 0115h, 0105h
TotalMemory = 512KB
OemSoftwareRev = 2182
OemVendorName = 'Intel Corporation'
OemProductName = 'Intel(R) 8xx Chipset'
OemProductRev = 'Hardware Version 0.0'
Protected Mode Information Block not found


Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Bieb

#6
So, is there not a hardware interrupt I can call that will put all video cards into the desired screen mode?  And Aero, the CLI can be done in SVGA mode, so we can just set the screen mode when the OS first boots.

MichaelW, the interrupts detailed in that document you gave me a link to seem to be just what I need.  Can I count on them to work with all graphics cards?

Edit - w00t!  Post number 11111111b.

MichaelW

QuoteMichaelW, the interrupts detailed in that document you gave me a link to seem to be just what I need.  Can I count on them to work with all graphics cards?

They should work for any VGA display adapter that was produced in the last 10 years or so, but because of the variation in mode support, you would need to check the capabilities anyway. For systems with no VESA SVGA support you could fall back to VGA.
eschew obfuscation

BogdanOntanu

Thomas,

Wit as little as 512KB of video RAM you can not enable not even 640x480 truecolor resolution
Under those circumstances VESA 3.0 is useless.
Windows uses its own driver that bypases VESA (works directly with the vido card) and this way it can use whatever memory is available.
If you want to use MenuetOS or SolarOS  -> just add more shared memory to your video board, 4M will do for a start this can be easy done in the BIOS.

Aero,

Standards are not loved by competition and as a consequence things are kept secret. Even in the VESA times the AF specification was secret. Do not hope for many open standards in humman race... they just talk about it.

You can switch at anytime by returning to realmode for a short time :P (only VESA modes)
or coding a driver for each board for all other modes.

MichaelW,
Protected Mode Interface is useless in most implementations, it is rarely used in any kind of application so they do not bother to implement or test it. On this planet  standards  mean: " it has to work with that major used application..."
if there is no application --> no standard is needed :D

Ambition is a lame excuse for the ones not brave enough to be lazy.
http://www.oby.ro

AeroASM

LoL - just had an idea. I will email ATI and ask them for all the info on their graphics cards and see what they see.

(probably won't work, but it is worth a try)

Bieb

If not, then we may just have to sneak into their HQ all Splinter Cell like (it's in Canada) and interrogate one of their workers. :bdg  Or else maybe make our own video card.

MichaelW

When last I checked there seemed to be a possibility of getting technical information from ATI, but not from Nvidia.

http://developer.nvidia.com/page/documentation.html

http://www.ati.com/developer/proginfo.html

The possibility of ATI technical information was here:

http://apps.ati.com/developers/devform1.asp
eschew obfuscation

rea

That is very nice.

About make of own video car, that should be nice, but even there exit how you design it?

I remember a project that have a graphic card based on ray casting (If I remember corectly), trying to search I find this ones, perhaps of little help http://www.ep.liu.se/exjobb/isy/2005/3624/ http://graphics.cs.uni-sb.de/~jofis/SaarCOR/DynRT/DynRT.html . But I remember that such project is not any of the ones before.. :P... some one remember or know the page of such graphic card?? or perhaps I was dreaming?? :)