From 3ca15914dfb37611a5fbd9907cf3e41bc934d577 Mon Sep 17 00:00:00 2001 From: jljusten Date: Fri, 21 Jan 2011 16:50:31 +0000 Subject: [PATCH] OvmfPkg: Add DEBUG messages to dump the contents of CMOS The contents of CMOS on boot can describe some aspects of the system configuration. For example, the size of memory available to qemu/kvm. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11264 6f19259b-4bc3-4df7-8a09-765794883524 --- OvmfPkg/PlatformPei/Platform.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 833f62adff..66bb0984c8 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -31,6 +31,7 @@ #include #include "Platform.h" +#include "Cmos.h" EFI_MEMORY_TYPE_INFORMATION mDefaultMemoryTypeInformation[] = { { EfiACPIMemoryNVS, 0x004 }, @@ -200,6 +201,27 @@ ReserveEmuVariableNvStore ( } +VOID +DebugDumpCmos ( + VOID + ) +{ + UINTN Loop; + + DEBUG ((EFI_D_INFO, "CMOS:\n")); + + for (Loop = 0; Loop < 0x80; Loop++) { + if ((Loop % 0x10) == 0) { + DEBUG ((EFI_D_INFO, "%02x:", Loop)); + } + DEBUG ((EFI_D_INFO, " %02x", CmosRead8 (Loop))); + if ((Loop % 0x10) == 0xf) { + DEBUG ((EFI_D_INFO, "\n")); + } + } +} + + /** Perform Platform PEI initialization. @@ -220,6 +242,8 @@ InitializePlatform ( DEBUG ((EFI_D_ERROR, "Platform PEIM Loaded\n")); + DebugDumpCmos (); + TopOfMemory = MemDetect (); ReserveEmuVariableNvStore (); -- 2.39.2