Page 1 of 2

How does the BIOS...

Posted: Sat Mar 12, 2011 6:47 am
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.

Re: How does the BIOS...

Posted: Sat Mar 12, 2011 7:13 am
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.

Re: How does the BIOS...

Posted: Sat Mar 12, 2011 7:23 am
by LloydAX86
Thanks for the reply :)

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

Re: How does the BIOS...

Posted: Sat Mar 12, 2011 7:28 am
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.

Re: How does the BIOS...

Posted: Sat Mar 12, 2011 7:41 am
by Owen
You update the VGA's font table. This should be explained by any good VGA programming guide.

Re: How does the BIOS...

Posted: Sat Mar 12, 2011 8:03 am
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.

Re: How does the BIOS...

Posted: Thu Mar 17, 2011 5:51 am
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

Re: How does the BIOS...

Posted: Fri Mar 18, 2011 6:55 am
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.

Re: How does the BIOS...

Posted: Fri Mar 18, 2011 8:59 am
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?

Re: How does the BIOS...

Posted: Fri Mar 18, 2011 9:31 am
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

Re: How does the BIOS...

Posted: Sat Mar 19, 2011 7:07 am
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).

Re: How does the BIOS...

Posted: Mon Mar 21, 2011 7:56 am
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.

Re: How does the BIOS...

Posted: Mon Mar 21, 2011 9:43 am
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

Re: How does the BIOS...

Posted: Mon Mar 21, 2011 10:20 am
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.

Re: How does the BIOS...

Posted: Mon Mar 21, 2011 9:02 pm
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?