OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 20, 2024 5:35 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: VGA Text Mode - Text is a bit off
PostPosted: Thu Aug 17, 2017 7:30 am 
Offline
User avatar

Joined: Wed Aug 16, 2017 12:38 am
Posts: 13
Location: Wonderland
Hey, everyone I've just finished implementing a puts() method and I'm having a bit of trouble.
When I run my OS in QEMU or VirtualBox everything works as expected :D
Image
BUT! [-X
When I run my OS on real hardware the text is a bit off(most of the time)...
I've tested it on my laptop,my PC and my PC at school.
On the laptop it looked like fine, but on the PCs the text is bit cut-off to the left.
Is it because of GRUB? Or is it a common thing?

_________________
Talk is cheap, show me the code.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Thu Aug 17, 2017 4:11 pm 
Offline
Member
Member
User avatar

Joined: Wed Aug 17, 2016 4:55 am
Posts: 251
To the left? Huh, can you try to explain better? (take a photo if possible?)

Also consider putting text in the rightmost columns for testing it just in case.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Fri Aug 18, 2017 5:16 am 
Offline
User avatar

Joined: Wed Aug 16, 2017 12:38 am
Posts: 13
Location: Wonderland
Yeah, the text starts outside the screen, if you can understand.
When I tested it on my PC I thought it was because of my screen settings so I pressed Auto but it didn't fix anything.
As far as the picture goes that would be kinda difficult since I don't have a phone :/ (I broke my phone a week ago)

_________________
Talk is cheap, show me the code.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Fri Aug 18, 2017 7:01 am 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

zvoncika wrote:
Is it because of GRUB? Or is it a common thing?


It's not common, and I doubt that it's because of GRUB.

Does the same happen for the firmware's boot screen, GRUB's menu, or any other OS?

Does manually adjusting the display (e.g. using the "H position" or "H offset" or whatever your monitor calls it) "fix" the problem (cancel out the symptoms of the problem)?


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Fri Aug 18, 2017 12:51 pm 
Offline
Member
Member

Joined: Thu Aug 13, 2015 4:57 pm
Posts: 384
What kind of display is it? Is it a CRT or LCD?

Maybe you are using some weird resolution/timing and the CRT doesn't like it.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Fri Aug 18, 2017 12:58 pm 
Offline
Member
Member

Joined: Wed Jul 19, 2017 9:46 pm
Posts: 25
Hello!

I've had the same issue in the past with my (older) monitor as well. My text was bleeding off the screen in VGA mode 03h.
Just take a look at the settings of the monitor itself to make sure you're adjusted to the proper Horiz & Vertical offsets, as Brendan suggested. It's an easy fix, but it's easily overlooked as well if you get paranoid about bugs like I do! :D

All the Best! I like the name!
-human

_________________
orchid: a 32-bit, flat-model, single-user operating system targeting legacy BIOS systems. Programmed entirely in Intel-x86 Assembly using NASM (compiler) and Atom (IDE).


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Fri Aug 18, 2017 5:15 pm 
Offline
User avatar

Joined: Wed Aug 16, 2017 12:38 am
Posts: 13
Location: Wonderland
Hey everyone,
Yeah manually fixing the offset works

_________________
Talk is cheap, show me the code.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Mon Aug 21, 2017 4:23 pm 
Offline
Member
Member
User avatar

Joined: Sat Jan 15, 2005 12:00 am
Posts: 8561
Location: At his keyboard!
Hi,

zvoncika wrote:
Hey everyone,
Yeah manually fixing the offset works


Does it fix the problem (e.g. your code and the video mode timing signals were correct and the monitor was dodgy), or does it hide symptoms (e.g. your code and/or the video mode timing signals are dodgy and you only worked around a problem that still needs to be fixed properly)?


Cheers,

Brendan

_________________
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Tue Aug 22, 2017 12:09 am 
Offline
Member
Member
User avatar

Joined: Wed Aug 17, 2016 4:55 am
Posts: 251
Timings in text mode are pretty much hardwired with only a few possible combinations (unlike graphics mode which can easily be anything goes). I'd say the issue was the monitor having been miscalibrated (probably specifically regarding 720×400, which is normally used only in text mode).

Of course would be nice to know if the firmware was affected... assuming it ever goes into text mode (e.g. the laptop I use seems to never go to text mode during the firmware, while GRUB and Ubuntu switch to a higher resolution graphics mode to display the terminal).


Top
 Profile  
 
 Post subject: Re: VGA Text Mode - Text is a bit off
PostPosted: Tue Aug 22, 2017 9:39 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5137
zvoncika wrote:
I pressed Auto but it didn't fix anything

That's most likely because your monitor can't tell the difference between the borders around the active video and the black portions of the active video. More of the screen has to be light for it to work. It may also have trouble telling the difference between 720x400 and 640x400, since the timings for both modes are identical.

Try filling more of the screen with colors that are not black. Mess up the calibration and then press "auto" and you'll see the monitor has no trouble centering the picture once it's light enough.

If your test hardware has a digital output, you could use that instead. You won't have to calibrate a monitor with a digital connection.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], DotBot [Bot] and 74 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group