################################################################################\r
[FV.DuetEfiMainFv]\r
BlockSize = 0x10000\r
-NumBlocks = 0x2a\r
FvAlignment = 16 #FV alignment and FV attributes setting.\r
ERASE_POLARITY = 1\r
MEMORY_MAPPED = TRUE\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
+ PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf\r
+ SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf\r
MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf\r
\r
#\r
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf\r
+ PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatformHookLibNull.inf\r
+ SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPortLib16550.inf\r
MtrrLib|UefiCpuPkg/Library/MtrrLib/MtrrLib.inf\r
\r
#\r
/** @file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
**/\r
\r
#include "DxeIpl.h"\r
+#include <Library/SerialPortLib.h>\r
#include "SerialStatusCode.h"\r
#include "Debug.h"\r
\r
mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
}\r
\r
-VOID\r
-PrintValue (\r
- UINT32 Value\r
- )\r
-{\r
- UINT32 Index;\r
- CHAR8 Char;\r
- CHAR8 String[9];\r
-\r
- for (Index = 0; Index < 8; Index++) {\r
- Char = (UINT8)(((Value >> ((7 - Index) * 4)) & 0x0f) + '0');\r
- if (Char > '9') {\r
- Char = (UINT8) (Char - '0' - 10 + 'A');\r
- }\r
- String[Index] = Char;\r
- }\r
-\r
- String[sizeof (String) - 1] = '\0';\r
-\r
- PrintString (String);\r
-}\r
-\r
-VOID\r
-PrintValue64 (\r
- UINT64 Value\r
- )\r
-{\r
- PrintValue ((UINT32) RShiftU64 (Value, 32));\r
- PrintValue ((UINT32) Value);\r
-}\r
-\r
-\r
-\r
VOID\r
PrintString (\r
- CHAR8 *String\r
+ IN CONST CHAR8 *FormatString,\r
+ ...\r
)\r
{\r
- UINT32 Index;\r
+ UINTN Index;\r
+ CHAR8 PrintBuffer[1000];\r
+ VA_LIST Marker;\r
\r
- for (Index = 0; String[Index] != 0; Index++) {\r
- if (String[Index] == '\n') {\r
- mCursor = (UINT8 *)(UINTN)(0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
+ VA_START (Marker, FormatString);\r
+ AsciiVSPrint (PrintBuffer, sizeof (PrintBuffer), FormatString, Marker);\r
+ VA_END (Marker);\r
+\r
+ for (Index = 0; PrintBuffer[Index] != 0; Index++) {\r
+ if (PrintBuffer[Index] == '\n') {\r
+ mCursor = (UINT8 *) (UINTN) (0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
} else {\r
- *mCursor = String[Index];\r
+ *mCursor = (UINT8) PrintBuffer[Index];\r
mCursor += 2;\r
}\r
}\r
- \r
+\r
//\r
// All information also output to serial port.\r
//\r
- DebugSerialPrint ((CHAR8*)String);\r
+ SerialPortWrite (PrintBuffer, Index);\r
}\r
\r
/** @file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
CHAR8 Char\r
);\r
\r
-VOID \r
-PrintValue (\r
- UINT32 Value\r
- );\r
-\r
VOID\r
-PrintValue64 (\r
- UINT64 Value\r
- );\r
-\r
-VOID \r
PrintString (\r
- CHAR8 *String\r
+ IN CONST CHAR8 *FormatString,\r
+ ...\r
);\r
\r
VOID \r
/** @file\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
VOID *MemoryTopOnDescriptor;\r
VOID *MemoryDescriptor;\r
VOID *NvStorageBase;\r
- CHAR8 PrintBuffer[256];\r
EFILDRHANDOFF HandoffCopy;\r
\r
CopyMem ((VOID*) &HandoffCopy, (VOID*) Handoff, sizeof (EFILDRHANDOFF));\r
Handoff = &HandoffCopy;\r
\r
ClearScreen();\r
- PrintString("Enter DxeIpl ...\n");\r
- \r
-/*\r
- ClearScreen();\r
- PrintString("handoff:\n");\r
- PrintString("Handoff.BfvBase = "); \r
- PrintValue64((UINT64)(UINTN)Handoff->BfvBase);\r
- PrintString(", "); \r
- PrintString("BfvLength = "); \r
- PrintValue64(Handoff->BfvSize);\r
- PrintString("\n"); \r
- PrintString("Handoff.DxeIplImageBase = "); \r
- PrintValue64((UINT64)(UINTN)Handoff->DxeIplImageBase);\r
- PrintString(", "); \r
- PrintString("DxeIplImageSize = "); \r
- PrintValue64(Handoff->DxeIplImageSize);\r
- PrintString("\n"); \r
- PrintString("Handoff.DxeCoreImageBase = "); \r
- PrintValue64((UINT64)(UINTN)Handoff->DxeCoreImageBase);\r
- PrintString(", "); \r
- PrintString("DxeCoreImageSize = "); \r
- PrintValue64(Handoff->DxeCoreImageSize);\r
- PrintString("\n"); \r
-*/\r
+\r
+ PrintString (\r
+ "Enter DxeIpl ...\n"\r
+ "Handoff:\n"\r
+ "Handoff.BfvBase = %p, BfvLength = %x\n"\r
+ "Handoff.DxeIplImageBase = %p, DxeIplImageSize = %x\n"\r
+ "Handoff.DxeCoreImageBase = %p, DxeCoreImageSize = %x\n",\r
+ Handoff->BfvBase, Handoff->BfvSize,\r
+ Handoff->DxeIplImageBase, Handoff->DxeIplImageSize,\r
+ Handoff->DxeCoreImageBase, Handoff->DxeCoreImageSize\r
+ );\r
+\r
//\r
// Hob Generation Guild line:\r
// * Don't report FV as physical memory\r
// * MemoryAllocation Hob should only cover physical memory\r
// * Use ResourceDescriptor Hob to report physical memory or Firmware Device and they shouldn't be overlapped\r
- PrintString("Prepare Cpu HOB information ...\n");\r
+ PrintString ("Prepare Cpu HOB information ...\n");\r
PrepareHobCpu ();\r
\r
//\r
// 1. BFV\r
//\r
- PrintString("Prepare BFV HOB information ...\n");\r
+ PrintString ("Prepare BFV HOB information ...\n");\r
PrepareHobBfv (Handoff->BfvBase, Handoff->BfvSize);\r
\r
//\r
// 2. Updates Memory information, and get the top free address under 4GB\r
//\r
- PrintString("Prepare Memory HOB information ...\n");\r
+ PrintString ("Prepare Memory HOB information ...\n");\r
MemoryTopOnDescriptor = PrepareHobMemory (Handoff->MemDescCount, Handoff->MemDesc);\r
\r
//\r
//\r
\r
// 3.1 NV data\r
- PrintString("Prepare NV Storage information ...\n");\r
+ PrintString ("Prepare NV Storage information ...\n");\r
NvStorageBase = PrepareHobNvStorage (MemoryTopOnDescriptor);\r
- AsciiSPrint (PrintBuffer, 256, "NV Storage Base=0x%x\n", (UINTN)NvStorageBase);\r
- PrintString (PrintBuffer);\r
- \r
+ PrintString ("NV Storage Base = %p\n", NvStorageBase);\r
// 3.2 Stack\r
StackTop = NvStorageBase;\r
StackBottom = PrepareHobStack (StackTop);\r
- AsciiSPrint (PrintBuffer, 256, "Stack Top=0x%x, Stack Bottom=0x%x\n", \r
- (UINTN)StackTop, (UINTN)StackBottom);\r
- PrintString (PrintBuffer);\r
+ PrintString ("Stack Top=0x%x, Stack Bottom=0x%x\n", StackTop, StackBottom);\r
// 3.3 Page Table\r
PageTableBase = PreparePageTable (StackBottom, gHob->Cpu.SizeOfMemorySpace);\r
// 3.4 MemDesc (will be used in PlatformBds)\r
//\r
// 4. Register the memory occupied by DxeCore and DxeIpl together as DxeCore\r
//\r
- PrintString("Prepare DxeCore memory Hob ...\n");\r
+ PrintString ("Prepare DxeCore memory Hob ...\n");\r
PrepareHobDxeCore (\r
Handoff->DxeCoreEntryPoint,\r
(EFI_PHYSICAL_ADDRESS)(UINTN)Handoff->DxeCoreImageBase,\r
\r
CompleteHobGeneration ();\r
\r
- AsciiSPrint (PrintBuffer, 256, "HobStart=0x%x\n", (UINTN)gHob);\r
- PrintString (PrintBuffer);\r
-\r
- AsciiSPrint (PrintBuffer, 256, "Memory Top=0x%x, Bottom=0x%x\n", \r
- (UINTN)gHob->Phit.EfiMemoryTop, (UINTN)gHob->Phit.EfiMemoryBottom);\r
- PrintString (PrintBuffer);\r
-\r
- AsciiSPrint (PrintBuffer, 256, "Free Memory Top=0x%x, Bottom=0x%x\n", \r
- (UINTN)gHob->Phit.EfiFreeMemoryTop, (UINTN)gHob->Phit.EfiFreeMemoryBottom);\r
- PrintString (PrintBuffer);\r
-\r
- AsciiSPrint (PrintBuffer, 256, "Nv Base=0x%x, Length=0x%x\n", \r
- (UINTN)gHob->NvStorageFvb.FvbInfo.Entries[0].Base, \r
- (UINTN)gHob->NvFtwFvb.FvbInfo.Entries[0].Length);\r
- PrintString (PrintBuffer);\r
-/*\r
//\r
// Print Hob Info\r
//\r
ClearScreen();\r
- PrintString("Hob Info\n");\r
- PrintString("Phit.EfiMemoryTop = "); \r
- PrintValue64(gHob->Phit.EfiMemoryTop);\r
- PrintString(" Phit.EfiMemoryBottom = "); \r
- PrintValue64(gHob->Phit.EfiMemoryBottom);\r
- PrintString("\n"); \r
- PrintString("Phit.EfiFreeMemoryTop = "); \r
- PrintValue64(gHob->Phit.EfiFreeMemoryTop);\r
- PrintString(" Phit.EfiFreeMemoryBottom = "); \r
- PrintValue64(gHob->Phit.EfiFreeMemoryBottom);\r
- PrintString("\n"); \r
- PrintString("Bfv = "); \r
- PrintValue64(gHob->Bfv.BaseAddress);\r
- PrintString(" BfvLength = "); \r
- PrintValue64(gHob->Bfv.Length);\r
- PrintString("\n");\r
- PrintString("NvStorageFvb = ");\r
- PrintValue64(gHob->NvStorageFvb.FvbInfo.Entries[0].Base);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvStorageFvb.FvbInfo.Entries[0].Length);\r
- PrintString("\n");\r
- PrintString("NvFtwFvb = ");\r
- PrintValue64(gHob->NvFtwFvb.FvbInfo.Entries[0].Base);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvFtwFvb.FvbInfo.Entries[0].Length);\r
- PrintString("\n");\r
- PrintString("BfvResource = ");\r
- PrintValue64(gHob->BfvResource.PhysicalStart);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->BfvResource.ResourceLength);\r
- PrintString("\n");\r
- PrintString("NvStorageFvResource = ");\r
- PrintValue64(gHob->NvStorageFvResource.PhysicalStart);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvStorageFvResource.ResourceLength);\r
- PrintString("\n");\r
- PrintString("NvStorage = ");\r
- PrintValue64(gHob->NvStorage.FvbInfo.Entries[0].Base);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvStorage.FvbInfo.Entries[0].Length);\r
- PrintString("\n");\r
- PrintString("NvFtwFvResource = ");\r
- PrintValue64(gHob->NvFtwFvResource.PhysicalStart);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvFtwFvResource.ResourceLength);\r
- PrintString("\n");\r
- PrintString("NvFtwWorking = ");\r
- PrintValue64(gHob->NvFtwWorking.FvbInfo.Entries[0].Base);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvFtwWorking.FvbInfo.Entries[0].Length);\r
- PrintString("\n");\r
- PrintString("NvFtwSpare = ");\r
- PrintValue64(gHob->NvFtwSpare.FvbInfo.Entries[0].Base);\r
- PrintString(" Length = ");\r
- PrintValue64(gHob->NvFtwSpare.FvbInfo.Entries[0].Length);\r
- PrintString("\n");\r
- PrintString("Stack = "); \r
- PrintValue64(gHob->Stack.AllocDescriptor.MemoryBaseAddress);\r
- PrintString(" StackLength = "); \r
- PrintValue64(gHob->Stack.AllocDescriptor.MemoryLength);\r
- PrintString("\n"); \r
- PrintString("PageTable = "); \r
- PrintValue64((UINTN)PageTableBase);\r
- PrintString("\n"); \r
- PrintString("MemoryFreeUnder1MB = "); \r
- PrintValue64(gHob->MemoryFreeUnder1MB.PhysicalStart);\r
- PrintString(" MemoryFreeUnder1MBLength = "); \r
- PrintValue64(gHob->MemoryFreeUnder1MB.ResourceLength);\r
- PrintString("\n"); \r
- PrintString("MemoryAbove1MB = "); \r
- PrintValue64(gHob->MemoryAbove1MB.PhysicalStart);\r
- PrintString(" MemoryAbove1MBLength = "); \r
- PrintValue64(gHob->MemoryAbove1MB.ResourceLength);\r
- PrintString("\n"); \r
- PrintString("MemoryAbove4GB = "); \r
- PrintValue64(gHob->MemoryAbove4GB.PhysicalStart);\r
- PrintString(" MemoryAbove4GBLength = "); \r
- PrintValue64(gHob->MemoryAbove4GB.ResourceLength);\r
- PrintString("\n"); \r
- PrintString("DxeCore = "); \r
- PrintValue64(gHob->DxeCore.MemoryAllocationHeader.MemoryBaseAddress);\r
- PrintString(" DxeCoreLength = "); \r
- PrintValue64(gHob->DxeCore.MemoryAllocationHeader.MemoryLength);\r
- PrintString("\n"); \r
- PrintString("MemoryAllocation = "); \r
- PrintValue64(gHob->MemoryAllocation.AllocDescriptor.MemoryBaseAddress);\r
- PrintString(" MemoryLength = "); \r
- PrintValue64(gHob->MemoryAllocation.AllocDescriptor.MemoryLength);\r
- PrintString("\n"); \r
- EFI_DEADLOOP();\r
-*/\r
+ PrintString (\r
+ "HobStart = %p\n"\r
+ "Memory Top = %lx, Bottom = %lx\n"\r
+ "Free Memory Top = %lx, Bottom = %lx\n"\r
+ "NvStorageFvb = %p, Length = %x\n"\r
+ "BfvResource = %lx, Length = %lx\n"\r
+ "NvStorageFvResource = %lx, Length = %lx\n"\r
+ "NvStorage = %lx, Length = %lx\n"\r
+ "NvFtwFvResource = %lx, Length = %lx\n"\r
+ "NvFtwWorking = %lx, Length = %lx\n"\r
+ "NvFtwSpare = %lx, Length = %lx\n"\r
+ "Stack = %lx, StackLength = %lx\n"\r
+ "PageTable = %p\n"\r
+ "MemoryFreeUnder1MB = %lx, MemoryFreeUnder1MBLength = %lx\n"\r
+ "MemoryAbove1MB = %lx, MemoryAbove1MBLength = %lx\n"\r
+ "MemoryAbove4GB = %lx, MemoryAbove4GBLength = %lx\n"\r
+ "DxeCore = %lx, DxeCoreLength = %lx\n"\r
+ "MemoryAllocation = %lx, MemoryLength = %lx\n"\r
+ "$",\r
+ gHob,\r
+ gHob->Phit.EfiMemoryTop, gHob->Phit.EfiMemoryBottom,\r
+ gHob->Phit.EfiFreeMemoryTop, gHob->Phit.EfiFreeMemoryBottom,\r
+ gHob->NvStorageFvb.FvbInfo.Entries[0].Base, (UINTN) gHob->NvFtwFvb.FvbInfo.Entries[0].Length,\r
+ gHob->BfvResource.PhysicalStart, gHob->BfvResource.ResourceLength,\r
+ gHob->NvStorageFvResource.PhysicalStart, gHob->NvStorageFvResource.ResourceLength,\r
+ gHob->NvStorage.FvbInfo.Entries[0].Base, gHob->NvStorage.FvbInfo.Entries[0].Length,\r
+ gHob->NvFtwFvResource.PhysicalStart, gHob->NvFtwFvResource.ResourceLength,\r
+ gHob->NvFtwWorking.FvbInfo.Entries[0].Base, gHob->NvFtwWorking.FvbInfo.Entries[0].Length,\r
+ gHob->NvFtwSpare.FvbInfo.Entries[0].Base, gHob->NvFtwSpare.FvbInfo.Entries[0].Length,\r
+ gHob->Stack.AllocDescriptor.MemoryBaseAddress, gHob->Stack.AllocDescriptor.MemoryLength,\r
+ PageTableBase,\r
+ gHob->MemoryFreeUnder1MB.PhysicalStart, gHob->MemoryFreeUnder1MB.ResourceLength,\r
+ gHob->MemoryAbove1MB.PhysicalStart, gHob->MemoryAbove1MB.ResourceLength,\r
+ gHob->MemoryAbove4GB.PhysicalStart, gHob->MemoryAbove4GB.ResourceLength,\r
+ gHob->DxeCore.MemoryAllocationHeader.MemoryBaseAddress, gHob->DxeCore.MemoryAllocationHeader.MemoryLength,\r
+ gHob->MemoryAllocation.AllocDescriptor.MemoryBaseAddress, gHob->MemoryAllocation.AllocDescriptor.MemoryLength\r
+ );\r
\r
ClearScreen();\r
- PrintString("\n\n\n\n\n\n\n\n\n\n");\r
- PrintString(" WELCOME TO EFI WORLD!\n");\r
+ PrintString (\r
+ "\n\n\n\n\n\n\n\n\n\n"\r
+ " WELCOME TO EFI WORLD!\n"\r
+ );\r
\r
EnterDxeMain (StackTop, Handoff->DxeCoreEntryPoint, gHob, PageTableBase);\r
+ PrintString ("Fail to enter DXE main!\n");\r
\r
- PrintString("Fail to enter DXE main!\n");\r
//\r
// Should never get here\r
//\r
## @file\r
# \r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
# which accompanies this distribution. The full text of the license may be found at \r
BaseLib\r
BaseMemoryLib\r
PrintLib\r
+ SerialPortLib\r
ReportStatusCodeLib\r
IoLib\r
\r
Ia32/Paging.c\r
Ia32/VirtualMemory.h\r
\r
-#[BuildOptions]\r
- #MSFT:*_*_IA32_DLINK_FLAGS = /out:"$(BIN_DIR)\SecMain.exe" /base:0x10000000 /pdb:"$(BIN_DIR)\SecMain.pdb" /LIBPATH:"$(VCINSTALLDIR)\Lib" /LIBPATH:"$(VCINSTALLDIR)\PlatformSdk\Lib" /NOLOGO /SUBSYSTEM:CONSOLE /NODEFAULTLIB /IGNORE:4086 /MAP /OPT:REF /DEBUG /MACHINE:I386 /LTCG Kernel32.lib MSVCRTD.lib Gdi32.lib User32.lib Winmm.lib\r
- #MSFT:*_*_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /Od /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
- #MSFT:*_*_IA32_PP_FLAGS = /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h\r
- #MSFT:*_*_IA32_ASM_FLAGS = /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi\r
- #MSFT:*_*_IA32_ASMLINK_FLAGS = /link /nologo /tiny \r
- #GCC:*_UNIXGCC_IA32_CC_FLAGS = -O2 -falign-functions -falign-jumps -falign-loops -freorder-blocks -freorder-blocks-and-partition -falign-labels -fshort-wchar -fno-strict-aliasing -Wall -Wno-missing-braces -c -include AutoGen.h\r
-\r
[Depex]\r
TRUE\r
/** @file\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
\r
--*/\r
{\r
- //EFI_PEI_PE_COFF_LOADER_PROTOCOL *PeCoffLoader;\r
- //EFI_DECOMPRESS_PROTOCOL *EfiDecompress;\r
- //EFI_TIANO_DECOMPRESS_PROTOCOL *TianoDecompress;\r
EFI_REPORT_STATUS_CODE ReportStatusCode;\r
\r
- //InstallEfiPeiFlushInstructionCache (&FlushInstructionCache);\r
- //Hob->FlushInstructionCache.Interface = FlushInstructionCache;\r
-\r
- // R9 do not need this protocol.\r
- // InstallEfiPeiTransferControl (&TransferControl);\r
- // Hob->TransferControl.Interface = TransferControl;\r
-\r
- //InstallEfiPeiPeCoffLoader (NULL, &PeCoffLoader, NULL);\r
- //Hob->PeCoffLoader.Interface = PeCoffLoader;\r
-\r
- //InstallEfiDecompress (&EfiDecompress);\r
- //Hob->EfiDecompress.Interface = EfiDecompress;\r
-\r
- //InstallTianoDecompress (&TianoDecompress);\r
- //Hob->TianoDecompress.Interface = TianoDecompress;\r
-\r
InstallSerialStatusCode (&ReportStatusCode);\r
Hob->SerialStatusCode.Interface = (EFI_PHYSICAL_ADDRESS) (UINTN) ReportStatusCode;\r
\r
/** @file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
\r
**/\r
\r
+#include <Library/SerialPortLib.h>\r
#include "SerialStatusCode.h"\r
\r
-\r
-UINT16 gComBase = 0x3f8;\r
-UINTN gBps = 115200;\r
-UINT8 gData = 8;\r
-UINT8 gStop = 1;\r
-UINT8 gParity = 0;\r
-UINT8 gBreakSet = 0;\r
-\r
//\r
// All of the lookup tables are only needed in debug.\r
//\r
}\r
\r
\r
-\r
-VOID\r
-DebugSerialWrite (\r
- IN UINT8 Character\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- DebugSerialWrite - Outputs a character to the Serial port\r
-\r
- Repeatedly polls the TXRDY bit of the Line Status Register\r
- until the Transmitter Holding Register is empty. The character\r
- is then written to the Serial port.\r
-\r
-Arguments:\r
-\r
- Character - Character to write\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- UINT8 Data;\r
-\r
- //\r
- // Wait for the serail port to be ready.\r
- //\r
- do {\r
- Data = IoRead8 (gComBase + LSR_OFFSET);\r
- } while ((Data & LSR_TXRDY) == 0);\r
- \r
- IoWrite8 (gComBase, Character);\r
-}\r
-\r
-VOID\r
-DebugSerialPrint (\r
- IN CHAR8 *OutputString\r
- )\r
-/*++\r
-\r
-Routine Description:\r
-\r
- Prints a string to the Serial port\r
-\r
-Arguments:\r
-\r
- OutputString - Ascii string to print to serial port.\r
-\r
-Returns:\r
-\r
- None\r
-\r
---*/\r
-{\r
- for ( ; *OutputString != 0; OutputString++) {\r
- DebugSerialWrite (*OutputString);\r
- }\r
-}\r
-\r
EFI_STATUS\r
EFIAPI \r
SerialReportStatusCode (\r
CHAR8 *Format;\r
BASE_LIST Marker;\r
UINT32 ErrorLevel;\r
- UINTN CharCount;\r
+ UINTN CharCount = 0;\r
\r
Buffer[0] = '\0';\r
\r
//\r
// Processes PEI_ASSERT ()\r
//\r
- AsciiSPrint (\r
+ CharCount = AsciiSPrint (\r
Buffer,\r
sizeof (Buffer),\r
"\nPEI_ASSERT!: %a (%d): %a\n",\r
//\r
// Process PEI_DEBUG () macro to Serial\r
//\r
- AsciiBSPrint (Buffer, sizeof (Buffer), Format, Marker);\r
+ CharCount = AsciiBSPrint (Buffer, sizeof (Buffer), Format, Marker);\r
\r
} else if ((CodeType & EFI_STATUS_CODE_TYPE_MASK) == EFI_ERROR_CODE) { \r
//\r
//\r
// Callout to platform Lib function to do print.\r
//\r
- DebugSerialPrint (Buffer);\r
+ SerialPortWrite (Buffer, CharCount);\r
}\r
\r
//\r
//\r
// Concatenate the instance\r
//\r
- AsciiSPrint (\r
+ CharCount = AsciiSPrint (\r
Buffer,\r
sizeof (Buffer),\r
"%a:%a:%a:%d\n",\r
Instance\r
);\r
\r
- DebugSerialPrint (Buffer);\r
+ SerialPortWrite (Buffer, CharCount);\r
}\r
}\r
\r
\r
Routine Description:\r
\r
- Initialize Serial Port\r
-\r
- The Baud Rate Divisor registers are programmed and the LCR \r
- is used to configure the communications format. Hard coded\r
- UART config comes from globals in DebugSerialPlatform lib.\r
+ Initialize Serial Port and Status Code Handler\r
\r
Arguments: \r
\r
- None\r
+ ReportStatusCode - A pointer to the handler\r
\r
Returns: \r
\r
\r
--*/\r
{\r
- UINTN Divisor;\r
- UINT8 OutputData;\r
- UINT8 Data;\r
-\r
- //\r
- // Some init is done by the platform status code initialization.\r
- //\r
- \r
- //\r
- // Map 5..8 to 0..3\r
- //\r
- Data = (UINT8) (gData - (UINT8)5);\r
-\r
- //\r
- // Calculate divisor for baud generator\r
- //\r
- Divisor = 115200 / gBps; \r
- \r
- //\r
- // Set communications format\r
- //\r
- OutputData = (UINT8)((DLAB << 7) | ((gBreakSet << 6) | ((gParity << 3) | ((gStop << 2) | Data))));\r
- IoWrite8 (gComBase + LCR_OFFSET, OutputData);\r
-\r
- //\r
- // Configure baud rate\r
- //\r
- IoWrite8 (gComBase + BAUD_HIGH_OFFSET, (UINT8)(Divisor >> 8));\r
- IoWrite8 (gComBase + BAUD_LOW_OFFSET, (UINT8)(Divisor & 0xff));\r
-\r
- //\r
- // Switch back to bank 0\r
- //\r
- OutputData = (UINT8)((~DLAB<<7)|((gBreakSet<<6)|((gParity<<3)|((gStop<<2)| Data))));\r
- IoWrite8 (gComBase + LCR_OFFSET, OutputData);\r
-\r
+ SerialPortInitialize();\r
*ReportStatusCode = SerialReportStatusCode;\r
}\r
/** @file\r
\r
-Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
//\r
\r
\r
-//---------------------------------------------\r
-// UART Register Offsets\r
-//---------------------------------------------\r
-#define BAUD_LOW_OFFSET 0x00\r
-#define BAUD_HIGH_OFFSET 0x01\r
-#define IER_OFFSET 0x01\r
-#define LCR_SHADOW_OFFSET 0x01\r
-#define FCR_SHADOW_OFFSET 0x02\r
-#define IR_CONTROL_OFFSET 0x02\r
-#define FCR_OFFSET 0x02\r
-#define EIR_OFFSET 0x02\r
-#define BSR_OFFSET 0x03\r
-#define LCR_OFFSET 0x03\r
-#define MCR_OFFSET 0x04\r
-#define LSR_OFFSET 0x05\r
-#define MSR_OFFSET 0x06\r
-\r
-//---------------------------------------------\r
-// UART Register Bit Defines\r
-//---------------------------------------------\r
-#define LSR_TXRDY 0x20\r
-#define LSR_RXDA 0x01\r
-#define DLAB 0x01\r
-\r
-//\r
-// Globals for Serial Port settings\r
-//\r
-extern UINT16 gComBase;\r
-extern UINTN gBps;\r
-extern UINT8 gData;\r
-extern UINT8 gStop;\r
-extern UINT8 gParity;\r
-extern UINT8 gBreakSet;\r
-\r
-VOID\r
-DebugSerialPrint (\r
- IN CHAR8 *OutputString\r
- );\r
-\r
-VOID\r
-DebugSerialWrite (\r
- IN UINT8 Character\r
- );\r
-\r
VOID\r
InstallSerialStatusCode (\r
IN EFI_REPORT_STATUS_CODE *ReportStatusCode\r
/*++\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
--*/\r
#include "EfiLdr.h"\r
#include "Debug.h"\r
-#include <Library/SerialPortLib.h>\r
\r
UINT8 *mCursor;\r
UINT8 mHeaderIndex = 10;\r
\r
+\r
VOID\r
PrintHeader (\r
CHAR8 Char\r
mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);\r
}\r
\r
-\r
-VOID \r
-PrintU32Base10 (\r
- UINT32 Value\r
- )\r
-{\r
- UINT32 Index;\r
- CHAR8 Char;\r
- CHAR8 String[11];\r
- UINTN StringPos;\r
- UINT32 B10Div;\r
-\r
- B10Div = 1000000000;\r
- for (Index = 0, StringPos = 0; Index < 10; Index++) {\r
- Char = (UINT8) (((Value / B10Div) % 10) + '0');\r
- if ((StringPos > 0) || (Char != '0')) {\r
- String[StringPos] = Char;\r
- StringPos++;\r
- }\r
- B10Div = B10Div / 10;\r
- }\r
-\r
- if (StringPos == 0) {\r
- String[0] = '0';\r
- StringPos++;\r
- }\r
-\r
- String[StringPos] = '\0';\r
-\r
- PrintString (String);\r
-}\r
-\r
-\r
-VOID\r
-PrintValue (\r
- UINT32 Value\r
- )\r
-{\r
- UINT32 Index;\r
- CHAR8 Char;\r
- CHAR8 String[9];\r
-\r
- for (Index = 0; Index < 8; Index++) {\r
- Char = (UINT8)(((Value >> ((7 - Index) * 4)) & 0x0f) + '0');\r
- if (Char > '9') {\r
- Char = (UINT8) (Char - '0' - 10 + 'A');\r
- }\r
- String[Index] = Char;\r
- }\r
-\r
- String[sizeof (String) - 1] = '\0';\r
-\r
- PrintString (String);\r
-}\r
-\r
-VOID\r
-PrintValue64 (\r
- UINT64 Value\r
- )\r
-{\r
- PrintValue ((UINT32) RShiftU64 (Value, 32));\r
- PrintValue ((UINT32) Value);\r
-}\r
-\r
VOID\r
PrintString (\r
- CHAR8 *String\r
+ IN CONST CHAR8 *FormatString,\r
+ ...\r
)\r
{\r
- UINT32 Index;\r
+ UINTN Index;\r
+ CHAR8 PrintBuffer[256];\r
+ VA_LIST Marker;\r
+\r
+ VA_START (Marker, FormatString);\r
+ AsciiVSPrint (PrintBuffer, sizeof (PrintBuffer), FormatString, Marker);\r
+ VA_END (Marker);\r
\r
- for (Index = 0; String[Index] != 0; Index++) {\r
- if (String[Index] == '\n') {\r
- mCursor = (UINT8 *)(UINTN)(0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
+ for (Index = 0; PrintBuffer[Index] != 0; Index++) {\r
+ if (PrintBuffer[Index] == '\n') {\r
+ mCursor = (UINT8 *) (UINTN) (0xb8000 + (((((UINTN)mCursor - 0xb8000) + 160) / 160) * 160));\r
} else {\r
- *mCursor = String[Index];\r
+ *mCursor = (UINT8) PrintBuffer[Index];\r
mCursor += 2;\r
}\r
}\r
//\r
// All information also output to serial port.\r
//\r
- SerialPortWrite ((UINT8*) String, Index);\r
+ SerialPortWrite (PrintBuffer, Index);\r
}\r
\r
CHAR8 Char\r
);\r
\r
-VOID \r
-PrintValue (\r
- UINT32 Value\r
- );\r
-\r
VOID\r
-PrintValue64 (\r
- UINT64 Value\r
- );\r
-\r
-VOID \r
PrintString (\r
- CHAR8 *String\r
+ IN CONST CHAR8 *FormatString,\r
+ ...\r
);\r
\r
VOID \r
/*++\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
#include <Library/BaseLib.h>\r
#include <Library/BaseMemoryLib.h>\r
#include <Library/PrintLib.h>\r
+#include <Library/SerialPortLib.h>\r
\r
#define INT15_E820_AddressRangeMemory 1\r
#define INT15_E820_AddressRangeReserved 2\r
## @file\r
# \r
-# Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
# This program and the accompanying materials \r
# are licensed and made available under the terms and conditions of the BSD License \r
# which accompanies this distribution. The full text of the license may be found at \r
INF_VERSION = 0x00010005\r
BASE_NAME = EfiLoader\r
FILE_GUID = A9620E5C-5FA1-40b7-8B21-50B632F88F38\r
- #MODULE_TYPE = USER_DEFINED\r
MODULE_TYPE = UEFI_APPLICATION\r
VERSION_STRING = 1.0\r
\r
gTianoCustomDecompressGuid\r
\r
[BuildOptions]\r
- MSFT:*_*_IA32_CC_FLAGS = /nologo /W4 /WX /Gy /c /D UNICODE /O1ib2 /FI$(DEST_DIR_DEBUG)/AutoGen.h /EHs-c- /GF /Gs8192 /Zi /Gm /D _CRT_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE\r
- MSFT:*_*_IA32_PP_FLAGS == /nologo /E /TC /FI$(DEST_DIR_DEBUG)/AutoGen.h\r
- MSFT:*_*_IA32_ASM_FLAGS == /nologo /W3 /WX /c /coff /Cx /Zd /W0 /Zi\r
- MSFT:*_*_IA32_ASMLINK_FLAGS == /link /nologo /tiny \r
MSFT:*_*_*_DLINK_FLAGS = /BASE:0x10000\r
/*++\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
#include "LzmaDecompress.h"\r
\r
VOID\r
-SystemHang(\r
- VOID\r
+SystemHang (\r
+ CHAR8 *Message\r
)\r
{\r
- CHAR8 PrintBuffer[256];\r
- AsciiSPrint (PrintBuffer, 256, "## FATEL ERROR ##: Fail to load DUET images! System hang!\n");\r
+ PrintString (\r
+ "%s## FATAL ERROR ##: Fail to load DUET images! System hang!\n",\r
+ Message\r
+ );\r
CpuDeadLoop();\r
}\r
\r
UINTN BfvPageNumber;\r
UINTN BfvBase;\r
EFI_MAIN_ENTRYPOINT EfiMainEntrypoint;\r
- CHAR8 PrintBuffer[256];\r
EFILDRHANDOFF Handoff;\r
+ UINTN Index;\r
\r
ClearScreen();\r
\r
PrintHeader ('A');\r
-
- AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader...\n");\r
- PrintString (PrintBuffer);\r
-\r
- AsciiSPrint (PrintBuffer, 256, "BiosMemoryMapBaseAddress = 0x%x\n", BiosMemoryMapBaseAddress);\r
- PrintString (PrintBuffer);\r
+ \r
+ PrintString ("Enter DUET Loader...\n");\r
+ PrintString ("BiosMemoryMapBaseAddress = %x\n", (UINTN) BiosMemoryMapBaseAddress);\r
\r
//\r
// Add all EfiConventionalMemory descriptors to the table. If there are partial pages, then\r
// round the start address up to the next page, and round the length down to a page boundry.\r
//\r
- BiosMemoryMap = (BIOS_MEMORY_MAP *)(UINTN)(BiosMemoryMapBaseAddress);\r
+ BiosMemoryMap = (BIOS_MEMORY_MAP *) (UINTN) BiosMemoryMapBaseAddress;\r
NumberOfMemoryMapEntries = 0;\r
GenMemoryMap (&NumberOfMemoryMapEntries, EfiMemoryDescriptor, BiosMemoryMap);\r
\r
- AsciiSPrint (PrintBuffer, 256, "Get %d entries of memory map!\n", NumberOfMemoryMapEntries);\r
- PrintString (PrintBuffer);\r
+ PrintString ("Get %d entries of memory map!\n", NumberOfMemoryMapEntries);\r
\r
//\r
// Get information on where the image is in memory\r
//\r
-\r
- //EFILDRHeader = (EFILDR_HEADER *)(UINTN)(EFILDR_HEADER_ADDRESS);\r
EFILDRImage = (EFILDR_IMAGE *)(UINTN)(EFILDR_HEADER_ADDRESS + sizeof(EFILDR_HEADER));\r
\r
\r
//\r
// Point to the 4th image (Bfv)\r
//\r
- \r
EFILDRImage += 3;\r
\r
//\r
// Decompress the image\r
//\r
-\r
- AsciiSPrint (PrintBuffer, 256, "Decompress BFV image, Image Address=0x%x Offset=0x%x\n", \r
- (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
- EFILDRImage->Offset);\r
- PrintString (PrintBuffer);\r
+ PrintString (\r
+ "Decompress BFV image, Image Address = %x Offset = %x\n", \r
+ (UINTN) (EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
+ (UINTN) EFILDRImage->Offset\r
+ );\r
Status = LzmaUefiDecompressGetInfo (\r
(VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
EFILDRImage->Length,\r
);\r
\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to get decompress information for BFV!\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to get decompress information for BFV!\n");\r
}\r
\r
- AsciiSPrint (PrintBuffer, 256, "BFV decompress: DestinationSize=0x%X, ScratchSize=0x%X!\n",\r
- DestinationSize, ScratchSize);\r
- PrintString (PrintBuffer);\r
+ PrintString ("BFV decompress: DestinationSize = %x, ScratchSize = %x\n", (UINTN) DestinationSize, (UINTN) ScratchSize);\r
Status = LzmaUefiDecompress (\r
(VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
EFILDRImage->Length,\r
\r
\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to decompress BFV!\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to decompress BFV!\n");\r
}\r
\r
BfvPageNumber = EFI_SIZE_TO_PAGES (DestinationSize);\r
BfvBase = (UINTN) FindSpace (BfvPageNumber, &NumberOfMemoryMapEntries, EfiMemoryDescriptor, EfiRuntimeServicesData, EFI_MEMORY_WB);\r
if (BfvBase == 0) {\r
- SystemHang();\r
+ SystemHang ("Failed to find free space to hold decompressed BFV\n");\r
}\r
ZeroMem ((VOID *)(UINTN)BfvBase, BfvPageNumber * EFI_PAGE_SIZE);\r
CopyMem ((VOID *)(UINTN)BfvBase, (VOID *)(UINTN)EFI_DECOMPRESSED_BUFFER_ADDRESS, DestinationSize);\r
//\r
// Decompress the image\r
//\r
- AsciiSPrint (PrintBuffer, 256, "Decompress DxeIpl image, Image Address=0x%x Offset=0x%x\n", \r
- (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
- EFILDRImage->Offset);\r
- PrintString (PrintBuffer);\r
+ PrintString (\r
+ "Decompress DxeIpl image, Image Address = %x Offset = %x\n", \r
+ (UINTN) (EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
+ (UINTN) EFILDRImage->Offset\r
+ );\r
\r
Status = LzmaUefiDecompressGetInfo (\r
(VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
&ScratchSize\r
);\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to get decompress information for DxeIpl!\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to get decompress information for DxeIpl!\n");\r
}\r
\r
Status = LzmaUefiDecompress (\r
(VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000)\r
);\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to decompress DxeIpl image\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to decompress DxeIpl image\n");\r
}\r
\r
- AsciiSPrint (PrintBuffer, 256, "Start load DxeIpl PE image\n");\r
- PrintString (PrintBuffer); \r
+ PrintString ("Start load DxeIpl PE image\n"); \r
\r
//\r
// Load and relocate the EFI PE/COFF Firmware Image \r
EfiMemoryDescriptor\r
);\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to load and relocate DxeIpl PE image!\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to load and relocate DxeIpl PE image!\n");\r
}\r
- AsciiSPrint (PrintBuffer, 256, "DxeIpl PE image is successed loaded at 0x%x, entry=0x%x\n",\r
- (UINTN)DxeIplImage.ImageBasePage, (UINTN)DxeIplImage.EntryPoint);\r
- PrintString (PrintBuffer); \r
-\r
-// PrintString("Image.NoPages = "); \r
-// PrintValue(Image.NoPages);\r
-// PrintString("\n");\r
+ PrintString (\r
+ "DxeIpl PE image is successed loaded at %lx, entry=%p\n",\r
+ DxeIplImage.ImageBasePage,\r
+ DxeIplImage.EntryPoint\r
+ );\r
\r
PrintHeader ('C');\r
\r
//\r
// Point to the 3rd image (DxeMain)\r
//\r
- \r
EFILDRImage++;\r
\r
//\r
// Decompress the image\r
//\r
- AsciiSPrint (PrintBuffer, 256, "Decompress DXEMain FV image, Image Address=0x%x! Offset=0x%x\n", \r
- (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
- EFILDRImage->Offset);\r
- PrintString (PrintBuffer);\r
+ PrintString (\r
+ "Decompress DxeMain FV image, Image Address = %x Offset = %x\n",\r
+ (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
+ (UINTN) EFILDRImage->Offset\r
+ );\r
\r
Status = LzmaUefiDecompressGetInfo (\r
(VOID *)(UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset),\r
&ScratchSize\r
);\r
if (EFI_ERROR (Status)) {\r
- AsciiSPrint (PrintBuffer, 256, "Fail to get decompress information for DXEMain FV image!\n");\r
- PrintString (PrintBuffer);\r
- SystemHang();\r
+ SystemHang ("Failed to get decompress information for DxeMain FV image!\n");\r
}\r
\r
Status = LzmaUefiDecompress (\r
(VOID *)(UINTN)((EFI_DECOMPRESSED_BUFFER_ADDRESS + DestinationSize + 0x1000) & 0xfffff000)\r
);\r
if (EFI_ERROR (Status)) {\r
- SystemHang();\r
+ SystemHang ("Failed to decompress DxeMain FV image!\n");\r
}\r
\r
//\r
EfiMemoryDescriptor\r
);\r
if (EFI_ERROR (Status)) {\r
- SystemHang();\r
+ SystemHang ("Failed to load/relocate DxeMain!\n");\r
}\r
- AsciiSPrint (PrintBuffer, 256, "DxeCore PE image is successed loaded at 0x%x, entry=0x%x\n",\r
- (UINTN)DxeCoreImage.ImageBasePage, (UINTN)DxeCoreImage.EntryPoint);\r
- PrintString (PrintBuffer); \r
+ PrintString (\r
+ "DxeCore PE image is successed loaded at %lx, entry=%p\n",\r
+ DxeCoreImage.ImageBasePage,\r
+ DxeCoreImage.EntryPoint\r
+ );\r
\r
PrintHeader ('E');\r
\r
//\r
// Display the table of memory descriptors.\r
//\r
-\r
-// PrintString("\nEFI Memory Descriptors\n"); \r
-/*\r
- {\r
- UINTN Index;\r
+ PrintString ("\nEFI Memory Descriptors\n"); \r
for (Index = 0; Index < NumberOfMemoryMapEntries; Index++) {\r
- PrintString("Type = "); \r
- PrintValue(EfiMemoryDescriptor[Index].Type);\r
- PrintString(" Start = "); \r
- PrintValue((UINT32)(EfiMemoryDescriptor[Index].PhysicalStart));\r
- PrintString(" NumberOfPages = "); \r
- PrintValue((UINT32)(EfiMemoryDescriptor[Index].NumberOfPages));\r
- PrintString("\n");\r
- }\r
+ PrintString (\r
+ "Type = %x Start = %08lx NumberOfPages = %08lx\n",\r
+ EfiMemoryDescriptor[Index].Type, EfiMemoryDescriptor[Index].PhysicalStart, EfiMemoryDescriptor[Index].NumberOfPages\r
+ );\r
}\r
-*/\r
\r
//\r
// Jump to EFI Firmware\r
Handoff.DxeCoreImageSize = DxeCoreImage.NoPages * EFI_PAGE_SIZE;\r
Handoff.DxeCoreEntryPoint = (VOID *)(UINTN)DxeCoreImage.EntryPoint;\r
\r
- AsciiSPrint (PrintBuffer, 256, "Transfer to DxeIpl ...Address=0x%x\n", (UINTN)DxeIplImage.EntryPoint);\r
- PrintString (PrintBuffer);\r
+ PrintString ("Transfer to DxeIpl ...EntryPoint = %p\n", DxeIplImage.EntryPoint);\r
\r
- EfiMainEntrypoint = (EFI_MAIN_ENTRYPOINT)(UINTN)DxeIplImage.EntryPoint;\r
+ EfiMainEntrypoint = (EFI_MAIN_ENTRYPOINT) DxeIplImage.EntryPoint;\r
EfiMainEntrypoint (&Handoff);\r
}\r
\r
// There was a problem loading the image, so HALT the system.\r
//\r
\r
- SystemHang();\r
+ SystemHang ("Failed to jump to DxeIpl!\n");\r
}\r
\r
EFI_STATUS\r
UINT32 BiosMemoryMapBaseAddress\r
)\r
{\r
+ SerialPortInitialize ();\r
EfiLoader(BiosMemoryMapBaseAddress);\r
return EFI_SUCCESS;\r
}\r