Page 1 of 1

Bochs VGA - Bright Background Colours

Posted: Sun Aug 02, 2009 4:58 am
by thepowersgang
I am trying to implement a boot screen for my kernel by using the upper ASCII characters to create simple picture.
I read that it is possible to disable the blink attribute and allow the full 16 colours for backgrounds but it seems not to work (the text blinks instead of having a bright background).
Am I doing this wrong, or does Bochs just not support this feature of VGA.

Code: Select all

// Enable bright backgrounds
{
Uint8	byte;
inb(0x3DA);	// Reset flipflop
outb(0x3C0, 0x30);	// Index 0x10, PAS
byte = inb(0x3C1);
byte &= ~8;	// Disable Blink
outb(0x3C0, byte);	// Write value
}

Re: Bochs VGA - Bright Background Colours

Posted: Sun Aug 02, 2009 6:25 am
by Combuster
You are doing something wrong somewhere - I hand assembled your code and dropped it in a bootsector, and it works as expected:

Code: Select all

                MOV DX, 0x3DA
                IN AL, DX
                MOV DX, 0x3C0
                MOV AL, 0x30
                OUT DX, AL
                INC DX
                IN AL, DX
                AND AL, 0xF7
                DEC DX
                OUT DX, AL
Is it actually being executed? Do you have a somewhat recent version of bochs? (tested in 2.3.7)

Re: Bochs VGA - Bright Background Colours

Posted: Sun Aug 02, 2009 8:15 am
by thepowersgang
Ok, it seems that the port IO functions I was using were dodgy (they're assembly functions not C). Replacing it with a large __asm__ statement fixed the problem.

Thanks combuster.