Shadowing
Why shadow bios?
The BIOS tasks mentioned earlier follow the path of CPU> NB> Sb> SiO2> Rom. That is: the CPU is executed by capturing code in BIOS Rom! One obvious thing is: ROM Access time> DRAM access time! Ram access width is 32 bits, while ROM Access width is usually 16 bits. Therefore, there is a concept of "BIOS shadowing! <-"Performance consideration "!!!
What is shadowing?
Meaning: Copy part of the BIOS code (in ROM) to dram! (Since then, the CPU will capture code from dram to execute...) such an action is called "shadowing "! The DRAM is called shadow memory.
Shadowing is an extremely complex Kernel code part in bios! The source code can be traced.
When to shadow bios?
=> Of course, it is done only after the memory is stable and can be used. ^_^
* Therefore, if DRAM sizing is faulty, BIOS shadowing must be faulty !!!
Additional information:
1. after running the system power-on sequence after power on, the CPU will be reset (the reset indicates that the CPU content will return to the "Initial Value "); the initial value of the EIP (32-bit) inside the CPU is fffffff0h. Therefore, the first code read of the CPU is to fffffff0h fetch code...
This memory cycle is sent from the CPU and passes through the North Bridge first. At this time, the North Bridge will say "this is not my "... then, lose it to south bridge. South Bridge will say, "This is mine." It will be lost to Rom after it is accepted! So fffffff0h will be taken away by Rom !!! (So some people said, "The hardware initial values should map 0xfffffff0 and 0x000ffff0 to the same place." This place is... Rom !!! )
Then, the cycle sent by the CPU will arrive at rom all the way in the above way... the CPU will follow the fetch, decode, execute, store order to do things...
However, before a certain stage, the BIOS code indicates "migrating BIOS data from Rom to DRAM "! After this stage, the BIOS will set the North Bridge cache and tell the North Bridge "the CPU's cycle cannot be uploaded to the south bridge "....
Since then, all the cycle sent by the CPU has been transferred to dram, And the CPU follows the order of fetch, decode, execute, and store to do things...
<Summary> in short, the BIOS starts with the CPU reading Rom content for execution, and then the CPU reading DRAM content for execution. ^_^
2. [Supplement] [using question _ ^]
[Q]: What is shadow memory?
[A]: In the current computer system, shadow memory is in the UMA (upper memory area; the traditional memory is more than kb to 1 Mbit/s) "Inside" (part of it ); in this Uma, it can be divided into 6 segments (64kb/each) and total 384kb.
C0000h ~ Dffffh: for vga bios and other devices 'option ROMs
E0000h ~ Fffffh: bios rom code
These two blocks are essentially memory, which will be carried in ROM content later. Therefore, it is called shadow memory (as if Rom is above and memory is below, is Rom's "shadow "...)
[Q]: the shadow memory content is completely "=" Rom content?
[A]: Of course not! Apart from Uma, the size of the BIOS Rom must support more and more functions/features. In addition, some modules in the BIOS Rom are compressed. (UMA is not enough ...)
When the BIOS shadow, only the necessary code (ex. Run-Time to use... etc) will be copied to shadow memory! In addition, the Code that has been executed will not be loaded. Therefore, it is not the copy of 1-1...
[Q]: What shadow enabled/disable mean in chipset?
[A]: As mentioned earlier, the code for CPU fetch is provided by shadow memory or ROM. The key lies in chipset's behavior! That is, Nb must make this decision! Therefore, this mechanism is generally implemented by Nb.
There is a so-called shadow registers in Nb. When shadow register enable, memory cycle is responded by shadow memory; if shadow disable, Rom will respond.
Meaning:
000e0000h ~ 000fffffh by shadow memory replies If (shadow enabled)
000e0000h ~ 000fffffh by ROM chip replies If (shadow disabled)
If fffe000h ~ What about ffffffh? It must be responded by ROM chip (What should I do if I open the machine ?). It has nothing to do with shadow disable/enable !!!
* If ru.exe is used and memory space is viewed, the preceding situation can be found.
[Q]: What are the benefits of shadow?
[A]: Because slower Rom v. s faster RAM, putting it in Ram can increase system performance.
* You can find that the execution speed of the same Code in ROM & DRAM is greatly different!
[Q]: What is the issue of shadow memory?
[A]: All memory areas of shadowed will be set to write-protected! Therefore, this area cannot be written. Therefore, ifProgramThere will be a problem !!!
In fact, the BIOS shadow code won't touch much... you just need to know the basic information.
Read the full text
Category:View comments on the BIOS series I know (reposted by Xiaohua)