Page 1 of 1

Problem using Vesa modes under BOCHS [SOLVED]

Posted: Mon Jul 26, 2010 3:09 am
by Chandra
Hello, I've been writing DOS like 16 bit operating system with GUI and extended memory support.I am using BOCHS 2.4.5 as the pc-emulator and it had been working fine with all my 16 bit functions. Then came the hiccup.
1. When i initialize the 1024x768x256 vesa mode(using inline assembly) inside the kernel, then I can't get above the first 62 colors. I'm using bank switching(I know it's slow). When i use any color out of the fist 62 colors then my putpixel functions woks fine. But when i try to go above 62 colors then Boch's doesn't show any thing. It simply says "Going to fulscreen mode" and then blank. Surprisingly when i write this code directly to bootloader and actually reboot the pc then my real bios is able to diaplay all the 256 colors. But boch's can't.
2. Secondly, I wrote a mouse handling function to keep track of the mouse button states and position. I've wrritten code to get 3 bytes from the keboard I/O port(also the mouse port) but boch's sends me more than 3 bytes and it also doesn't give me proper bytes as it should be. Apparently, when I use QEMU it woks perfect with no sign of error. Whew!

Qemu is the solution of my second problem but not my first problem. Please help!! I'm desperately looking forward to get out of this trouble.

Re: Problem using Vesa modes under BOCHS

Posted: Mon Jul 26, 2010 6:14 am
by Owen
Have you actually set the graphics cards palette?

Re: Problem using Vesa modes under BOCHS

Posted: Wed Jul 28, 2010 1:45 am
by Chandra
Owen wrote:Have you actually set the graphics cards palette?
No, I haven't setup the graphics cards pallete.I think this is not the problem because my putpixel function works fine when I simply reboot the pc and run my operating system kernel. The problem is bochs can't display more than 62 out of 256 colors wheras, real bios displays all the colors without requiring to setup the pallete.

Re: Problem using Vesa modes under BOCHS

Posted: Wed Jul 28, 2010 3:12 am
by f2
Chandra wrote:
Owen wrote:Have you actually set the graphics cards palette?
No, I haven't setup the graphics cards pallete.I think this is not the problem because my putpixel function works fine when I simply reboot the pc and run my operating system kernel. The problem is bochs can't display more than 62 out of 256 colors wheras, real bios displays all the colors without requiring to setup the pallete.
When you set a 256-colors mode, the video BIOS automatically sets up the palette. I think it is not the case with the video BIOS of Bochs/QEmu. For these emulators, you need to setup the palette yourself.

Re: Problem using Vesa modes under BOCHS

Posted: Thu Jul 29, 2010 1:16 am
by Chandra
Yes, I came to know that was exactly what was happening. By setting up the video pallette everything turned out to be fine. But it's quite troublesome. Anyway,thanks alot.