From c5dfb4770b115c57563c07d1f4379f45c2904caf Mon Sep 17 00:00:00 2001 From: klu2 Date: Thu, 8 May 2008 06:22:31 +0000 Subject: Support X64 build for DUET platform. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5183 6f19259b-4bc3-4df7-8a09-765794883524 --- DuetPkg/BootSector/Makefile | 60 +++++++++++++++++++++++----------- DuetPkg/BootSector/efi64.asm | 4 +-- DuetPkg/DuetPkg.dsc | 4 +-- DuetPkg/DuetPkg.fdf | 17 ++++------ DuetPkg/EfiLdr/EfiLoader.c | 4 +-- DuetPkg/PostBuild.bat | 76 ++++++++++++++++++++++++++++++++++---------- 6 files changed, 112 insertions(+), 53 deletions(-) (limited to 'DuetPkg') diff --git a/DuetPkg/BootSector/Makefile b/DuetPkg/BootSector/Makefile index aaa8ac1daa..8133e7a278 100644 --- a/DuetPkg/BootSector/Makefile +++ b/DuetPkg/BootSector/Makefile @@ -22,7 +22,11 @@ TARGET_FILES = $(OUTPUT_DIR)\bootsect.com \ $(OUTPUT_DIR)\Start.com \ $(OUTPUT_DIR)\Start16.com \ $(OUTPUT_DIR)\Start32.com \ - $(OUTPUT_DIR)\efi32.com2 + $(OUTPUT_DIR)\Start64.com \ + $(OUTPUT_DIR)\St16_64.com \ + $(OUTPUT_DIR)\St32_64.com \ + $(OUTPUT_DIR)\efi32.com2 \ + $(OUTPUT_DIR)\efi64.com2 INC = @@ -100,6 +104,30 @@ $(OUTPUT_DIR)\Start32.com:$(OUTPUT_DIR)\Start32.obj #============= +$(OUTPUT_DIR)\Start64.obj:$(MODULE_DIR)\Start64.asm + "$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\Start64.obj" "$(MODULE_DIR)\Start64.asm" + +$(OUTPUT_DIR)\Start64.com:$(OUTPUT_DIR)\Start64.obj + "$(ASMLINK16)" /tiny $(OUTPUT_DIR)\Start64.obj,$(OUTPUT_DIR)\Start64.com,$(OUTPUT_DIR)\Start64.map,,, + +#============= + +$(OUTPUT_DIR)\St16_64.obj:$(MODULE_DIR)\St16_64.asm + "$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\St16_64.obj" "$(MODULE_DIR)\St16_64.asm" + +$(OUTPUT_DIR)\St16_64.com:$(OUTPUT_DIR)\St16_64.obj + "$(ASMLINK16)" /tiny $(OUTPUT_DIR)\St16_64.obj,$(OUTPUT_DIR)\St16_64.com,$(OUTPUT_DIR)\St16_64.map,,, + +#============= + +$(OUTPUT_DIR)\St32_64.obj:$(MODULE_DIR)\St32_64.asm + "$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\St32_64.obj" "$(MODULE_DIR)\St32_64.asm" + +$(OUTPUT_DIR)\St32_64.com:$(OUTPUT_DIR)\St32_64.obj + "$(ASMLINK16)" /tiny $(OUTPUT_DIR)\St32_64.obj,$(OUTPUT_DIR)\St32_64.com,$(OUTPUT_DIR)\St32_64.map,,, + +#============= + $(OUTPUT_DIR)\efi32.obj:$(MODULE_DIR)\efi32.asm "$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\efi32.obj" "$(MODULE_DIR)\efi32.asm" @@ -110,26 +138,20 @@ $(OUTPUT_DIR)\efi32.com:$(OUTPUT_DIR)\efi32.obj $(OUTPUT_DIR)\efi32.com2:$(OUTPUT_DIR)\efi32.com $(BASETOOLS_DIR)\Split.exe -f $(OUTPUT_DIR)\efi32.com -t $(OUTPUT_DIR)\efi32.com2 -s 135168 -# -# clean all generated files -# -loader:$(BUILD_DIR)\FV\Efildr +#============= + +$(OUTPUT_DIR)\efi64.obj:$(MODULE_DIR)\efi64.asm + "$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\efi64.obj" "$(MODULE_DIR)\efi64.asm" + +$(OUTPUT_DIR)\efi64.com:$(OUTPUT_DIR)\efi64.obj + "$(ASMLINK16)" /tiny $(OUTPUT_DIR)\efi64.obj,$(OUTPUT_DIR)\efi64.com,$(OUTPUT_DIR)\efi64.map,,, + +#============= + +$(OUTPUT_DIR)\efi64.com2:$(OUTPUT_DIR)\efi64.com + $(BASETOOLS_DIR)\Split.exe -f $(OUTPUT_DIR)\efi64.com -t $(OUTPUT_DIR)\efi64.com2 -s 135168 -$(BUILD_DIR)\FV\DUETEFIMAINFV.z:$(BUILD_DIR)\FV\DUETEFIMAINFV.Fv - $(BASETOOLS_DIR)\TianoCompress -e -o $(BUILD_DIR)\FV\DUETEFIMAINFV.z $(BUILD_DIR)\FV\DUETEFIMAINFV.Fv - -$(BUILD_DIR)\FV\DxeMain.z:$(BUILD_DIR)\IA32\DxeMain.efi - $(BASETOOLS_DIR)\TianoCompress -e -o $(BUILD_DIR)\FV\DxeMain.z $(BUILD_DIR)\IA32\DxeMain.efi - -$(BUILD_DIR)\FV\DxeIpl.z:$(BUILD_DIR)\IA32\DxeIpl.efi - $(BASETOOLS_DIR)\TianoCompress -e -o $(BUILD_DIR)\FV\DxeIpl.z $(BUILD_DIR)\IA32\DxeIpl.efi - -$(BUILD_DIR)\FV\Efildr32:$(BUILD_DIR)\IA32\EfiLoader.efi $(BUILD_DIR)\FV\DxeIpl.z $(BUILD_DIR)\FV\DUETEFIMAINFV.z - $(BASETOOLS_DIR)\EfiLdrImage.exe -o $(BUILD_DIR)\FV\Efildr32 $(BUILD_DIR)\IA32\EfiLoader.efi $(BUILD_DIR)\FV\DxeIpl.z $(BUILD_DIR)\FV\DxeMain.z $(BUILD_DIR)\FV\DUETEFIMAINFV.z - -$(BUILD_DIR)\FV\Efildr:$(OUTPUT_DIR)\Start.com $(OUTPUT_DIR)\Efi32.com2 $(BUILD_DIR)\FV\Efildr32 - copy /b $(OUTPUT_DIR)\Start.com+$(OUTPUT_DIR)\Efi32.com2+$(BUILD_DIR)\FV\Efildr32 $(BUILD_DIR)\FV\Efildr clean: if exist $(DEBUG_DIR) rmdir /s /q $(DEBUG_DIR) diff --git a/DuetPkg/BootSector/efi64.asm b/DuetPkg/BootSector/efi64.asm index bbf8fee35a..7960385bd1 100644 --- a/DuetPkg/BootSector/efi64.asm +++ b/DuetPkg/BootSector/efi64.asm @@ -597,7 +597,7 @@ InnerLoop1: - wbinvd + ;wbinvd @@: jmp @b @@ -690,7 +690,7 @@ looptop: mov byte ptr [edi], bl add edi, 2 loop looptop - wbinvd + ;wbinvd pop eax pop ebx diff --git a/DuetPkg/DuetPkg.dsc b/DuetPkg/DuetPkg.dsc index 851a84295b..5fcf5ddf8c 100644 --- a/DuetPkg/DuetPkg.dsc +++ b/DuetPkg/DuetPkg.dsc @@ -159,7 +159,6 @@ MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf # ISA Support DuetPkg/IsaAcpiDxe/IsaAcpi.inf @@ -177,4 +176,5 @@ [BuildOptions.common] MSFT:*_*_*_CC_FLAGS = /Fa$* /FAsc /FR$(@R).SBR MSFT:*_*_IA32_CC_FLAGS = /D EFI32 - MSFT:*_*_X64_CC_FLAGS = /D EFI64 \ No newline at end of file + MSFT:*_*_X64_CC_FLAGS = /D EFIX64 + MSFT:*_*_IPF_CC_FLAGS = /D EFI64 \ No newline at end of file diff --git a/DuetPkg/DuetPkg.fdf b/DuetPkg/DuetPkg.fdf index 9a4b3aa985..9072d98237 100644 --- a/DuetPkg/DuetPkg.fdf +++ b/DuetPkg/DuetPkg.fdf @@ -108,25 +108,20 @@ INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf -INF MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf # ISA Support INF DuetPkg/IsaAcpiDxe/IsaAcpi.inf INF IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBusDxe.inf INF IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe/IsaSerialDxe.inf -INF IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf +#INF IntelFrameworkModulePkg/Bus/Isa/Ps2KeyboardDxe/Ps2keyboardDxe.inf INF IntelFrameworkModulePkg/Bus/Isa/IsaFloppyDxe/IsaFloppyDxe.inf -INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf -INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf -INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf +#INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf +#INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf +#INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf -FILE DRIVER = 961578FE-B6B7-44c3-AF35-6BC705CD2B1F { - SECTION PE32 = FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi - } - -#FILE APPLICATION = c57ad6b7-0515-40a8-9d21-551652854e37 { -# SECTION PE32 = EdkShellBinPkg/FullShell/ia32/Shell_Full.efi +#FILE DRIVER = 961578FE-B6B7-44c3-AF35-6BC705CD2B1F { +# SECTION PE32 = FatBinPkg/EnhancedFatDxe/Ia32/Fat.efi # } [Rule.Common.PEI_CORE] diff --git a/DuetPkg/EfiLdr/EfiLoader.c b/DuetPkg/EfiLdr/EfiLoader.c index d55dfdb791..b3f8d8cc3e 100644 --- a/DuetPkg/EfiLdr/EfiLoader.c +++ b/DuetPkg/EfiLdr/EfiLoader.c @@ -93,7 +93,7 @@ EfiLoader ( // Decompress the image // - AsciiSPrint (PrintBuffer, 256, "Decompress BFV image, Image Address=0x%x! Offset=0x%x\n", + AsciiSPrint (PrintBuffer, 256, "Decompress BFV image, Image Address=0x%x Offset=0x%x\n", (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Offset); PrintString (PrintBuffer); @@ -145,7 +145,7 @@ EfiLoader ( // // Decompress the image // - AsciiSPrint (PrintBuffer, 256, "Decompress DxeIpl image, Image Address=0x%x! Offset=0x%x\n", + AsciiSPrint (PrintBuffer, 256, "Decompress DxeIpl image, Image Address=0x%x Offset=0x%x\n", (UINTN)(EFILDR_HEADER_ADDRESS + EFILDRImage->Offset), EFILDRImage->Offset); PrintString (PrintBuffer); diff --git a/DuetPkg/PostBuild.bat b/DuetPkg/PostBuild.bat index 2efd099b15..88ccbdcc17 100644 --- a/DuetPkg/PostBuild.bat +++ b/DuetPkg/PostBuild.bat @@ -1,18 +1,60 @@ -# -# Currently, Build system does not provide post build mechanism for module -# and platform building, so just use a bat file to do post build commands. -# Originally, following post building command is for EfiLoader module. -# - -set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS -set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32 -set OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT - -%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv -%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\IA32\DxeMain.efi -%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\IA32\DxeIpl.efi -%BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\IA32\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z -copy /b %OUTPUT_DIR%\Start.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr -copy /b %OUTPUT_DIR%\Start16.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16 -copy /b %OUTPUT_DIR%\Start32.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20 +@REM +@REM Currently, Build system does not provide post build mechanism for module +@REM and platform building, so just use a bat file to do post build commands. +@REM Originally, following post building command is for EfiLoader module. +@REM +@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS +@REM @set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32 +@set BASETOOLS_DIR=m:\tree\BaseTools\Bin\Win32 +@set PROCESSOR="" + +@if "%1"=="" goto NoArch +@if "%1"=="IA32" set PROCESSOR=IA32 +@if "%1"=="X64" set PROCESSOR=X64 +@if %PROCESSOR%=="" goto WrongArch + +@set OUTPUT_DIR=%BUILD_DIR%\%PROCESSOR%\DuetPkg\BootSector\BootSector\OUTPUT + +@echo Compressing DUETEFIMainFv.FV ... +@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DUETEFIMAINFV.z %BUILD_DIR%\FV\DUETEFIMAINFV.Fv + +@echo Compressing DxeMain.efi ... +@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\%PROCESSOR%\DxeMain.efi + +@echo Compressing DxeIpl.efi ... +@%BASETOOLS_DIR%\TianoCompress -e -o %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\%PROCESSOR%\DxeIpl.efi + +@echo Generate Loader Image ... +@if "%PROCESSOR%"=="IA32" goto GENERATE_IMAGE_IA32 +@if "%PROCESSOR%"=="X64" goto GENERATE_IMAGE_X64 + +:GENERATE_IMAGE_IA32 +@%BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z +@copy /b %OUTPUT_DIR%\Start.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr +@copy /b %OUTPUT_DIR%\Start16.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr16 +@copy /b %OUTPUT_DIR%\Start32.com+%OUTPUT_DIR%\Efi32.com2+%BUILD_DIR%\FV\Efildr32 %BUILD_DIR%\FV\Efildr20 +@goto end + +:GENERATE_IMAGE_X64 +@%BASETOOLS_DIR%\EfiLdrImage.exe -o %BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\%PROCESSOR%\EfiLoader.efi %BUILD_DIR%\FV\DxeIpl.z %BUILD_DIR%\FV\DxeMain.z %BUILD_DIR%\FV\DUETEFIMAINFV.z +@copy /b %OUTPUT_DIR%\Start64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\EfildrPure +@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\EfildrPure -o %BUILD_DIR%\FV\Efildr +@copy /b %OUTPUT_DIR%\St16_64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr16Pure +@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr16Pure -o %BUILD_DIR%\FV\Efildr16 +@copy /b %OUTPUT_DIR%\St32_64.com+%OUTPUT_DIR%\Efi64.com2+%BUILD_DIR%\FV\Efildr64 %BUILD_DIR%\FV\Efildr20Pure +@%BASETOOLS_DIR%\GenPage.exe %BUILD_DIR%\FV\Efildr20Pure -o %BUILD_DIR%\FV\Efildr20 +@goto end + + +:NoArch +@echo Error! Please specific the architecture. +@goto Help + +:WrongArch +@echo Error! Wrong architecture. +@goto Help + +:Help +@echo Usage: "PostBuild [IA32|X64]" +:end \ No newline at end of file -- cgit v1.2.3