]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1, Enable USB boot for R9's Duet.
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 6 Jan 2009 03:25:24 +0000 (03:25 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 6 Jan 2009 03:25:24 +0000 (03:25 +0000)
2, Work around an RTC issue for DUET under vmware environment.
3, Enable early serial status code output for DxeCore module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7187 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/CreateBootDisk.bat
DuetPkg/DuetPkg.dsc
DuetPkg/DxeIpl/DxeInit.c
DuetPkg/PcRtc/RealTimeClock.c

index 8bed045a0ca65fc8dccebe89f7496b25e2c30c92..c37eed09cc5f4296f0c94783983c2a1b50cf5d1e 100644 (file)
@@ -3,7 +3,7 @@
 @REM Set up environment at fisrt.\r
 \r
 @REM set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32\r
-@set BASETOOLS_DIR=m:\tree\BaseTools\Bin\Win32\r
+@set BASETOOLS_DIR=n:\BaseTools\Bin\Win32\r
 @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS\r
 @set DISK_LABEL=DUET\r
 @echo on\r
@@ -14,6 +14,7 @@
 @if "%3"=="" goto Help\r
 @set EFI_BOOT_DISK=%2\r
 @if "%1"=="floppy" goto CreateFloppy\r
+@if "%1"=="file" goto CreateFile\r
 @if "%1"=="usb" goto CreateUsb\r
 @if "%1"=="ide" goto CreateIde\r
 goto Help\r
@@ -37,6 +38,17 @@ mkdir %EFI_BOOT_DISK%\efi\boot
 copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
 @goto end\r
 \r
+:CreateFile\r
+@if NOT "%3"=="FAT12" goto WrongFATType\r
+@echo Start to create file boot disk ...\r
+@echo Create boot sector ...\r
+%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o FDBs.com\r
+%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com -f\r
+@REM @del FDBS.com\r
+%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com\r
+@echo Done.\r
+@goto end\r
+\r
 :CreateUsb\r
 @echo Start to create usb boot disk ...\r
 @if "%3"=="FAT16" goto CreateUsb_FAT16\r
@@ -44,6 +56,7 @@ copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\boot
 @if "%3"=="FAT12" goto WrongFATType\r
 \r
 :CreateUsb_FAT16\r
+@if "%4"=="step2" goto CreateUsb_FAT16_step2\r
 @echo Format %EFI_BOOT_DISK% ...\r
 @echo.> FormatCommandInput.txt\r
 @format /FS:FAT /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL\r
@@ -51,14 +64,16 @@ copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\boot
 @echo Create boot sector ...\r
 @%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs16.com\r
 @%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs16.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com -f\r
-@del UsbBs16.com\r
 @%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com\r
 @%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com\r
+@echo Done.\r
+@echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!\r
+@goto end\r
+\r
+:CreateUsb_FAT16_step2\r
 @copy %BUILD_DIR%\FV\EfiLdr16 %EFI_BOOT_DISK%\r
 @mkdir %EFI_BOOT_DISK%\efi\boot\r
 @copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
-@echo Done.\r
-@echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!\r
 @goto end\r
 \r
 :CreateUsb_FAT32\r
index a87515cde96d0d728a41a5bf9540fa46e5a6ceed..323d84b8f9928041cc7d429baf42e2186d51c5ae 100644 (file)
   MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf\r
   UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf\r
   DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf\r
-  ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf\r
+  ReportStatusCodeLib|DuetPkg/Library/DuetDxeReportStatusCodeLib/DuetDxeReportStatusCodeLib.inf\r
   SerialPortLib|DuetPkg/Library/DuetSerialIoLib/DuetSerialIoLib.inf\r
   PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf\r
   ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf\r
-\r
+  \r
+  \r
 [LibraryClasses.common.DXE_RUNTIME_DRIVER]\r
   MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf\r
   HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf\r
index 6bc3170bc5bb2ba866c6ff53ed695d7eb7e07dc6..2f4e5b9f82026d833f93fed2ffa8d0f677f69532 100644 (file)
@@ -110,6 +110,19 @@ EnterDxeMain (
   IN VOID *PageTable\r
   );\r
 \r
+VOID\r
+WaitForKey ()\r
+{\r
+    PrintString("Press Enter to continue ...\n");\r
+    _asm {\r
+            mov  al,  20h\r
+            out  64h, al\r
+     AGAIN: in   al,  60h\r
+            cmp  al,  1ch\r
+            jnz  AGAIN\r
+    }\r
+}\r
+\r
 VOID\r
 DxeInit (\r
   IN EFILDRHANDOFF  *Handoff\r
@@ -139,6 +152,7 @@ Returns:
   \r
   ClearScreen();\r
   PrintString("Enter DxeIpl ...\n");\r
+  \r
 /*\r
   ClearScreen();\r
   PrintString("handoff:\n");\r
@@ -166,27 +180,31 @@ Returns:
   //   * 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
-  \r
+  PrintString("Prepare Cpu HOB information ...\n");\r
   PrepareHobCpu ();\r
+\r
   //\r
   // 1. BFV\r
   //\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
   MemoryTopOnDescriptor = PrepareHobMemory (Handoff->MemDescCount, Handoff->MemDesc);\r
-\r
+  \r
   //\r
   // 3. Put [NV], [Stack], [PageTable], [MemDesc], [HOB] just below the [top free address under 4GB]\r
   //\r
   \r
   //   3.1 NV data\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
+  \r
   //   3.2 Stack\r
   StackTop = NvStorageBase;\r
   StackBottom = PrepareHobStack (StackTop);\r
@@ -203,6 +221,7 @@ Returns:
   //\r
   // 4. Register the memory occupied by DxeCore and DxeIpl together as DxeCore\r
   //\r
+  PrintString("Prepare DxeCore memory Hob ...\n");\r
   PrepareHobDxeCore (\r
     Handoff->DxeCoreEntryPoint,\r
     (EFI_PHYSICAL_ADDRESS)(UINTN)Handoff->DxeCoreImageBase,\r
@@ -210,6 +229,7 @@ Returns:
     );\r
 \r
   PrepareHobLegacyTable (gHob);\r
+  \r
   PreparePpisNeededByDxeCore (gHob);\r
 \r
   CompleteHobGeneration ();\r
@@ -292,12 +312,14 @@ Returns:
   PrintString("\n");   \r
   EFI_DEADLOOP();\r
 */\r
+  WaitForKey ();\r
   ClearScreen();\r
   PrintString("\n\n\n\n\n\n\n\n\n\n");\r
   PrintString("                         WELCOME TO EFI WORLD!\n");\r
-\r
+  \r
   EnterDxeMain (StackTop, Handoff->DxeCoreEntryPoint, gHob, PageTableBase);\r
-\r
+  \r
+  PrintString("Fail to enter DXE main!\n");\r
   //\r
   // Should never get here\r
   //\r
index 1df9945d4edbe60a654228ba3bfe4cc2e5c5f278..d3c5f31c4d7b219d8e01452c13f523aa541ef66c 100644 (file)
@@ -191,11 +191,13 @@ Returns:
   //\r
   // Wait for up to 0.1 seconds for the RTC to be updated\r
   //\r
-  Status = RtcWaitToUpdate (100000);\r
-  if (EFI_ERROR (Status)) {\r
-    EfiReleaseLock (&Global->RtcLock);\r
-    return EFI_DEVICE_ERROR;\r
-  }\r
+  // KEN: BUGBUG following wait action will cause failure under vmware environment.\r
+  //\r
+  //Status = RtcWaitToUpdate (100000);\r
+  //if (EFI_ERROR (Status)) {\r
+  //  EfiReleaseLock (&Global->RtcLock);\r
+  //  return EFI_DEVICE_ERROR;\r
+  //}\r
   //\r
   // Get the Time/Date/Daylight Savings values.\r
   //\r