Page 1 of 1

A simple video "driver"

Posted: Tue Sep 24, 2002 2:05 pm
by soilwork
Hello.

What I would need to use put my gui into an OS, and for that matter I think many people, is a little video driver

Procedure 1:
in other words a way to init the screen in basic 640x480(maybe you can explain how to go into higher resolutions too-I want to avoid BIOS and VESA-except the standard but no Vesa calls...)


Procedure 2:
a way to plot a pixel on the screen in RGB(16, 24 or 32 bit)

I dont wanna mess with palleted colours..

and this I suppose is best done is ASM but Im not a great coder in ASM so if someone could help me.. I am going to use the procedures in inline C++ (just letting you know) and will implement all and the fastest algorythms for lines(horizontal.....vert... its all in tricks of the windows game programing gurus by ASNDRE LAMONTHE)

so a bit of help would be appreciated.

thanks anticipated

PS hope u can read all I write fine... I dunno y but when I type on a forum I do all these short forms, ...'s and no capitals apostrophes... wierd ;)
later

Re:A simple video "driver"

Posted: Tue Sep 24, 2002 2:15 pm
by dronkit
avoid bios and vesa? mmm i dunno.. maybe framebuffer? maybe if you ask the video card companies for their products specs?

be aware for those "windows tricks", maybe they only work because of windows being there...

nevertheless, this could be helpful: --deadlink-- http://brand107.home.attbi.com/pc-gpe/ --/deadlink--

Re:A simple video "driver"

Posted: Tue Sep 24, 2002 2:34 pm
by Slasher
I have read the vesa docs(version 1.2 to 3) and have a general idea of what is to be done. what you do is, before switching to protected mode, call the vesa functions
these include
set vesa mode
get vesa mode info
etc
1. call the function that will tell you the available modes for that card
2. select a mode and call get vesa mode info
in the get vesa mode info call, if the card has a linear buffer, it returns a pointer to it. this buffer can then be written to directly (of course this is the really abbriviated version i'm giving you!) after certain things(selectors,etc) have been set up for it!!
get the vesa docs!!! you will need to read them over and over and over...... ;D
p.s i haven't gotten to this stage yet, still adding meat to my kernel! ;)

Re:A simple video "driver"

Posted: Tue Sep 24, 2002 3:30 pm
by soilwork
yea, I already read them a few times a while back but now I dont wanna use vesa stuff.. there has to be a way to get into standard VGA 640 480....

there have been VGA cards before vesa...

and I dont even know if vesa still is supported on newer cards like for ex gforce4

is it???

and does for ex windoze use vesa for safe mode??

Cuz thats what I want to do .. a very standard basic driver that is 32 bit and doesnt use VESA OR BIOS so when I put an actual driver of the video card in I dont have to change the b4real mode crap and so on

wanna make it modular simple and with no run arounds

thanks though..

and just a plain way to get it into 640 480 with nothing more(except the addres of the Video mem for that particular resolution) is what I need

I can handle the plot pixel thing

Re:A simple video "driver"

Posted: Tue Sep 24, 2002 3:54 pm
by Slasher
The thing is each SVGA card has a different way of switching banks so that you can write to the differnt areas of screen. Well, the thing is once you have choosen a mode and gotten into that mode through BIOS, you don't have to use BIOS or VESA again!
just get a pointer to the windowing function and call it(when you need to switch banks)! there is no further need to use vesa, only needed for switching those banks(in banked modes) or for the pointer to the LFB if in a mode that supports it. And i'm sure that the new cards will support VESA cause it saves developer the trouble of having to know port settings,adresses etc for each video card on the market! ;D
Vesa isn't hard, its just that the way people code for it is OVERKILL!!!(many unneccessary tricks and lines of code) just like the way they code Protected mode switching functions/modules!

Re:A simple video "driver"

Posted: Tue Sep 24, 2002 4:11 pm
by soilwork
ok then, but from what I know there is the new vesa that has 32 bit calls, so if Im gonna use that im gonna use the 32 directly from pmode.... and in that case

I might juse use the VESA calls throughout... but I will implement those algorythms

and is OpenGL dead or something??? CUz thats what I was planning on using..(I know the future is pretty far but I still need to plan it)

and does windoze safe mode use VESA?????????????????????

thanks again

Re:A simple video "driver"

Posted: Wed Sep 25, 2002 12:04 am
by Pype.Clicker
soilwork wrote: and is OpenGL dead or something??? CUz thats what I was planning on using..(I know the future is pretty far but I still need to plan it)
hmm. no, i don't thing it's going to die before a couples of decades. This is one of the most powerful 3D interface you can imagine.
and does windoze safe mode use VESA?????????????????????
Hard to tell, as the hardware manufacturer can put virtually whatever they want in their driver... But windows certainly uses VESA or something alike when trying to set up video for unknonw hardware (for instance "mode sans ?chec")

thanks again

Re:A simple video "driver"

Posted: Mon Sep 30, 2002 4:00 pm
by myrrdin
Hi there ;)
I'm not a code guru and I'm actually learning coding c++ and asm but I think I've fount something interesting for you in early day's when I was fascinated in coding 2d games ...

Ther were a Tutorial called The VGA Trainer Program
and it was maintained by DENTHOR of ASPHYXIA
it nicely describes how to switch to different graphic modes with inline assembly in c++ and pascal .
I've found it on a ftp but don't know which it was
maybe you'll find it ;)

myrrdin

PS. Sorry for any mistakes in language but I'm from germany and still learning english ;)

Re:A simple video "driver"

Posted: Mon Sep 30, 2002 4:05 pm
by Tom
I've read all of those tutorials before. They only let you have 320x300x256 ( forgot exact res, but something like that ).

And the code crashes PMode, even the non BIOS calls.

Re:A simple video "driver"

Posted: Mon Sep 30, 2002 4:24 pm
by suhmaamiar
The VGA Trainer Program can be found here :)

http://www.geocities.com/SiliconValley/ ... rials.html

Re:A simple video "driver"

Posted: Tue Feb 17, 2004 9:33 am
by Mastermind
There is a standard VGA 640x480 mode, but it has only 16 colors and requires complicated programming. Try setting mode 12h. But the colors don't look so good. Plus you have to deal with planes and stuff.