mirror of https://github.com/acidanthera/audk.git
1, Enable USB boot for R9's Duet.
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
This commit is contained in:
parent
cf0206ee8b
commit
e25803f0f0
|
@ -3,7 +3,7 @@
|
||||||
@REM Set up environment at fisrt.
|
@REM Set up environment at fisrt.
|
||||||
|
|
||||||
@REM set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
|
@REM set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
|
||||||
@set BASETOOLS_DIR=m:\tree\BaseTools\Bin\Win32
|
@set BASETOOLS_DIR=n:\BaseTools\Bin\Win32
|
||||||
@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
|
@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
|
||||||
@set DISK_LABEL=DUET
|
@set DISK_LABEL=DUET
|
||||||
@echo on
|
@echo on
|
||||||
|
@ -14,6 +14,7 @@
|
||||||
@if "%3"=="" goto Help
|
@if "%3"=="" goto Help
|
||||||
@set EFI_BOOT_DISK=%2
|
@set EFI_BOOT_DISK=%2
|
||||||
@if "%1"=="floppy" goto CreateFloppy
|
@if "%1"=="floppy" goto CreateFloppy
|
||||||
|
@if "%1"=="file" goto CreateFile
|
||||||
@if "%1"=="usb" goto CreateUsb
|
@if "%1"=="usb" goto CreateUsb
|
||||||
@if "%1"=="ide" goto CreateIde
|
@if "%1"=="ide" goto CreateIde
|
||||||
goto Help
|
goto Help
|
||||||
|
@ -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
|
copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y
|
||||||
@goto end
|
@goto end
|
||||||
|
|
||||||
|
:CreateFile
|
||||||
|
@if NOT "%3"=="FAT12" goto WrongFATType
|
||||||
|
@echo Start to create file boot disk ...
|
||||||
|
@echo Create boot sector ...
|
||||||
|
%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o FDBs.com
|
||||||
|
%BASETOOLS_DIR%\Bootsectimage.exe -g FDBs.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com -f
|
||||||
|
@REM @del FDBS.com
|
||||||
|
%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bootsect.com
|
||||||
|
@echo Done.
|
||||||
|
@goto end
|
||||||
|
|
||||||
:CreateUsb
|
:CreateUsb
|
||||||
@echo Start to create usb boot disk ...
|
@echo Start to create usb boot disk ...
|
||||||
@if "%3"=="FAT16" goto CreateUsb_FAT16
|
@if "%3"=="FAT16" goto CreateUsb_FAT16
|
||||||
|
@ -44,6 +56,7 @@ copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\boot
|
||||||
@if "%3"=="FAT12" goto WrongFATType
|
@if "%3"=="FAT12" goto WrongFATType
|
||||||
|
|
||||||
:CreateUsb_FAT16
|
:CreateUsb_FAT16
|
||||||
|
@if "%4"=="step2" goto CreateUsb_FAT16_step2
|
||||||
@echo Format %EFI_BOOT_DISK% ...
|
@echo Format %EFI_BOOT_DISK% ...
|
||||||
@echo.> FormatCommandInput.txt
|
@echo.> FormatCommandInput.txt
|
||||||
@format /FS:FAT /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
|
@format /FS:FAT /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
|
||||||
|
@ -51,14 +64,16 @@ copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\boot
|
||||||
@echo Create boot sector ...
|
@echo Create boot sector ...
|
||||||
@%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs16.com
|
@%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs16.com
|
||||||
@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs16.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com -f
|
@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs16.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com -f
|
||||||
@del UsbBs16.com
|
|
||||||
@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com
|
@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs16.com
|
||||||
@%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
|
@%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
|
||||||
|
@echo Done.
|
||||||
|
@echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!
|
||||||
|
@goto end
|
||||||
|
|
||||||
|
:CreateUsb_FAT16_step2
|
||||||
@copy %BUILD_DIR%\FV\EfiLdr16 %EFI_BOOT_DISK%
|
@copy %BUILD_DIR%\FV\EfiLdr16 %EFI_BOOT_DISK%
|
||||||
@mkdir %EFI_BOOT_DISK%\efi\boot
|
@mkdir %EFI_BOOT_DISK%\efi\boot
|
||||||
@copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y
|
@copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y
|
||||||
@echo Done.
|
|
||||||
@echo PLEASE UNPLUG USB, THEN PLUG IT AGAIN!
|
|
||||||
@goto end
|
@goto end
|
||||||
|
|
||||||
:CreateUsb_FAT32
|
:CreateUsb_FAT32
|
||||||
|
|
|
@ -67,11 +67,12 @@
|
||||||
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
|
MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf
|
||||||
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
|
UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf
|
||||||
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
|
DebugLib|IntelFrameworkModulePkg/Library/PeiDxeDebugLibReportStatusCode/PeiDxeDebugLibReportStatusCode.inf
|
||||||
ReportStatusCodeLib|IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
|
ReportStatusCodeLib|DuetPkg/Library/DuetDxeReportStatusCodeLib/DuetDxeReportStatusCodeLib.inf
|
||||||
SerialPortLib|DuetPkg/Library/DuetSerialIoLib/DuetSerialIoLib.inf
|
SerialPortLib|DuetPkg/Library/DuetSerialIoLib/DuetSerialIoLib.inf
|
||||||
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
|
||||||
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf
|
||||||
|
|
||||||
|
|
||||||
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
[LibraryClasses.common.DXE_RUNTIME_DRIVER]
|
||||||
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
|
||||||
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf
|
||||||
|
|
|
@ -110,6 +110,19 @@ EnterDxeMain (
|
||||||
IN VOID *PageTable
|
IN VOID *PageTable
|
||||||
);
|
);
|
||||||
|
|
||||||
|
VOID
|
||||||
|
WaitForKey ()
|
||||||
|
{
|
||||||
|
PrintString("Press Enter to continue ...\n");
|
||||||
|
_asm {
|
||||||
|
mov al, 20h
|
||||||
|
out 64h, al
|
||||||
|
AGAIN: in al, 60h
|
||||||
|
cmp al, 1ch
|
||||||
|
jnz AGAIN
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
VOID
|
VOID
|
||||||
DxeInit (
|
DxeInit (
|
||||||
IN EFILDRHANDOFF *Handoff
|
IN EFILDRHANDOFF *Handoff
|
||||||
|
@ -139,6 +152,7 @@ Returns:
|
||||||
|
|
||||||
ClearScreen();
|
ClearScreen();
|
||||||
PrintString("Enter DxeIpl ...\n");
|
PrintString("Enter DxeIpl ...\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ClearScreen();
|
ClearScreen();
|
||||||
PrintString("handoff:\n");
|
PrintString("handoff:\n");
|
||||||
|
@ -166,16 +180,19 @@ Returns:
|
||||||
// * Don't report FV as physical memory
|
// * Don't report FV as physical memory
|
||||||
// * MemoryAllocation Hob should only cover physical memory
|
// * MemoryAllocation Hob should only cover physical memory
|
||||||
// * Use ResourceDescriptor Hob to report physical memory or Firmware Device and they shouldn't be overlapped
|
// * Use ResourceDescriptor Hob to report physical memory or Firmware Device and they shouldn't be overlapped
|
||||||
|
PrintString("Prepare Cpu HOB information ...\n");
|
||||||
PrepareHobCpu ();
|
PrepareHobCpu ();
|
||||||
|
|
||||||
//
|
//
|
||||||
// 1. BFV
|
// 1. BFV
|
||||||
//
|
//
|
||||||
|
PrintString("Prepare BFV HOB information ...\n");
|
||||||
PrepareHobBfv (Handoff->BfvBase, Handoff->BfvSize);
|
PrepareHobBfv (Handoff->BfvBase, Handoff->BfvSize);
|
||||||
|
|
||||||
//
|
//
|
||||||
// 2. Updates Memory information, and get the top free address under 4GB
|
// 2. Updates Memory information, and get the top free address under 4GB
|
||||||
//
|
//
|
||||||
|
PrintString("Prepare Memory HOB information ...\n");
|
||||||
MemoryTopOnDescriptor = PrepareHobMemory (Handoff->MemDescCount, Handoff->MemDesc);
|
MemoryTopOnDescriptor = PrepareHobMemory (Handoff->MemDescCount, Handoff->MemDesc);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -183,6 +200,7 @@ Returns:
|
||||||
//
|
//
|
||||||
|
|
||||||
// 3.1 NV data
|
// 3.1 NV data
|
||||||
|
PrintString("Prepare NV Storage information ...\n");
|
||||||
NvStorageBase = PrepareHobNvStorage (MemoryTopOnDescriptor);
|
NvStorageBase = PrepareHobNvStorage (MemoryTopOnDescriptor);
|
||||||
AsciiSPrint (PrintBuffer, 256, "NV Storage Base=0x%x\n", (UINTN)NvStorageBase);
|
AsciiSPrint (PrintBuffer, 256, "NV Storage Base=0x%x\n", (UINTN)NvStorageBase);
|
||||||
PrintString (PrintBuffer);
|
PrintString (PrintBuffer);
|
||||||
|
@ -203,6 +221,7 @@ Returns:
|
||||||
//
|
//
|
||||||
// 4. Register the memory occupied by DxeCore and DxeIpl together as DxeCore
|
// 4. Register the memory occupied by DxeCore and DxeIpl together as DxeCore
|
||||||
//
|
//
|
||||||
|
PrintString("Prepare DxeCore memory Hob ...\n");
|
||||||
PrepareHobDxeCore (
|
PrepareHobDxeCore (
|
||||||
Handoff->DxeCoreEntryPoint,
|
Handoff->DxeCoreEntryPoint,
|
||||||
(EFI_PHYSICAL_ADDRESS)(UINTN)Handoff->DxeCoreImageBase,
|
(EFI_PHYSICAL_ADDRESS)(UINTN)Handoff->DxeCoreImageBase,
|
||||||
|
@ -210,6 +229,7 @@ Returns:
|
||||||
);
|
);
|
||||||
|
|
||||||
PrepareHobLegacyTable (gHob);
|
PrepareHobLegacyTable (gHob);
|
||||||
|
|
||||||
PreparePpisNeededByDxeCore (gHob);
|
PreparePpisNeededByDxeCore (gHob);
|
||||||
|
|
||||||
CompleteHobGeneration ();
|
CompleteHobGeneration ();
|
||||||
|
@ -292,12 +312,14 @@ Returns:
|
||||||
PrintString("\n");
|
PrintString("\n");
|
||||||
EFI_DEADLOOP();
|
EFI_DEADLOOP();
|
||||||
*/
|
*/
|
||||||
|
WaitForKey ();
|
||||||
ClearScreen();
|
ClearScreen();
|
||||||
PrintString("\n\n\n\n\n\n\n\n\n\n");
|
PrintString("\n\n\n\n\n\n\n\n\n\n");
|
||||||
PrintString(" WELCOME TO EFI WORLD!\n");
|
PrintString(" WELCOME TO EFI WORLD!\n");
|
||||||
|
|
||||||
EnterDxeMain (StackTop, Handoff->DxeCoreEntryPoint, gHob, PageTableBase);
|
EnterDxeMain (StackTop, Handoff->DxeCoreEntryPoint, gHob, PageTableBase);
|
||||||
|
|
||||||
|
PrintString("Fail to enter DXE main!\n");
|
||||||
//
|
//
|
||||||
// Should never get here
|
// Should never get here
|
||||||
//
|
//
|
||||||
|
|
|
@ -191,11 +191,13 @@ Returns:
|
||||||
//
|
//
|
||||||
// Wait for up to 0.1 seconds for the RTC to be updated
|
// Wait for up to 0.1 seconds for the RTC to be updated
|
||||||
//
|
//
|
||||||
Status = RtcWaitToUpdate (100000);
|
// KEN: BUGBUG following wait action will cause failure under vmware environment.
|
||||||
if (EFI_ERROR (Status)) {
|
//
|
||||||
EfiReleaseLock (&Global->RtcLock);
|
//Status = RtcWaitToUpdate (100000);
|
||||||
return EFI_DEVICE_ERROR;
|
//if (EFI_ERROR (Status)) {
|
||||||
}
|
// EfiReleaseLock (&Global->RtcLock);
|
||||||
|
// return EFI_DEVICE_ERROR;
|
||||||
|
//}
|
||||||
//
|
//
|
||||||
// Get the Time/Date/Daylight Savings values.
|
// Get the Time/Date/Daylight Savings values.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue