Support X64 build for DUET platform.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5183 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
klu2 2008-05-08 06:22:31 +00:00
parent a8d0c20e7a
commit c5dfb4770b
6 changed files with 110 additions and 51 deletions

View File

@ -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
#=============
$(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
$(OUTPUT_DIR)\efi64.obj:$(MODULE_DIR)\efi64.asm
"$(ASM16)" /c /omf /Fo"$(OUTPUT_DIR)\efi64.obj" "$(MODULE_DIR)\efi64.asm"
$(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
$(OUTPUT_DIR)\efi64.com:$(OUTPUT_DIR)\efi64.obj
"$(ASMLINK16)" /tiny $(OUTPUT_DIR)\efi64.obj,$(OUTPUT_DIR)\efi64.com,$(OUTPUT_DIR)\efi64.map,,,
$(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
$(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\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)

View File

@ -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

View File

@ -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
MSFT:*_*_X64_CC_FLAGS = /D EFIX64
MSFT:*_*_IPF_CC_FLAGS = /D EFI64

View File

@ -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]

View File

@ -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);

View File

@ -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.
#
@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
set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
set OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT
@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=""
%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
@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