OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Mar 19, 2024 3:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How does the BIOS...
PostPosted: Sat Mar 12, 2011 6:47 am 
Offline

Joined: Sat Feb 05, 2011 6:32 am
Posts: 6
...display logos?

Strange question I know, but it just occured to me that (by the looks of it) when the BIOS boots it displays information on the screen in text mode, and I thought that text mode could only display text? I wrote some code to draw a pixel on screen while still in text mode, and (unless I wrote the code wrong) it never appeared on screen.

So the only ways I can think of is that the BIOS sets the video adapter to a VGA mode, displays the logos, and then either goes back to text mode without clearing the screen, or it manually draws the text onto the screen using a font.

What are your thoughts on it? :)

PS. By "logos" I mean the logo in the top left of the attached image.


Attachments:
amd.jpg
amd.jpg [ 29.83 KiB | Viewed 10227 times ]
Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 12, 2011 7:13 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
The display font is editable, and there are many spaces not used for normal text/numbers/punctuation. The BIOS can write bits of its logo into those spaces as characters, and then write to the correct locations in order to have them displayed.


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 12, 2011 7:23 am 
Offline

Joined: Sat Feb 05, 2011 6:32 am
Posts: 6
Thanks for the reply :)

How exactly does it draw pixels from its logo into the spaces? Using standard VGA stuff?


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 12, 2011 7:28 am 
Offline
Member
Member
User avatar

Joined: Tue Mar 24, 2009 8:11 pm
Posts: 1249
Location: Sunnyvale, California
The BIOS contains all the drivers necessary to change video modes and plot pixels, so it could even be plotting that logo directly (and then rendering the font manually). However, I'd say Owen is probably right.


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 12, 2011 7:41 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 13, 2008 3:21 pm
Posts: 1700
Location: Cambridge, United Kingdom
You update the VGA's font table. This should be explained by any good VGA programming guide.


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 12, 2011 8:03 am 
Offline
Member
Member

Joined: Tue Jun 15, 2010 9:27 am
Posts: 255
Location: Flyover State, United States
You could use a custom font in a text mode and create an entire windowed user interface. However it would be difficult to display raster images because a single "character" can only be one color. But since most BIOS logos are displayed as a single color, they can be displayed fine in a text mode.

_________________
Getting_Started on the wiki
x86 technical information
Interrupt Jump Table
Real Programmers Don't Use Pascal
My open-source projects


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Thu Mar 17, 2011 5:51 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
There's also the Energy Star logo, but I guess it's possible to do that with a text font as well...

Image


JAL


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Fri Mar 18, 2011 6:55 am 
Offline
Member
Member
User avatar

Joined: Tue Feb 08, 2011 1:58 pm
Posts: 496
If you take a closer look, you should notice that the color is only changed per character, not per pixel.

I've also implemented this, it's not hard. Just modify the fonts at 176-223 (these are the ones that's used to draw boxes, so the 9th column is not an empty one but a copy of the 8th), and display them on screen accordingly.


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Fri Mar 18, 2011 8:59 am 
Offline
Member
Member
User avatar

Joined: Mon Jan 26, 2009 2:48 am
Posts: 792
I always thought that the BIOS switches to graphics mode to display the logo, and then switches back for the rest of the boot process. Do some BIOSes do that or am I simply wrong?


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Fri Mar 18, 2011 9:31 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
turdus wrote:
I've also implemented this, it's not hard. Just modify the fonts at 176-223 (these are the ones that's used to draw boxes, so the 9th column is not an empty one but a copy of the 8th), and display them on screen accordingly.

The BIOSes I have seen actually switch to 640 column mode so the 9th column is not an issue. Probbaly because they need more than 48 characters to display the graphics. Or, they switch to 640 graphics mode.

Quote:
I always thought that the BIOS switches to graphics mode to display the logo, and then switches back for the rest of the boot process. Do some BIOSes do that or am I simply wrong?

As you can see in the screen shot, the logos are displayed during the POST. So there's no switching back. There are of course BIOSes that have a graphical splash screen, but in those cases there's not POST messages begin displayed.


JAL


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Sat Mar 19, 2011 7:07 am 
Offline
Member
Member
User avatar

Joined: Tue Feb 08, 2011 1:58 pm
Posts: 496
jal wrote:
...
The BIOSes I have seen actually switch to 640 column mode so the 9th column is not an issue. Probbaly because they need more than 48 characters to display the graphics. Or, they switch to 640 graphics mode.

...
As you can see in the screen shot, the logos are displayed during the POST. So there's no switching back. There are of course BIOSes that have a graphical splash screen, but in those cases there's not POST messages begin displayed.

JAL

Agree, it's possible to switch to 8x16 pixel mode, although I've never seen any BIOS doing this. Instead I saw that they use 512 character font mode (when the blink/intensity bit of attribute selects an alternative font set).


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Mon Mar 21, 2011 7:56 am 
Offline
Member
Member
User avatar

Joined: Wed Feb 09, 2011 2:21 am
Posts: 87
Location: Raipur, India
The BIOS knows what the Graphics Chip on the motherboard is capable of doing. So it's no problem for the bios to display whatever it whishes.

My BIOS can display a 640x480 resolution 256 color image.


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Mon Mar 21, 2011 9:43 am 
Offline
Member
Member

Joined: Wed Oct 31, 2007 9:09 am
Posts: 1385
trinopoty wrote:
The BIOS knows what the Graphics Chip on the motherboard is capable of doing. So it's no problem for the bios to display whatever it whishes.


Yeah, except many motherboards do not have an on-board gfx chip, so all they can do is call the video BIOS using int 10h.

Quote:
My BIOS can display a 640x480 resolution 256 color image.


Exactly how is this relevant? My BIOS is bigger than yours?


JAL


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Mon Mar 21, 2011 10:20 am 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 3:45 am
Posts: 9301
Location: On the balcony, where I can actually keep 1½m distance
If yours has such a high resolution, it must have one of those worthless onboard intel chips then to be able to know how they work. Oh and, one of my computer's boot screen looks much better than yours :mrgreen:

I have seen several graphical-splash computers without onboard video. They just pick a standard mode and work with that - the video bios does the necessary bits for them. If you know a bit about VGA modes, there's little trouble about getting one to work.

_________________
"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 ]


Top
 Profile  
 
 Post subject: Re: How does the BIOS...
PostPosted: Mon Mar 21, 2011 9:02 pm 
Offline
Member
Member
User avatar

Joined: Sat Jul 17, 2010 12:45 am
Posts: 487
One thing I noticed on both the images is that, there's no cursor. This means, this maynot be the text mode(?). It's possible to have text like fonts in graphics mode and moreover, tweaking video modes can give the same effect as the text mode but without cursor. Does this make sense?

_________________
Programming is not about using a language to solve a problem, it's about using logic to find a solution !


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC - 6 hours


Who is online

Users browsing this forum: Bing [Bot], SemrushBot [Bot] and 18 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