资讯动态

000ResetVector_resetVector

发布时间:2026/10/22 2:31:22 来源:尧图企业网站定制
ResetVector查阅处理器相关规范了解到x86架构的计算机上电或者重启后会跳转到0xFFFFFFF0(Reset Vector)处执行指令OVMF平台reset vector代码OvmfPkg\ResetVector\Ia16\ResetVectorVtf0.asm如下resetVector: ; ; Reset Vector ; ; This is where the processor will begin execution ; ; In IA32 we follow the standard reset vector flow. While in X64, Td guest ; may be supported. Td guest requires the startup mode to be 32-bit ; protected mode but the legacy VM startup mode is 16-bit real mode. ; To make NASM generate such shared entry code that behaves correctly in ; both 16-bit and 32-bit mode, more BITS directives are added. ; %ifdef ARCH_IA32 nop nop jmp EarlyBspInitReal16NOP根据SDM手册对于多核处理器。第一个执行NOP指令的核被设置为BSP负责执行指令。第二个NOP负责占位保证16位对齐。ResetVector.bin查阅ResetVector.inf module经编译后的二进制文件ResetVector.binBuild\Ovmf3264\NOOPT_VS2019\IA32\OvmfPkg\ResetVector\ResetVector\OUTPUT\ResetVector.bin我们可以看到。上述代码对应的机器指令是90 90 E9 5B FF。ResetVector.lstEDK2在编译ResetVector.inf的时候会将其先翻译成ResetVector.lstBuild\Ovmf3264\NOOPT_VS2019\IA32\OvmfPkg\ResetVector\ResetVector\OUTPUT\ResetVector.lst我们可以比较方便查阅上述代码编译后的机器码如下1791resetVector:1801;1811;Reset Vector1821;1831;This is where the processor will begin execution1841;1851;In IA32 we follow the standard reset vector flow. WhileinX64, Td guest1861;may be supported. Td guest requires the startup mode to be32-bit1871;protected mode but the legacy VM startup mode is16-bit real mode.1881;TomakeNASM generate such shared entry code that behaves correctlyin1891;both16-bit and32-bit mode,moreBITS directives are added.1901;1911%ifdef ARCH_IA3219200000560901nop19300000561901nop19400000562 E95BFF1jmp EarlyBspInitReal16通过WinDbg查询内存地址0xFFFFFFF0位置的指令可以看到和上述一致参考Intel SDMUpon completion of the BIST, the logical processors use a hardware-defined selection mechanism toselectthe BSP and the APs from the available logical processors on the system bus. The BSP selection mechanism differs depending on the family, model, and stepping IDs of the processors, as follows: — Later generations of IA processors within family 0FH(see Section9.4), IA processors with system bus(family06H,extended_model0, model0EH), or all other modern Intel processors(family06H, extended_model0): • The logical processors begin monitoring the BNR# signal, which is toggling. When the BNR# pin stopstoggling, each processor attempts to issue a NOP special cycle on the system bus. • The logical processor with the highest arbitration priority succeedsinissuing a NOP special cycle and is nominated the BSP. This processor sets the BSP flaginits IA32_APIC_BASE MSR,thenfetches and begins executing BIOS boot-strap code, beginning at the reset vector(physical address FFFF FFF0H). • The remaining logical processors(that failedinissuing a NOP special cycle)are designated as APs. They leave their BSP flagsintheclearstate and enter a “wait-for-SIPI state.”OVMF_ResetVector

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑