I've searched quite a bit, but I'm not sure what's causing this.
I'm working on VESA graphics for an OS class, on top of a simple kernel we put together. In the bootstrap, I set the controller to mode 0x411b, which it reports as 1280x1024x32. Later on, in protected mode, I initialize the framebuffer to my VC_BG value, the background color for the screen. I do double buffering, so I have:
Code: Select all
int* fb; // this points to the real linear fb
int* screen; // my double buffer, allocated with size x_res * y_res * 4
for (i = 0; i < x_res*y_res; i++) {
screen[i] = VC_BG;
}
_memcpy(fb, screen, x_res*y_res*4);
This works fine when I set VC_BG to, say, 0xFFFFFFFF. However, if I set VC_BG to 0xFFFFFFFE, for instance, only a couple rows of pixels at the top of the screen get filled in. This is reproduceable and seems to happen when the last bit of the color is 0.
Am I missing something really fundamental to the way VESA is supposed to work?
Thanks in advance