Problem with VESA

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Problem with VESA

Post 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.
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post 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
User avatar
gaf
Member
Member
Posts: 349
Joined: Thu Oct 21, 2004 11:00 pm
Location: Munich, Germany

Post by gaf »

And this is nothing that you could fix with the small buttons below your screen ?
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post 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.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

this is an example of bochs and real:
Bochs:
Image


Real PC:
Image
mrkaktus
Member
Member
Posts: 102
Joined: Thu Jan 06, 2005 12:00 am
Location: Poland - Gdansk
Contact:

Post 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?
User avatar
carbonBased
Member
Member
Posts: 382
Joined: Sat Nov 20, 2004 12:00 am
Location: Wellesley, Ontario, Canada
Contact:

Post 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
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post 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!
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post 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 ?.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

1 Yes
2 I don't understand
3 Yes
4 No!
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

I solved the problem
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Post by Dex »

MarkOS wrote:I solved the problem
You should put what it was, so others with same problem can try it.
User avatar
Jeko
Member
Member
Posts: 500
Joined: Fri Mar 17, 2006 12:00 am
Location: Napoli, Italy

Post by Jeko »

It's a stupid thing! I can't write to the text video memory.
Post Reply