- 切32位元(或64位元)flat mode
- Cache As Ram (在Flat32.asm中jump到CacheAsRam函數的位址)
- 找BFV(Boot Firmware Volume), BFV指的是存放PEI Foundation/PEIMs的FV
- 找到以C寫的SEC phase entry point
- 跳到以C code寫的SEC point (SecStartup),最後Transfer the control to the PEI core
VOID
EFIAPI
SecStartup (
IN UINT32 SizeOfRam,
IN UINT32 TempRamBase,
IN VOID *BootFirmwareVolume
){
...
}
從上電的reset vector, trace Code如下:
進入點為 UefiCpuPkg\ResetVector\Vtf0\Ia16\ResetVectorVtf0.asm
;; Reset Vector
; ; This is where the processor will begin execution ; nop nop jmp short EarlyBspInitReal16 |
接著跳到Init16.asm再跳到Main.asm裡面Main16這個位址
Main16:
OneTimeCall EarlyInit16 ; ; Transition the processor from 16-bit real mode to 32-bit flat mode ; OneTimeCall TransitionFromReal16To32BitFlat BITS 32 ; ; Search for the Boot Firmware Volume (BFV) ; OneTimeCall Flat32SearchForBfvBase ; ; EBP - Start of BFV ; ; ; Search for the SEC entry point ; OneTimeCall Flat32SearchForSecEntryPoint ; ; ESI - SEC Core entry point ; EBP - Start of BFV ; %ifdef ARCH_IA32 ; ; Restore initial EAX value into the EAX register ; mov eax, esp ; ; Jump to the 32-bit SEC entry point ; jmp esi (略) |
沒有留言:
張貼留言