Page 1 of 1

weird blinking

Posted: Thu Feb 26, 2009 7:16 am
by overburn
i've made a a barebones kernel with a few functions , it compiles alright, acts alright on virtualBox, but when i strap it to a floppy and boot it on my pc, i load it throught grub and it blinks... in virtual box it doesn't blink. and i don't want it to blink. so... :

this is loader.s:
http://pastebin.com/m133f951

this is kernel.c:
http://pastebin.com/m37d5dd86

and this is link.ld
http://pastebin.com/m6a10effc

and you can get the floppy image from the site on my sig

thanx in advance :)

Re: weird blinking

Posted: Thu Feb 26, 2009 7:28 am
by AJ
Hi,

It's because you are using a white background for your text, which in some situations is used to indicate a blinking character on the VGA. You can change this by either reprogramming the attribute registers on your VGA, or using a background with a colour from 0-7 (it's the high bit of the nibble that selects blinking).

Cheers,
Adam

Re: weird blinking

Posted: Thu Feb 26, 2009 7:46 am
by overburn
by reprogramming the attribute registers on my vga you mean altering my own graphics card? or it's just a program?
if it's the first, how can i use white without doing that?

Re: weird blinking

Posted: Thu Feb 26, 2009 7:52 am
by AJ
Hi,

What I mean is, programming the VGA directly (as you would if you were writing a VGA driver).

The attribute controller address register is at port 0x03C0 (data register is 0x03C1). Register index 0x10, bit 3 controls the character blink status. You'd need to read in this register, OR it with 0x08 and then write the value back. For more information see this link.

...or just use a darker background :)

Cheers,
Adam

Re: weird blinking

Posted: Thu Feb 26, 2009 9:06 am
by egos
AJ wrote:The attribute controller address register is at port 0x03C0 (data register is 0x03C1).
It's incorrect. Index and data are output one by one at 0x3C0. To write exactly the index, read ISR1 (0x3DA) firstly.

Re: weird blinking

Posted: Thu Feb 26, 2009 10:42 am
by AJ
Ah sorry - my mistake. 0x03C1 is only a data read register.

Cheers,
Adam