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.
Problem using Vesa modes under BOCHS [SOLVED]
Problem using Vesa modes under BOCHS [SOLVED]
Last edited by Chandra on Mon Sep 27, 2010 12:43 am, edited 1 time in total.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
- Owen
- Member
- Posts: 1700
- Joined: Fri Jun 13, 2008 3:21 pm
- Location: Cambridge, United Kingdom
- Contact:
Re: Problem using Vesa modes under BOCHS
Have you actually set the graphics cards palette?
Re: Problem using Vesa modes under BOCHS
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.Owen wrote:Have you actually set the graphics cards palette?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: Problem using Vesa modes under BOCHS
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.Chandra wrote: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.Owen wrote:Have you actually set the graphics cards palette?
"Open source seems to embrace the dark side of human nature." - Ville Turjanmaa
Re: Problem using Vesa modes under BOCHS
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.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !