Page 1 of 1

Windows's Graphics

Posted: Wed Mar 26, 2003 8:24 pm
by MattC
Hey, Ive been looking for a good way to display high-rez graphics in pmode for about a year now and havn't found much helptul information :-\
How does msft windows draw its graphics?
does it do it in vm86 mode? switch to real mode, then draw?, Use i/o ports to communicate with the video hardware? VESA?
Thanks 8)
Btw, if it does use the i/o ports, is there some standard (like whats used in the generic vga driver that windows comes with) for video hardware port communications

Re:Windows's Graphics

Posted: Wed Mar 26, 2003 8:33 pm
by Mastermind
Hmmm. It's not that hard to do, but it would lead you off onto a tangent when you could've been working on the really important parts... If you really want to, then proceed... Does df know how to do hi-rez gfx? 'Cause I don't...

Re:Windows's Graphics

Posted: Thu Mar 27, 2003 2:28 am
by Pype.Clicker
well, it's usually unnecessary to switch to real mode to plot pixels. Once the graphic mode is set (which may require a switch to VM86 -- but this was no problem for Win9X as it NEEDED the VM86 for its DOS/WIN16 tasks :), your video memory is just memory. Get a page mapping it and write to that page, your pixels will be plotted. period.

Now, except in the case of "Recovery Mode" ("Mode Sans Echec" -- i dunno how they called this in english ::) ), setting the appropriate video mode and drawing to the screen is the job of the video driver provided by your graphic card manufacturer.

For hobbyist of OSes, which can't ask every manufacturer a driver, the (maybe only) option is to turn to VBE to setup a linear-addressed frame buffer that the display subsystem will use.

If you're more motivated, you can try to load video kernel modules for Linux in your own system (simulating calls the video driver might need ;) ) and use OpenGL or something alike to send accelerated commands to the card -- this seems utopia, imho, however 8).

Re:Windows's Graphics

Posted: Wed Apr 02, 2003 7:51 pm
by mattcarpenterr
(crud, forgot to type my message above)
The thing Im concerned about is bank switching. If I set up page mapping, will I still have to do bank switching for my memory card? The last time I used vm86, after calling the bios video interrupt to switch banks, something would get messed up and my os would crash if I tried doing a vm86 call again

Re:Windows's Graphics

Posted: Thu Apr 03, 2003 2:50 am
by Pype.Clicker
if you set up a LINEAR_FRAME_BUFFER mode (available in Vesa Bios Extension), your whole video memory will be mapped (somewhere at the end of the physical address space), so that you won't need bank switching anymore.

Moreover, most VBE cards come with an interface that allow bank switching from protected mode (that's one of the only function in VBE1.2 pmode interface iirc), so you don't have to mess with VM86 once the video mode is set up.