diff options
Diffstat (limited to 'DuetPkg')
-rw-r--r-- | DuetPkg/CreateBootDisk.bat | 92 | ||||
-rw-r--r-- | DuetPkg/DuetPkg.dsc | 5 | ||||
-rw-r--r-- | DuetPkg/PostBuild.bat | 3 |
3 files changed, 99 insertions, 1 deletions
diff --git a/DuetPkg/CreateBootDisk.bat b/DuetPkg/CreateBootDisk.bat new file mode 100644 index 0000000..8bed045 --- /dev/null +++ b/DuetPkg/CreateBootDisk.bat @@ -0,0 +1,92 @@ +@REM
+
+@REM Set up environment at fisrt.
+
+@REM set BASETOOLS_DIR=%WORKSPACE_TOOLS_PATH%\Bin\Win32
+@set BASETOOLS_DIR=m:\tree\BaseTools\Bin\Win32
+@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
+@set DISK_LABEL=DUET
+@echo on
+
+
+@if "%1"=="" goto Help
+@if "%2"=="" goto Help
+@if "%3"=="" goto Help
+@set EFI_BOOT_DISK=%2
+@if "%1"=="floppy" goto CreateFloppy
+@if "%1"=="usb" goto CreateUsb
+@if "%1"=="ide" goto CreateIde
+goto Help
+
+:CreateFloppy
+@if NOT "%3"=="FAT12" goto WrongFATType
+@echo Start to create floppy boot disk ...
+@echo Format %EFI_BOOT_DISK% ...
+@echo.> FormatCommandInput.txt
+@echo.n>> FormatCommandInput.txt
+@format /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
+@del FormatCommandInput.txt
+@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.
+copy %BUILD_DIR%\FV\EfiLdr %EFI_BOOT_DISK%
+mkdir %EFI_BOOT_DISK%\efi\boot
+copy %WORKSPACE%\EdkShellBinPkg\bin\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y
+@goto end
+
+:CreateUsb
+@echo Start to create usb boot disk ...
+@if "%3"=="FAT16" goto CreateUsb_FAT16
+@if "%3"=="FAT32" goto CreateUsb_FAT32
+@if "%3"=="FAT12" goto WrongFATType
+
+:CreateUsb_FAT16
+@echo Format %EFI_BOOT_DISK% ...
+@echo.> FormatCommandInput.txt
+@format /FS:FAT /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
+@del FormatCommandInput.txt
+@echo Create boot sector ...
+@%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
+@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 -m -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
+@copy %BUILD_DIR%\FV\EfiLdr16 %EFI_BOOT_DISK%
+@mkdir %EFI_BOOT_DISK%\efi\boot
+@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
+
+:CreateUsb_FAT32
+@echo Format %EFI_BOOT_DISK% ...
+@echo.> FormatCommandInput.txt
+@format /FS:FAT32 /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
+@del FormatCommandInput.txt
+@echo Create boot sector ...
+@%BASETOOLS_DIR%\Genbootsector.exe -i %EFI_BOOT_DISK% -o UsbBs32.com
+@%BASETOOLS_DIR%\Bootsectimage.exe -g UsbBs32.com %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs32.com -f
+@del UsbBs32.com
+@%BASETOOLS_DIR%\Genbootsector.exe -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Bs32.com
+@%BASETOOLS_DIR%\Genbootsector.exe -m -o %EFI_BOOT_DISK% -i %BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT\Mbr.com
+@copy %BUILD_DIR%\FV\EfiLdr20 %EFI_BOOT_DISK%
+@mkdir %EFI_BOOT_DISK%\efi\boot
+@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
+
+:CreateIde
+@goto end
+
+:WrongFATType
+@echo Wrong FAT type %3 for %1
+@goto end
+
+:Help
+@echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32]"
+:end
+@echo on
\ No newline at end of file diff --git a/DuetPkg/DuetPkg.dsc b/DuetPkg/DuetPkg.dsc index 5a66408..2a56d3a 100644 --- a/DuetPkg/DuetPkg.dsc +++ b/DuetPkg/DuetPkg.dsc @@ -130,7 +130,10 @@ DuetPkg/DataHubGenDxe/DataHubGen.inf
#DuetPkg/FvbRuntimeService/DUETFwh.inf
- DuetPkg/EfiLdr/EfiLdr.inf
+ DuetPkg/EfiLdr/EfiLdr.inf {
+ <LibraryClasses>
+ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
+ }
MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
DuetPkg/CpuIoDxe/CpuIo.inf
DuetPkg/CpuDxe/Cpu.inf
diff --git a/DuetPkg/PostBuild.bat b/DuetPkg/PostBuild.bat index 52cf07a..2efd099 100644 --- a/DuetPkg/PostBuild.bat +++ b/DuetPkg/PostBuild.bat @@ -13,3 +13,6 @@ set OUTPUT_DIR=%BUILD_DIR%\IA32\DuetPkg\BootSector\BootSector\OUTPUT %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
+
|