How does the BIOS...

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.
LloydAX86
Posts: 6
Joined: Sat Feb 05, 2011 6:32 am

How does the BIOS...

Post by LloydAX86 »

...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
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: How does the BIOS...

Post by Owen »

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.
LloydAX86
Posts: 6
Joined: Sat Feb 05, 2011 6:32 am

Re: How does the BIOS...

Post by LloydAX86 »

Thanks for the reply :)

How exactly does it draw pixels from its logo into the spaces? Using standard VGA stuff?
User avatar
NickJohnson
Member
Member
Posts: 1249
Joined: Tue Mar 24, 2009 8:11 pm
Location: Sunnyvale, California

Re: How does the BIOS...

Post by NickJohnson »

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.
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: How does the BIOS...

Post by Owen »

You update the VGA's font table. This should be explained by any good VGA programming guide.
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: How does the BIOS...

Post by Tosi »

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.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: How does the BIOS...

Post by jal »

There's also the Energy Star logo, but I guess it's possible to do that with a text font as well...

Image


JAL
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: How does the BIOS...

Post by turdus »

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.
User avatar
qw
Member
Member
Posts: 792
Joined: Mon Jan 26, 2009 2:48 am

Re: How does the BIOS...

Post by qw »

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?
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: How does the BIOS...

Post by jal »

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.
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
User avatar
turdus
Member
Member
Posts: 496
Joined: Tue Feb 08, 2011 1:58 pm

Re: How does the BIOS...

Post by turdus »

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).
User avatar
trinopoty
Member
Member
Posts: 87
Joined: Wed Feb 09, 2011 2:21 am
Location: Raipur, India

Re: How does the BIOS...

Post by trinopoty »

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.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Re: How does the BIOS...

Post by jal »

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.
My BIOS can display a 640x480 resolution 256 color image.
Exactly how is this relevant? My BIOS is bigger than yours?


JAL
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: How does the BIOS...

Post by Combuster »

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 ]
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: How does the BIOS...

Post by Chandra »

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 !
Post Reply