Page 1 of 1

VGA Timing: Black screen and cyan vertical lines

Posted: Tue Jul 14, 2009 5:40 am
by sebihepp
Hello,

I need some help in programming the CRT-Registers of the VGA-Standard.
I want to set up 720x400 textmode (80x25 chars) and everything works in Bochs.
Only if I test my kernel on real hardware, my monitor shows only black background with
cyan vertical lines. The Mode and the Timing is recogniced correctly by the monitor, so I
think the translation of the Data is wrong. I tried several other timings, longer retrace signals
and longer pauses between them and the next line/screen... Everything I do results in those lines.
If I change timing I change the position of the lines, but nothing else.
There is also some logic in those lines. If I type something (Should be displayed), then there
appear some new lines with the width of one char and on the position of the char.
I made some screenshots to show, what I mean. The first I have done nothing. The second
shows the screen after typing 5 numbers. The next shows after some newlines. And in the
upper left corner ther is a blinking "c000,", wich isn't explained by my monitor book.
Normaly the first screen should show two lines with text, then a empty line and then the prompt.
So everything looks like scrolled down.

By the way: The lines are static. They are not flickering...

I hope someone has an idea, what I can try to solve the problem. I don't know what I should try
next. Neither I know, what causes the lines...

Best regards
Sebihepp

Image
Image
Image
Image

Re: VGA Timing: Black screen and cyan vertical lines

Posted: Tue Jul 14, 2009 1:29 pm
by Combuster
I suspect a broken VGA font. That's usually a side effect from switching from graphics to text where video memory contains something that's not font data.

Re: VGA Timing: Black screen and cyan vertical lines

Posted: Wed Jul 15, 2009 3:41 am
by sebihepp
Hmm, first I will show all registers before switching mode. Perhaps I can see my fault this way.
Then I try to set up a new font. That's a good idea. I thought about wrong color depth, too.

I am starting in TextMode (Grub booting) and only try to set the registers again, because later
if I am in GraphicMode perhaps I want to switch back.

Best regards
Sebihepp

Re: VGA Timing: Black screen and cyan vertical lines

Posted: Wed Jul 15, 2009 10:27 am
by sebihepp
Thanks! I setup a new font and it works.
Now only the colors are not those i want. Every char has its own color on the entire screen.
It seems to be a problem while writing to plane 1 wich contains the attribute byte. I think I
set something wrong, so I write to the wrong plane or I set the wrong reading.

I implemented a VGARegisterDump routine, wich will show me every interessting VGA-register.
Then I will compare the results right after beeing loaded from grub with my settings. Perhaps
I see the failure there.

Best Regards
Sebihepp

Re: VGA Timing: Black screen and cyan vertical lines

Posted: Thu Jul 16, 2009 5:08 am
by sebihepp
Yeah, I got it work.

Although I have already known about the speciality of Port 0x3C0, I made a mistake.
I wrote data to Port 0x3C1. :oops:

Now it works, it works.

Thanks for your help combuster
Sebihepp