X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=OvmfPkg%2FResetVector%2FIa32%2FSearchForBfvBase.asm;h=21b64f46e37b5be97f3069d0fa698ad3621a19d0;hp=e6ca6e6ffbb8825d0f25f2e49380590f2077a52e;hb=7a55c43b072ec2192d35df5e44cf37eb8be06555;hpb=8861fc792ce90cb7ab18a91bd3d6596d77ee0170 diff --git a/OvmfPkg/ResetVector/Ia32/SearchForBfvBase.asm b/OvmfPkg/ResetVector/Ia32/SearchForBfvBase.asm index e6ca6e6ffb..21b64f46e3 100644 --- a/OvmfPkg/ResetVector/Ia32/SearchForBfvBase.asm +++ b/OvmfPkg/ResetVector/Ia32/SearchForBfvBase.asm @@ -1,6 +1,8 @@ ;------------------------------------------------------------------------------ +; @file +; Search for the Boot Firmware Volume (BFV) base address ; -; Copyright (c) 2008, Intel Corporation +; Copyright (c) 2008 - 2009, Intel Corporation ; All rights reserved. This program and the accompanying materials ; are licensed and made available under the terms and conditions of the BSD License ; which accompanies this distribution. The full text of the license may be found at @@ -9,14 +11,6 @@ ; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, ; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. ; -; Module Name: -; -; SearchForBfvBase.asm -; -; Abstract: -; -; Search for the Boot FV Base Address -; ;------------------------------------------------------------------------------ ;#define EFI_FIRMWARE_FILE_SYSTEM2_GUID \ @@ -29,21 +23,21 @@ BITS 32 ; -; Input: -; None +; Modified: EAX, EBX +; Preserved: EDI, ESP ; -; Output: -; EBP - BFV Base Address -; -; Modified: -; EAX, EBX +; @param[out] EBP Address of Boot Firmware Volume (BFV) ; Flat32SearchForBfvBase: xor eax, eax searchingForBfvHeaderLoop: + ; + ; We check for a firmware volume at every 4KB address in the top 16MB + ; just below 4GB. (Addresses at 0xffHHH000 where H is any hex digit.) + ; sub eax, 0x1000 - cmp eax, 0xff800000 + cmp eax, 0xff000000 jb searchedForBfvHeaderButNotFound ; @@ -70,19 +64,23 @@ searchingForBfvHeaderLoop: jmp searchedForBfvHeaderAndItWasFound searchedForBfvHeaderButNotFound: - writeToSerialPort '!' - xor eax, eax + ; + ; Hang if the SEC entry point was not found + ; + debugShowPostCode POSTCODE_BFV_NOT_FOUND -searchedForBfvHeaderAndItWasFound: + ; + ; 0xbfbfbfbf in the EAX & EBP registers helps signal what failed + ; for debugging purposes. + ; + mov eax, 0xBFBFBFBF mov ebp, eax + jmp $ - writeToSerialPort 'B' - writeToSerialPort 'F' - writeToSerialPort 'V' - writeToSerialPort ' ' +searchedForBfvHeaderAndItWasFound: + mov ebp, eax - or ebp, ebp - jz $ + debugShowPostCode POSTCODE_BFV_FOUND OneTimeCallRet Flat32SearchForBfvBase