24bit vesa mode is not working properly [SOLVED]
Posted: Mon Aug 02, 2010 12:33 am
Last time I encountered a problem with the 1024x256x256color vesa mode, which I got the solution. This time I got struck in a new problem. First of all,let me make things clear.
I've been writing real mode DOS like 16 bit OS with GUI and extended mode support. I've been trying to implement GUI switching from 265 colors to True colors and vice versa.I've now been able to implement the 256 colors properly but when I switched to 24bit Vesa mode(using inline assembly in kernel) I'd encountered the following problem:
1.When I implement the putpixel function it is able to display only 3 colors & I think those colors are red, white and cyan(not sure though).I know I've passed the color bytes to the video memory properly(i.e 8bits red, 8bits green and 8bits blue) but even then any mixture of these color bytes donot output desired color.
2.When I output a pixel to (2,0) it displays a red color at that place.Following that if i output a pixel to (3,0) it displays cyan color again at (2,0). And again if I output a pixel to (4,0) it displays white color at again (2,0). Now if output a pixel to (5,0) then only the pixel moves one place right with the initial color red.This continues with every pixels. Moreover the origin(0,0) is also shifted to some place at right. What's going on?
I'm sorry to write long explanations but it because short explanation can't make things clear. Please Help.
I've been writing real mode DOS like 16 bit OS with GUI and extended mode support. I've been trying to implement GUI switching from 265 colors to True colors and vice versa.I've now been able to implement the 256 colors properly but when I switched to 24bit Vesa mode(using inline assembly in kernel) I'd encountered the following problem:
1.When I implement the putpixel function it is able to display only 3 colors & I think those colors are red, white and cyan(not sure though).I know I've passed the color bytes to the video memory properly(i.e 8bits red, 8bits green and 8bits blue) but even then any mixture of these color bytes donot output desired color.
2.When I output a pixel to (2,0) it displays a red color at that place.Following that if i output a pixel to (3,0) it displays cyan color again at (2,0). And again if I output a pixel to (4,0) it displays white color at again (2,0). Now if output a pixel to (5,0) then only the pixel moves one place right with the initial color red.This continues with every pixels. Moreover the origin(0,0) is also shifted to some place at right. What's going on?
I'm sorry to write long explanations but it because short explanation can't make things clear. Please Help.