Bochs VGA - Bright Background Colours

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
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Bochs VGA - Bright Background Colours

Post 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
}
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Bochs VGA - Bright Background Colours

Post 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)
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: Bochs VGA - Bright Background Colours

Post 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.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Post Reply