@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
@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
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
@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
@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
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
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
\r
ClearScreen();\r
PrintString("Enter DxeIpl ...\n");\r
+ \r
/*\r
ClearScreen();\r
PrintString("handoff:\n");\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
- \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
//\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
);\r
\r
PrepareHobLegacyTable (gHob);\r
+ \r
PreparePpisNeededByDxeCore (gHob);\r
\r
CompleteHobGeneration ();\r
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
//\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