David,
I checked the history that it seems some CSM16 binaries were found with
wrong checksum, the code did not intentionally return error and only printed an
error message only. For little impact, I agreed with your fix to make debug
message output, you may use "if (CheckSum == 0)" instead, as we only use
"!CheckSum" when CheckSum is a BOOLEAN type.
Reviewed-by: Elvin Li <[email protected]>
Thanks
Elvin
-----Original Message-----
From: David Woodhouse [mailto:[email protected]]
Sent: Thursday, January 17, 2013 6:41 AM
To: [email protected]
Subject: [edk2] [PATCH] LegacyBiosDxe: Fix checksum handling
Not only do we accept a Compatibility16 table with a bad checksum, but we don't
even print the (misspelled) debug message that we're apparently supposed to
print. Fix that, because it offended me when testing that SeaBIOS got its
checksum right...
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Woodhouse <[email protected]>
---
Perhaps we should only accept the bad checksum on debug builds?
diff --git a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
index 99a76c9..8c5d555 100644
--- a/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
+++ b/IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyBios.c
@@ -333,8 +333,8 @@ ShadowAndStartLegacy16 (
for (CheckSum = 0; Ptr < PtrEnd; Ptr++) {
CheckSum = (UINT8) (CheckSum +*Ptr);
}
-
- Done = TRUE;
+ if (!CheckSum)
+ Done = TRUE;
}
}
@@ -347,7 +347,7 @@ ShadowAndStartLegacy16 (
//
// Legacy16 table header checksum error.
//
- DEBUG ((EFI_D_ERROR, "Legacy16 table found with bad talbe header
checksum\n"));
+ DEBUG ((EFI_D_ERROR, "Legacy16 table found with bad table header
+ checksum\n"));
}
//
--
David Woodhouse Open Source Technology Centre
[email protected] Intel Corporation
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122712
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-devel