summaryrefslogtreecommitdiff
path: root/DuetPkg
diff options
context:
space:
mode:
authorjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-16 18:51:09 +0000
committerjljusten <jljusten@6f19259b-4bc3-4df7-8a09-765794883524>2010-10-16 18:51:09 +0000
commit6fc74eaa6393ef107619ee19e2939cde6a8ee205 (patch)
treee8097a8e7df036e35d6fa8ccb684abe2c1afc84f /DuetPkg
parent65e9e352456b8a7f3fec323c3210c2023b181865 (diff)
DuetPkg: Send EfiLdr messages to serial port
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10949 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'DuetPkg')
-rw-r--r--DuetPkg/DuetPkgIa32.dsc2
-rw-r--r--DuetPkg/DuetPkgX64.dsc2
-rw-r--r--DuetPkg/EfiLdr/Debug.c59
-rw-r--r--DuetPkg/EfiLdr/EfiLdr.inf1
4 files changed, 54 insertions, 10 deletions
diff --git a/DuetPkg/DuetPkgIa32.dsc b/DuetPkg/DuetPkgIa32.dsc
index b0677e3de..fa411b5b9 100644
--- a/DuetPkg/DuetPkgIa32.dsc
+++ b/DuetPkg/DuetPkgIa32.dsc
@@ -98,6 +98,7 @@
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
#
# To save size, use NULL library for DebugLib and ReportStatusCodeLib.
@@ -166,7 +167,6 @@
<LibraryClasses>
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
ReportStatusCodeLib|DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/DxeCoreReportStatusCodeLibFromHob.inf
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
}
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
diff --git a/DuetPkg/DuetPkgX64.dsc b/DuetPkg/DuetPkgX64.dsc
index a83d705b6..007978253 100644
--- a/DuetPkg/DuetPkgX64.dsc
+++ b/DuetPkg/DuetPkgX64.dsc
@@ -98,6 +98,7 @@
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
+ SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
#
# To save size, use NULL library for DebugLib and ReportStatusCodeLib.
@@ -166,7 +167,6 @@
<LibraryClasses>
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
ReportStatusCodeLib|DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/DxeCoreReportStatusCodeLibFromHob.inf
- SerialPortLib|PcAtChipsetPkg/Library/SerialIoLib/SerialIoLib.inf
}
MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
diff --git a/DuetPkg/EfiLdr/Debug.c b/DuetPkg/EfiLdr/Debug.c
index 0f554b01e..d0049218d 100644
--- a/DuetPkg/EfiLdr/Debug.c
+++ b/DuetPkg/EfiLdr/Debug.c
@@ -19,6 +19,7 @@ Revision History:
--*/
#include "EfiLdr.h"
#include "Debug.h"
+#include <Library/SerialPortLib.h>
UINT8 *mCursor;
UINT8 mHeaderIndex = 10;
@@ -47,31 +48,68 @@ ClearScreen (
mCursor = (UINT8 *)(UINTN)(0x000b8000 + 160);
}
-VOID
-PrintValue64 (
- UINT64 Value
+
+VOID
+PrintU32Base10 (
+ UINT32 Value
)
{
- PrintValue ((UINT32) RShiftU64 (Value, 32));
- PrintValue ((UINT32) Value);
+ UINT32 Index;
+ CHAR8 Char;
+ CHAR8 String[11];
+ UINTN StringPos;
+ UINT32 B10Div;
+
+ B10Div = 1000000000;
+ for (Index = 0, StringPos = 0; Index < 10; Index++) {
+ Char = ((Value / B10Div) % 10) + '0';
+ if ((StringPos > 0) || (Char != '0')) {
+ String[StringPos] = Char;
+ StringPos++;
+ }
+ B10Div = B10Div / 10;
+ }
+
+ if (StringPos == 0) {
+ String[0] = '0';
+ StringPos++;
+ }
+
+ String[StringPos] = '\0';
+
+ PrintString (String);
}
+
VOID
PrintValue (
UINT32 Value
)
{
UINT32 Index;
- UINT8 Char;
+ CHAR8 Char;
+ CHAR8 String[9];
for (Index = 0; Index < 8; Index++) {
Char = (UINT8)(((Value >> ((7 - Index) * 4)) & 0x0f) + '0');
if (Char > '9') {
Char = (UINT8) (Char - '0' - 10 + 'A');
}
- *mCursor = Char;
- mCursor += 2;
+ String[Index] = Char;
}
+
+ String[sizeof (String) - 1] = '\0';
+
+ PrintString (String);
+}
+
+VOID
+PrintValue64 (
+ UINT64 Value
+ )
+{
+ PrintValue ((UINT32) RShiftU64 (Value, 32));
+ PrintValue ((UINT32) Value);
}
VOID
@@ -89,5 +127,10 @@ PrintString (
mCursor += 2;
}
}
+
+ //
+ // All information also output to serial port.
+ //
+ SerialPortWrite ((UINT8*) String, Index);
}
diff --git a/DuetPkg/EfiLdr/EfiLdr.inf b/DuetPkg/EfiLdr/EfiLdr.inf
index 829320528..ea3977d88 100644
--- a/DuetPkg/EfiLdr/EfiLdr.inf
+++ b/DuetPkg/EfiLdr/EfiLdr.inf
@@ -33,6 +33,7 @@
BaseLib
BaseMemoryLib
PrintLib
+ SerialPortLib
[Sources]
Debug.h