]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. update bat file to generate right bootia32.efi/bootx64.efi file according to comma...
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jan 2010 08:28:28 +0000 (08:28 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 19 Jan 2010 08:28:28 +0000 (08:28 +0000)
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

DuetPkg/CreateBootDisk.bat
DuetPkg/CreateBootDisk.sh
DuetPkg/DxeIpl/HobGeneration.h
DuetPkg/EfiLdr/EfiLoader.c
DuetPkg/ReadMe.txt

index 2272a11dcab957111815a507d3b5a4545501ef45..e4e1369cd448c08585ddb623c5c411355fe25471 100644 (file)
@@ -6,17 +6,23 @@
 @set BUILD_DIR=%WORKSPACE%\Build\DuetPkg\DEBUG_MYTOOLS\r
 @set BOOTSECTOR_BIN_DIR=%WORKSPACE%\DuetPkg\BootSector\bin\r
 @set DISK_LABEL=DUET\r
-@echo on\r
+@set PROCESSOR=""\r
 \r
+@echo on\r
 \r
 @if "%1"=="" goto Help\r
 @if "%2"=="" goto Help\r
 @if "%3"=="" goto Help\r
+@if "%4"=="" goto NoArch\r
 @set EFI_BOOT_DISK=%2\r
+@if "%4"=="IA32" set PROCESSOR=IA32\r
+@if "%4"=="X64" set PROCESSOR=X64\r
+@if %PROCESSOR%=="" goto WrongArch\r
 @if "%1"=="floppy" goto CreateFloppy\r
 @if "%1"=="file" goto CreateFile\r
 @if "%1"=="usb" goto CreateUsb\r
 @if "%1"=="ide" goto CreateIde\r
+\r
 goto Help\r
 \r
 :CreateFloppy\r
@@ -35,7 +41,8 @@ goto Help
 @echo Done.\r
 copy %BUILD_DIR%\FV\EfiLdr %EFI_BOOT_DISK%\r
 mkdir %EFI_BOOT_DISK%\efi\boot\r
-copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
+@if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32\r
+@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64\r
 @goto end\r
 \r
 :CreateFile\r
@@ -56,7 +63,7 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\
 @if "%3"=="FAT12" goto WrongFATType\r
 \r
 :CreateUsb_FAT16\r
-@if "%4"=="step2" goto CreateUsb_FAT16_step2\r
+@if "%5"=="step2" goto CreateUsb_FAT16_step2\r
 @echo Format %EFI_BOOT_DISK% ...\r
 @echo.> FormatCommandInput.txt\r
 @format /FS:FAT /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL\r
@@ -73,11 +80,12 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\
 :CreateUsb_FAT16_step2\r
 @copy %BUILD_DIR%\FV\EfiLdr16 %EFI_BOOT_DISK%\r
 @mkdir %EFI_BOOT_DISK%\efi\boot\r
-copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\Ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
+@if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32\r
+@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64\r
 @goto end\r
 \r
 :CreateUsb_FAT32\r
-@if "%4"=="step2" goto CreateUsb_FAT32_step2\r
+@if "%5"=="step2" goto CreateUsb_FAT32_step2\r
 @echo Format %EFI_BOOT_DISK% ...\r
 @echo.> FormatCommandInput.txt\r
 @format /FS:FAT32 /v:%DISK_LABEL% /q %EFI_BOOT_DISK% < FormatCommandInput.txt > NUL\r
@@ -95,17 +103,34 @@ copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\Ia32\Shell.efi %EFI_BOOT_DISK%\efi\
 :CreateUsb_FAT32_step2\r
 @copy %BUILD_DIR%\FV\EfiLdr20 %EFI_BOOT_DISK%\r
 @mkdir %EFI_BOOT_DISK%\efi\boot\r
-@copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\ia32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
+@if "%PROCESSOR%"=="IA32" goto CreateBootFileForIA32\r
+@if "%PROCESSOR%"=="X64" goto CreateBootFileForX64\r
 @goto end\r
 \r
 :CreateIde\r
 @goto end\r
 \r
+:CreateBootFileForIA32\r
+copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\IA32\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootia32.efi /y\r
+@goto end\r
+\r
+:CreateBootFileForX64\r
+copy %WORKSPACE%\EdkShellBinPkg\MinimumShell\X64\Shell.efi %EFI_BOOT_DISK%\efi\boot\bootx64.efi /y\r
+@goto end\r
+\r
 :WrongFATType\r
 @echo Wrong FAT type %3 for %1\r
 @goto end\r
 \r
+:NoArch\r
+@echo Error! Please specific the architecture.\r
+@goto Help\r
+\r
+:WrongArch\r
+@echo Error! Wrong architecture.\r
+@goto Help\r
+\r
 :Help\r
-@echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32]"\r
+@echo "Usage: CreateBootDisk [usb|floppy|ide] DiskNumber [FAT12|FAT16|FAT32] [IA32|X64]"\r
 :end\r
 @echo on
\ No newline at end of file
index fb54a31b0d42a3e743f549e71e87c63136d98a54..bfe1abd83e6872ff533d3dad5126aff7bfabacd3 100755 (executable)
@@ -14,8 +14,8 @@ if [ \
      "$*" = "--help" \
    ]
 then
-       echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32]"
-       echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 "
+       echo "Usage: CreateBootDisk [usb|floppy|ide] MediaPath DevicePath [FAT12|FAT16|FAT32] [IA32|X64]"
+       echo "e.g. : CreateBootDisk floppy /media/floppy0 /dev/fd0 FAT12 IA32"
        PROCESS_MARK=FALSE
 fi
 
@@ -44,9 +44,17 @@ then
        
                                mkdir -p $EFI_BOOT_MEDIA/efi
                                mkdir -p $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 Done.
                        else
                                echo "Wrong FAT type $4 for floppy!"
@@ -73,11 +81,21 @@ then
 
                        if [ "$4" = FAT16 ]
                        then
-                               if [ "$5" = step2 ]
+                               if [ "$6" = step2 ]
                                then
                                        cp $BUILD_DIR/FV/Efildr16 $EFI_BOOT_MEDIA
                                        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!"
                                else
                                        echo Format $EFI_BOOT_DEVICE ...
@@ -93,11 +111,21 @@ then
                                fi
                        elif [ "$4" = FAT32 ]
                        then 
-                               if [ "$5" = step2 ]
+                               if [ "$6" = step2 ]
                                then
                                        cp $BUILD_DIR/FV/Efildr20 $EFI_BOOT_MEDIA
                                        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!"
                                else
                                        echo Format $EFI_BOOT_DEVICE ...
index 021b3ed5019ab30ee9bdf0bd8fe79a4f968b5ccf..9123089b7337aa42eccfc9e8e1ba1fdc13df69b4 100644 (file)
@@ -26,7 +26,7 @@ Revision History:
 #define EFI_MEMORY_BELOW_1MB_START     0x86000\r
 #define EFI_MEMORY_BELOW_1MB_END       0x9F800\r
 #define EFI_MEMORY_STACK_PAGE_NUM      0x20\r
-#define CONSUMED_MEMORY                0x2000000\r
+#define CONSUMED_MEMORY                0x100000 * 80\r
 \r
 #define NV_STORAGE_START               0x15000\r
 #define NV_STORAGE_STATE               0x19000\r
index c69a97f01f1196f262bc5b92383c2177fef67a73..c036e3f72cf3003e54143ae159921235460cae0d 100644 (file)
@@ -56,7 +56,7 @@ EfiLoader (
   \r
   PrintHeader ('A');\r
   
-  AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader ...\n", BiosMemoryMapBaseAddress);\r
+  AsciiSPrint (PrintBuffer, 256, "Enter DUET Loader...\n");\r
   PrintString (PrintBuffer);\r
 \r
   AsciiSPrint (PrintBuffer, 256, "BiosMemoryMapBaseAddress = 0x%x\n", BiosMemoryMapBaseAddress);\r
index 173851b5a1cafbb76967db3d96c0b7bf5421ac5a..caaa4fbbf18202d0c952a4a74ff09e16d3f8b912 100644 (file)
@@ -36,17 +36,21 @@ Create bootable disk
 3.1 Create floppy boot disk\r
   1). enter <Workspace>\DuetPkg directory.\r
   2). Insert a floppy disk to drive\r
-  3). run "CreateBootDisk.bat floppy a: FAT12" if floppy drive is a: disk.\r
-  \r
+  3). run "CreateBootDisk.bat floppy a: FAT12 IA32" if floppy drive is a: disk and Arch to boot is IA32.\r
+      or\r
+      run "CreateBootDisk.bat floppy a: FAT12 X64" if floppy drive is a: disk and Arch to boot is X64.\r
 3.2 Create usb boot disk\r
   1). enter <Workspace>\DuetPkg directory.\r
   2). Plugin usb disk\r
-  3). run "CreateBootDisk.bat usb e: FAT16" if usb drive is e: and FAT format is FAT16 or\r
-          "CreateBootDisk.bat usb e: FAT32" if usb drive is e: and FAT format is FAT32\r
+  3). run "CreateBootDisk.bat usb e: FAT16 IA32" if usb drive is e: and FAT format is FAT16 and Arch to boot is IA32.\r
+      or "CreateBootDisk.bat usb e: FAT16 X64" if usb drive is e: and FAT format is FAT16 and Arch to boot is X64.\r
+      or "CreateBootDisk.bat usb e: FAT32 IA32" if usb drive is e: and FAT format is FAT32 and Arch to boot is IA32.\r
+      or "CreateBootDisk.bat usb e: FAT32 X64" if usb drive is e: and FAT format is FAT32 and Arch to boot is X64.\r
   4). UnPlug usb disk and plugin it again.\r
-  5). run "CreateBootDisk.bat usb e: FAT16 step2" if usb drive is e: and FAT format is FAT16 or \r
-          "CreateBootDisk.bat usb e: FAT32 step2" if usb drive is e: and FAT format is FAT32.\r
-          \r
+  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.\r
+      or "CreateBootDisk.bat usb e: FAT16 X64 step2" if usb drive is e: and FAT format is FAT16 and Arch to boot is X64.\r
+      or "CreateBootDisk.bat usb e: FAT32 IA32 step2" if usb drive is e: and FAT format is FAT32 and Arch to boot is IA32.\r
+      or "CreateBootDisk.bat usb e: FAT32 X64 step2" if usb drive is e: and FAT format is FAT32 and Arch to boot is X64.\r
           \r
 B. Build DUET image on Linux Platform\r
 ======================================        \r
@@ -98,4 +102,4 @@ B. Build DUET image on Linux Platform
          1). enter /R9_tree/DuetPkg directory.\r
          2). Insert a floppy disk to drive\r
          3). run "CreateBootDisk.sh" to build floppy drive\r
-                 such as "./CreateBootDisk.sh floppy /media/floppy0 /dev/fd0 FAT12"
\ No newline at end of file
+                 such as "./CreateBootDisk.sh floppy /media/floppy0 /dev/fd0 FAT12 IA32"
\ No newline at end of file