Page 1 of 3
OS Graphics
Posted: Sun Jun 17, 2007 3:46 pm
by vanillasnake21
Hi, I was wondering how is it possible to draw graphics in yr OS? Ive asked around and it seems like the only way is to use some API like DX or GL, but wat about Windows, how does it draw it's backgrounds/windows etc. Modes like VGA, SVGA and VESA are all low rez low bit depth mode, Windows can use 32 bit and use huge resolutions, which video memory does it use to achieve this? Thanks, Tim
Posted: Sun Jun 17, 2007 4:52 pm
by astrocrep
You need to do some more reading... vesa 2.0 can produce 1280x1024 16M (24bit)
-Rich
Posted: Sun Jun 17, 2007 5:28 pm
by vanillasnake21
astrocrep wrote:You need to do some more reading... vesa 2.0 can produce 1280x1024 16M (24bit)
-Rich
ok even 1280x1024x24 but still windows can produce much higher rezes in 32 bits
Posted: Sun Jun 17, 2007 5:39 pm
by exkor
vanillasnake21 wrote:
ok even 1280x1024x24 but still windows can produce much higher rezes in 32 bits
not with VESA, uninstall graphics cards driver or do clean Windows install without additional graphics drivers. You are unlikely to set higher resolution.
Graphics driver(VESA or device specific) do 2D line & rectangle drawing.
what I think:
VESA is pretty fast it is just because Windows does lots of swapping vesa is slow in windows. I have Gigabyte I-Ram and window redrawing in 1024x768 is no different than with NVIDIA drivers, but with regular SATA drive even 800x600 is extremely slow.
In comparasing with NVIDIA or ATI driver vesa is slow offcause.
Posted: Sun Jun 17, 2007 8:47 pm
by vanillasnake21
exkor wrote:vanillasnake21 wrote:
ok even 1280x1024x24 but still windows can produce much higher rezes in 32 bits
not with VESA, uninstall graphics cards driver or do clean Windows install without additional graphics drivers. You are unlikely to set higher resolution.
Graphics driver(VESA or device specific) do 2D line & rectangle drawing.
So let me get this straight, lets say we have a modern motherboard, and a standard graphics card, and I do a clean install of Windows with no display drivers, I will get a low resolution, low bit depth images. But when I install the drivers the res and bit depth go up. Ok, but what changed when I installed the driver? Is the driver now addressing a different memory location, what exactly causes the res to increase? And since this is osdev, lets say that I have a clean machine, no os, i have a simple kernel up and running in protected mode, which steps must I take to achieve the output resolution similar to that of windows. Thats basically what my question is about.
Posted: Sun Jun 17, 2007 8:58 pm
by exkor
Default low res driver doesn't know how to communicate with moder graphics card to achieve higher resolution. Video card manufactures know about their device everything and can do more.
User application calls DrawLine at fixed address but OS has a redirect address at that place which points to the driver drawing rutine.
To archive higher resolution you need to know how to communicate with specific graphic card.
VESA standard provides minimum communication.
Posted: Sun Jun 17, 2007 9:26 pm
by Brynet-Inc
It's simple, Video card manufactures design "Graphics cards", These graphics cards are normally proprietary in design.
The manufacture writes a driver to "communicate" with their hardware, Normally targeting Microsoft Windows.
Now, Be happy as a clam with VESA/VBE modes...
You won't be able to do much more with these proprietary cards unless you convince a few manufactures to release documentation and/or drivers.
Posted: Sun Jun 17, 2007 9:28 pm
by vanillasnake21
exkor wrote:
To archive higher resolution you need to know how to communicate with specific graphic card.
VESA standard provides minimum communication.
So does that mean that Windows does use my graphics card? So technically speaking unless its an established OS theres no way to directly talk to the gfx card becuase the devs of the card have to provide you with a driver for to do so, am I correct?
Posted: Sun Jun 17, 2007 9:30 pm
by Brynet-Inc
vanillasnake21 wrote:So does that mean that Windows does use my graphics card? So technically speaking unless its an established OS theres no way to directly talk to the gfx card becuase the devs of the card have to provide you with a driver for to do so, am I correct?
Most manufactures at least provide VESA/VBE, It's a commonly available standard..
But yes, You have very little hope to use any of the proprietary hardware 2D/3D acceleration abilities. (
Or other features..)
(
You could always do some reverse engineering work for a few years.. With a bus analyzer etc..)
Posted: Sun Jun 17, 2007 9:53 pm
by vanillasnake21
Brynet-Inc wrote:
But yes, You have very little hope to use any of the proprietary hardware 2D/3D acceleration abilities. (Or other features..)
(You could always do some reverse engineering work for a few years.. With a bus analyzer etc..)
I see, but is there any way to port the drivers to a custom OS? Or at least configure the os in a certain way that it will be able to use the driver written for a different os?
Posted: Sun Jun 17, 2007 9:56 pm
by exkor
vanillasnake21 wrote:
Or at least configure the os in a certain way that it will be able to use the driver written for a different os?
Your OS needs to support Windows or Linux API. Most of it, the kernel api probably. So that linux/windows programs can run in your os.
Posted: Sun Jun 17, 2007 10:17 pm
by vanillasnake21
exkor wrote:vanillasnake21 wrote:
Or at least configure the os in a certain way that it will be able to use the driver written for a different os?
Your OS needs to support Windows or Linux API. Most of it, the kernel api probably. So that linux/windows programs can run in your os.
yea, so thats a definite no , that would be
huge amount of work, besides I think that VBE 2.0 is perfect for what I need, the supported resolution is 1024x768x32, but since VESA and VBE are all standards does that mean that the older gfx cards might not support them? [/b]
Posted: Sun Jun 17, 2007 11:25 pm
by Brendan
Hi,
Brynet-Inc wrote:But yes, You have very little hope to use any of the proprietary hardware 2D/3D acceleration abilities. (Or other features..)
(You could always do some reverse engineering work for a few years.. With a bus analyzer etc..)
It is possible to get (some) information for some video cards - most video cards made before 1995, S3, Vodoo/banshee, etc. Also Intel release full documentation and open source device drivers for their onboard video, and some people think that (now that ATI is owned by AMD) it's only a matter of time before modern ATI cards become open too. Lastly, most video cards can be programmed as "standard VGA" cards, which doesn't give you high resolution but it's better than nothing.
However, video is complicated - even with all the necessary documentation it'd take ages to write a good stable device driver. This is especially true for full 2D/3D acceleration, and shader languages (which typically means implementing a compiler to convert a standard shader language into a video card specific language).
vanillasnake21 wrote:I see, but is there any way to port the drivers to a custom OS? Or at least configure the os in a certain way that it will be able to use the driver written for a different os?
That wouldn't necessarily be easy either. To support Windows drivers you'd need to implement half of WIndows (in this case, it'd be easier to join Reactos developers). Porting X11 drivers would be a bit easier, but they have the same problems as the rest of us (most modern video cards aren't supported well due to lack of documentation).
VESA/VBE is a standard way of getting framebuffer support. Regardless of what you do I'd recommend (as an absolute minimum) using VESA/VBE to set a default video mode during boot, as this will allow people to use graphics while you're trying to get better video drivers working. Depending on how it's done this could mean users need to reboot to change video modes, but I remember when Windows 95 was like that (and except for games, how often do you change video modes anyway?)...
There's 3 different versions of the VESA/VBE standard. Older video cards might only support "version 1", and very old video cards might not support any. Even if no VESA/VBE is supported you'd still be able to use the (non-VBE) video BIOS functions to setup standard VGA video modes (e.g. 640 * 480 * 16 colours).
Cheers,
Brendan
Posted: Mon Jun 18, 2007 6:38 am
by Brynet-Inc
Yeah I should of checked what type of card he was using.. My bad
Still, I'll continue to follow the
The Open Graphics Project, Hopefully they'll release a cheap card that'll be fun working with.
(
I'm also hoping AMD will release documentation on ATI graphics hardware though..)
Posted: Mon Jun 18, 2007 9:40 pm
by vanillasnake21
Thanks for the replies ), theyve cleared up a lot for me, Cheers