Page 1 of 1

Problem with VESA

Posted: Mon Oct 02, 2006 12:20 pm
by Jeko
I'm programming with VESA. I have encountered a problem. In bochs is all normal, but when i try the kernel on my real computer the image is moved right. I think maybe it is due that my computer has 32 bit vbe, while bochs has 24 bit.

Posted: Mon Oct 02, 2006 7:09 pm
by carbonBased
Can you post pictures?

The bits per pixel is definitly relevant... however, if you were skewing the basic size of a pixel, then your colours would be all off, as well.

--Jeff

Posted: Tue Oct 03, 2006 5:43 am
by gaf
And this is nothing that you could fix with the small buttons below your screen ?

Posted: Tue Oct 03, 2006 7:23 am
by Jeko
carbonBased wrote:Can you post pictures?

The bits per pixel is definitly relevant
I know this. I have developed two function for drawing pixels in 32bit or 24bit.

For 32bit:
blue; green; red; alpha

For 24bit:
blue; green; red

When I try my kernel on my computer, the image is moved right.

Posted: Tue Oct 03, 2006 7:51 am
by Jeko
this is an example of bochs and real:
Bochs:
Image


Real PC:
Image

Posted: Wed Oct 04, 2006 12:06 pm
by mrkaktus
Are you using double or tripple buffering ? Maybe you set wrong adress of beginning second or third buffer. Are you using linear or buffered interface?

Posted: Wed Oct 04, 2006 1:27 pm
by carbonBased
MarkOS wrote: When I try my kernel on my computer, the image is moved right.
Oh... I originally misread. Gaf's right, just move the image over via you're monitor's correction keys.

Any shifting is usually caused by the sync rates and pixel clock used, and it's definitly not uncommon to have to adjust.

--Jeff

Posted: Thu Oct 05, 2006 9:15 am
by Jeko
carbonBased wrote: Oh... I originally misread. Gaf's right, just move the image over via you're monitor's correction keys.
I already try this. Unfortunately it not works! If only it were so easy!

Posted: Thu Oct 05, 2006 10:14 am
by Dex
Here's something to check:
1. Do you hard code screen width or do you use "BytesPerScanLine" ?, as they are not always the same, if so use "BytesPerScanLine".
2. Are your gdt 0 based ?, if not these could be added to offset.
3. Are you multiplying by the bpp, eg: 3 for 24bit and 4 for 32bits ?.
4. Do you live on the side of a hill ?.

Posted: Thu Oct 05, 2006 10:26 am
by Jeko
1 Yes
2 I don't understand
3 Yes
4 No!

Posted: Fri Oct 06, 2006 8:08 am
by Jeko
I solved the problem

Posted: Fri Oct 06, 2006 9:45 am
by Dex
MarkOS wrote:I solved the problem
You should put what it was, so others with same problem can try it.

Posted: Mon Oct 09, 2006 7:20 am
by Jeko
It's a stupid thing! I can't write to the text video memory.