VGA - disabling character blinking

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
bokjezd
Posts: 2
Joined: Sun Apr 17, 2016 7:54 am
Location: Poland

VGA - disabling character blinking

Post by bokjezd »

In VGA text mode, 8th bit of attribute byte has two meanings. In real mode, it is possible to toggle between them via Int 0x10/AX=1003h.

I try to do it in protected mode, so no BIOS is available. I think it should be possible to do it via Mode Control register (0x3C0/0x10). I tried to do it, but it resulted in black screen. Here's my code:

Code: Select all

inb(0x3DA); // to index state
outb(0x3C0, 0x10); // register index
// if I stop at this point or beyond then black screen
uint8_t value = inb(0x3C1);
inb(0x3DA);
outb(0x3C0, 0x10);
outb(0x3C0, value & 0xF7); // disable 4th bit (numbering from 1) to go to 16 background colors
Did someone have this problem before? What am I really doing with this code? Am I misinterpreting the documentation? Can someone help me?
pongozolin
Posts: 6
Joined: Sun May 10, 2015 7:04 pm

Re: VGA - disabling character blinking

Post by pongozolin »

Hi bokjezd,

When you select an index via register 0x3C0, you'll want to set bit 5 (counting from 0). This means you'll be operating the attribute controller in "normal" mode instead of messing with the internal palette.

For further reference, I recommend FreeVGA.
bokjezd
Posts: 2
Joined: Sun Apr 17, 2016 7:54 am
Location: Poland

Re: VGA - disabling character blinking

Post by bokjezd »

Hi!

I just made it work. One thing I didn't know is Palette Address Source bit in Attribute Address Register. I also found some simple bugs after video began working again, but blinking wasn't disabled (spurious return in the middle of my code or extra tilde in my copy to /boot command)

Thanks for pointing that bit out :)

PS. QEMU doesn't support blinking at all. I had to reboot my physical computer to test this code.
Post Reply