(6) VGA init

Source: Internet
Author: User

In general, BIOS will locate 3 devices at post:
-Input device (ex. keyboard)
-Output device (ex. display device)
-IPL (initial program load, Ex. HDD)

This time we will mention the display device, that is, VGA!

After pci_scan, the BIOS creates a Data Structure in the memory, representing the PCI architecture of the entire system.
Ex. ponter-> NB-> P2P-> Sb-> ide-> audio-> Lan-> USB 2.0-> USB 1.1->... -> VGA->... -> end

In the vga_init stage, the BIOS will go to go-through this list and ask one by one: "Do you need shadow option Rom? "

-------------------------------
* 1 here, break first and describe some ideas:
1. Option Rom is firmware for H/W; for MB like bios. It may be directly on the hardware, or the package is in the BIOS image.
2. The H/W with option Rom may include VGA Card, LAN card, RAID card,... etc.
3. VGA's option Rom is also vbios! Dedicated screen I/O operation (mainly int10h)
4. VGA "shadow" indicates that the vbios is copied to shadow Ram, Ex. c0000h ~ C7fffh (32 K)
5. VGA init this stage only consider "VGA device "! For other device, and then consider its shadow.
-------------------------------

(Take the flow above): At this time, the VGA device will raise its hand and say, "I want "! In this case, the BIOS will look for the location of the VGA device's option Rom (vbios). At this time, the vbios may be on the card or "originally" wrapped in the BIOS image (* 2)

First, some checks: Ex.
-Option Rom signature is 0xaa55?
-Compare the vendor ID/device ID = H/W's IDs in option Rom?
-Class code and sub-class code correct?
-Length = 0?
... Etc...

If all match, it is regarded as VGA option Rom (vbios )! Then, use memory to memory copy to copy it to shadow memory and store it from c0000h...

After the reset, check whether "checksum" is correct. If yes then jump to "entry of initialization code (image offset 3)", control has been transferred to VGA option Rom, it is used for initialize VGA! (If it is a CRT screen, the user will hear a bang! Initialize VGA is successful !!! )

<-This is the work of vga_init !!!

* 2 the reason for "first" is: if the vga bios is included in the BIOS image, it will be copied to somewhere in the memory during BIOS shadow. Of course, will remember the storage place!

[Note] When you encounter an issue of VGA init fail, you can first check whether the vga bios has been copied to c0000h. If yes, check whether the vga bios has been dumped to vbios or not; if not, you can check whether some of the "levels" listed above have not passed (ex. ID does not match, or checksum is not equal... etc)

<Summary> if vga is OK, the computer will be colored.

Read the full text

Category:View comments on the BIOS series I know (reposted by Xiaohua)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.