1. update bat file to generate right bootia32.efi/bootx64.efi file according to command line parameters.

2. fix a print error in which a %x in format string exists but the corresponding variable argument is not present!
3. fix CONSUME_MEMORY too small issue. In X64 arch, cpu may cause the paging table is too big and beyond the pei memory scope between EfiMemoryTop and EfimemoryBottom. for example, a cpu support 44bits addressing memory space may occupied ~64M paging table.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9794 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
eric_tian 2010-01-19 08:28:28 +00:00
parent 1ccdbf2a3e
commit e843cdd7d9
5 changed files with 83 additions and 26 deletions

View File

@ -6,17 +6,23 @@
@set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS
@set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin @set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin
@set DISK_LABEL=DUET @set DISK_LABEL=DUET
@echo on @set PROCESSOR=""
@echo on
@if "%1"=="" goto Help @if "%1"=="" goto Help
@if "%2"=="" goto Help @if "%2"=="" goto Help
@if "%3"=="" goto Help @if "%3"=="" goto Help
@if "%4"=="" goto NoArch
@set EFI_BOOT_DISK=%2 @set EFI_BOOT_DISK=%2
@if "%4"=="IA32" set PROCESSOR=IA32
@if "%4"=="X64" set PROCESSOR=X64
@if %PROCESSOR%=="" goto WrongArch
@if "%1"=="floppy" goto CreateFloppy @if "%1"=="floppy" goto CreateFloppy
@if "%1"=="file" goto CreateFile @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
:CreateFloppy :CreateFloppy
@ -35,7 +41,8 @@ goto Help
@echo Done. @echo Done.
copy %BUILD_DIR%\FV\EfiLdr %EFI_BOOT_DISK% copy %BUILD_DIR%\FV\EfiLdr %EFI_BOOT_DISK%
mkdir %EFI_BOOT_DISK%\efi\boot mkdir %EFI_BOOT_DISK%\efi\boot
copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y @if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32
@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64
@goto end @goto end
:CreateFile :CreateFile
@ -56,7 +63,7 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\
@if "%3"=="FAT12" goto WrongFATType @if "%3"=="FAT12" goto WrongFATType
:CreateUsb_FAT16 :CreateUsb_FAT16
@if "%4"=="step2" goto CreateUsb_FAT16_step2 @if "%5"=="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
@ -73,11 +80,12 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\
:CreateUsb_FAT16_step2 :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\MinimumShell\Ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y @if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32
@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64
@goto end @goto end
:CreateUsb_FAT32 :CreateUsb_FAT32
@if "%4"=="step2" goto CreateUsb_FAT32_step2 @if "%5"=="step2" goto CreateUsb_FAT32_step2
@echo Format %EFI_BOOT_DISK% ... @echo Format %EFI_BOOT_DISK% ...
@echo.> FormatCommandInput.txt @echo.> FormatCommandInput.txt
@format /FS:FAT32 /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL @format /FS:FAT32 /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL
@ -95,17 +103,34 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\Ia32\Shell.efi %EFI_BOOT_DISK%\efi\
:CreateUsb_FAT32_step2 :CreateUsb_FAT32_step2
@copy %BUILD_DIR%\FV\EfiLdr20 %EFI_BOOT_DISK% @copy %BUILD_DIR%\FV\EfiLdr20 %EFI_BOOT_DISK%
@mkdir %EFI_BOOT_DISK%\efi\boot @mkdir %EFI_BOOT_DISK%\efi\boot
@copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y @if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32
@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64
@goto end @goto end
:CreateIde :CreateIde
@goto end @goto end
:CreateBootFileForIA32
copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\IA32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y
@goto end
:CreateBootFileForX64
copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\X64\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootx64.efi /y
@goto end
:WrongFATType :WrongFATType
@echo Wrong FAT type %3 for %1 @echo Wrong FAT type %3 for %1
@goto end @goto end
:NoArch
@echo Error! Please specific the architecture.
@goto Help
:WrongArch
@echo Error! Wrong architecture.
@goto Help
:Help :Help
@echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32]" @echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32] [IA32|X64]"
:end :end
@echo on @echo on

View File

@ -14,8 +14,8 @@ if [ \
"$*" = "--help" \ "$*" = "--help" \
] ]
then then
echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32]" echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32] [IA32|X64]"
echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 " echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 IA32"
PROCESS_MARK=FALSE PROCESS_MARK=FALSE
fi fi
@ -44,9 +44,17 @@ then
mkdir -p $EFI_BOOT_MEDIA/efi mkdir -p $EFI_BOOT_MEDIA/efi
mkdir -p $EFI_BOOT_MEDIA/efi/boot mkdir -p $EFI_BOOT_MEDIA/efi/boot
if [ "$5" = IA32 ]
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi
else
if [ "$5" = X64 ]
then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi
else
echo Wrong Arch!
fi
fi
echo Done. echo Done.
else else
echo "Wrong FAT type $4 for floppy!" echo "Wrong FAT type $4 for floppy!"
@ -73,11 +81,21 @@ then
if [ "$4" = FAT16 ] if [ "$4" = FAT16 ]
then then
if [ "$5" = step2 ] if [ "$6" = step2 ]
then then
cp $BUILD_DIR/FV/Efildr16 $EFI_BOOT_MEDIA cp $BUILD_DIR/FV/Efildr16 $EFI_BOOT_MEDIA
mkdir $EFI_BOOT_MEDIA/efi/boot mkdir $EFI_BOOT_MEDIA/efi/boot
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi if [ "$5" = IA32 ]
then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi
else
if [ "$5" = X64 ]
then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi
else
echo Wrong Arch!
fi
fi
echo "step2 Done!" echo "step2 Done!"
else else
echo Format $EFI_BOOT_DEVICE ... echo Format $EFI_BOOT_DEVICE ...
@ -93,11 +111,21 @@ then
fi fi
elif [ "$4" = FAT32 ] elif [ "$4" = FAT32 ]
then then
if [ "$5" = step2 ] if [ "$6" = step2 ]
then then
cp $BUILD_DIR/FV/Efildr20 $EFI_BOOT_MEDIA cp $BUILD_DIR/FV/Efildr20 $EFI_BOOT_MEDIA
mkdir $EFI_BOOT_MEDIA/efi/boot mkdir $EFI_BOOT_MEDIA/efi/boot
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi if [ "$5" = IA32 ]
then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/Ia32/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootia32.efi
else
if [ "$5" = X64 ]
then
cp $WORKSPACE/EdkShellBinPkg/MinimumShell/X64/Shell.efi $EFI_BOOT_MEDIA/efi/boot/bootx64.efi
else
echo Wrong Arch!
fi
fi
echo "step2 Done!" echo "step2 Done!"
else else
echo Format $EFI_BOOT_DEVICE ... echo Format $EFI_BOOT_DEVICE ...

View File

@ -26,7 +26,7 @@ Revision History:
#define EFI_MEMORY_BELOW_1MB_START 0x86000 #define EFI_MEMORY_BELOW_1MB_START 0x86000
#define EFI_MEMORY_BELOW_1MB_END 0x9F800 #define EFI_MEMORY_BELOW_1MB_END 0x9F800
#define EFI_MEMORY_STACK_PAGE_NUM 0x20 #define EFI_MEMORY_STACK_PAGE_NUM 0x20
#define CONSUMED_MEMORY 0x2000000 #define CONSUMED_MEMORY 0x100000 * 80
#define NV_STORAGE_START 0x15000 #define NV_STORAGE_START 0x15000
#define NV_STORAGE_STATE 0x19000 #define NV_STORAGE_STATE 0x19000

View File

@ -56,7 +56,7 @@ EfiLoader (
PrintHeader ('A'); PrintHeader ('A');
AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader ...\n", BiosMemoryMapBaseAddress); AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader...\n");
PrintString (PrintBuffer); PrintString (PrintBuffer);
AsciiSPrint (PrintBuffer, 256, "BiosMemoryMapBaseAddress = 0x%x\n", BiosMemoryMapBaseAddress); AsciiSPrint (PrintBuffer, 256, "BiosMemoryMapBaseAddress = 0x%x\n", BiosMemoryMapBaseAddress);

View File

@ -36,17 +36,21 @@ Create bootable disk
3.1 Create floppy boot disk 3.1 Create floppy boot disk
1). enter <Workspace>\DuetPkg directory. 1). enter <Workspace>\DuetPkg directory.
2). Insert a floppy disk to drive 2). Insert a floppy disk to drive
3). run "CreateBootDisk.bat floppy a: FAT12" if floppy drive is a: disk. 3). run "CreateBootDisk.bat floppy a: FAT12 IA32" if floppy drive is a: disk and Arch to boot is IA32.
or
run "CreateBootDisk.bat floppy a: FAT12 X64" if floppy drive is a: disk and Arch to boot is X64.
3.2 Create usb boot disk 3.2 Create usb boot disk
1). enter <Workspace>\DuetPkg directory. 1). enter <Workspace>\DuetPkg directory.
2). Plugin usb disk 2). Plugin usb disk
3). run "CreateBootDisk.bat usb e: FAT16" if usb drive is e: and FAT format is FAT16 or 3). run "CreateBootDisk.bat usb e: FAT16 IA32" if usb drive is e: and FAT format is FAT16 and Arch to boot is IA32.
"CreateBootDisk.bat usb e: FAT32" if usb drive is e: and FAT format is FAT32 or "CreateBootDisk.bat usb e: FAT16 X64" if usb drive is e: and FAT format is FAT16 and Arch to boot is X64.
or "CreateBootDisk.bat usb e: FAT32 IA32" if usb drive is e: and FAT format is FAT32 and Arch to boot is IA32.
or "CreateBootDisk.bat usb e: FAT32 X64" if usb drive is e: and FAT format is FAT32 and Arch to boot is X64.
4). UnPlug usb disk and plugin it again. 4). UnPlug usb disk and plugin it again.
5). run "CreateBootDisk.bat usb e: FAT16 step2" if usb drive is e: and FAT format is FAT16 or 5). run "CreateBootDisk.bat usb e: FAT16 IA32 step2" if usb drive is e: and FAT format is FAT16 and Arch to boot is IA32.
"CreateBootDisk.bat usb e: FAT32 step2" if usb drive is e: and FAT format is FAT32. or "CreateBootDisk.bat usb e: FAT16 X64 step2" if usb drive is e: and FAT format is FAT16 and Arch to boot is X64.
or "CreateBootDisk.bat usb e: FAT32 IA32 step2" if usb drive is e: and FAT format is FAT32 and Arch to boot is IA32.
or "CreateBootDisk.bat usb e: FAT32 X64 step2" if usb drive is e: and FAT format is FAT32 and Arch to boot is X64.
B. Build DUET image on Linux Platform B. Build DUET image on Linux Platform
====================================== ======================================
@ -98,4 +102,4 @@ B. Build DUET image on Linux Platform
1). enter /R9_tree/DuetPkg directory. 1). enter /R9_tree/DuetPkg directory.
2). Insert a floppy disk to drive 2). Insert a floppy disk to drive
3). run "CreateBootDisk.sh" to build floppy drive 3). run "CreateBootDisk.sh" to build floppy drive
such as "./CreateBootDisk.sh floppy /media/floppy0 /dev/fd0 FAT12" such as "./CreateBootDisk.sh floppy /media/floppy0 /dev/fd0 FAT12 IA32"