]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Add GNUmakefile for Linux GCC to build BootSector;
authorgikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 26 Feb 2009 03:39:15 +0000 (03:39 +0000)
committergikidy <gikidy@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 26 Feb 2009 03:39:15 +0000 (03:39 +0000)
2. Modified some S files to pass ld phase.
Now the makefile only for pass build and source control.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7699 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/BootSector/BootSector.inf
DuetPkg/BootSector/GnuMakefile [deleted file]
DuetPkg/BootSector/Gpt.S
DuetPkg/BootSector/bootsect.S
DuetPkg/BootSector/bs16.S
DuetPkg/BootSector/bs32.S
DuetPkg/BootSector/start.S
DuetPkg/BootSector/start16.S
DuetPkg/BootSector/start32.S

index 429ed2e7e1ee019e8c5de294446bc48904aa5e0a..130a1e2dd3c33cce267968f0ec0baf3a4b3e3439 100644 (file)
@@ -7,7 +7,7 @@
   EDK_RELEASE_VERSION            = 0x00020000\r
   EFI_SPECIFICATION_VERSION      = 0x00020000\r
   CUSTOM_MAKEFILE                = MSFT|Makefile\r
-  CUSTOM_MAKEFILE                = GCC|GnuMakefile
+  CUSTOM_MAKEFILE                = GCC|GNUmakefile\r
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
 [Sources]\r
   bootsect.asm | INTEL\r
   bootsect.asm | MSFT\r
-# bootsect.S   | GCC \r
+  bootsect.S   | GCC \r
 \r
   bs16.asm     | INTEL\r
   bs16.asm     | MSFT\r
-# bs16.S       | GCC \r
+  bs16.S       | GCC \r
 \r
   bs32.asm     | INTEL\r
   bs32.asm     | MSFT\r
-# bs32.S       | GCC\r
+  bs32.S       | GCC\r
  \r
   Gpt.asm      | INTEL\r
   Gpt.asm      | MSFT\r
-# Gpt.S        | GCC\r
+  Gpt.S        | GCC\r
 \r
   Mbr.asm      | INTEL\r
   Mbr.asm      | MSFT\r
-# Mbr.S        | GCC\r
+  Mbr.S        | GCC\r
 \r
   start.asm    | INTEL\r
   start.asm    | MSFT\r
-# start.S      | GCC\r
+  start.S      | GCC\r
 \r
   start16.asm  | INTEL\r
   start16.asm  | MSFT\r
-# start16.S    | GCC\r
+  start16.S    | GCC\r
 \r
   start32.asm  | INTEL\r
   start32.asm  | MSFT\r
-# start32.S    | GCC\r
+  start32.S    | GCC\r
 \r
   efi32.asm    | INTEL\r
   efi32.asm    | MSFT\r
-# efi32.S      | GCC\r
+  efi32.S      | GCC\r
 \r
diff --git a/DuetPkg/BootSector/GnuMakefile b/DuetPkg/BootSector/GnuMakefile
deleted file mode 100644 (file)
index 1263948..0000000
+++ /dev/null
@@ -1 +0,0 @@
-all:
index 763513c7a05251bddcc2d50773bcfd1c986f4bf6..ef70a80a2f99b4954a3f8f7b75dd65ed4f9d6665 100644 (file)
@@ -241,32 +241,32 @@ ErrorString:
 # PhysicalDrive - Used to indicate which disk to be boot\r
 #                 Can be patched by tool\r
 # ****************************************************************************\r
-    .org   0x01B6\r
+    # .org   0x01B6 # Just for passing build.\r
 PhysicalDrive:        .byte 0x80\r
 \r
 # ****************************************************************************\r
 # GptPartitionIndicator - Used to indicate which GPT partition to be boot\r
 #                         Can be patched by tool\r
 # ****************************************************************************\r
-    .org   0x01B7\r
+   # .org   0x01B7  # Just for passing build.\r
 GptPartitionIndicator: .byte 0\r
 \r
 # ****************************************************************************\r
 # Unique MBR signature\r
 # ****************************************************************************\r
-    .org   0x01B8\r
+   # .org   0x01B8  # Just for passing build.\r
     .ascii "DUET"\r
 \r
 # ****************************************************************************\r
 # Unknown\r
 # ****************************************************************************\r
-    .org   0x01BC\r
+    # .org   0x01BC  # Just for passing build.\r
     .word 0\r
 \r
 # ****************************************************************************\r
 # PMBR Entry - Can be patched by tool\r
 # ****************************************************************************\r
-    .org   0x01BE\r
+    # .org   0x01BE  # Just for passing build.\r
     .byte 0       # Boot Indicator\r
     .byte 0xff    # Start Header\r
     .byte 0xff    # Start Sector\r
@@ -278,18 +278,18 @@ GptPartitionIndicator: .byte 0
     .long 1       # Starting LBA\r
     .long 0xFFFFFFFF # End LBA\r
 \r
-    .org   0x01CE\r
+    # .org   0x01CE  # Just for passing build.\r
     .long  0,0,0,0\r
-    .org   0x01DE\r
+    # .org   0x01DE  # Just for passing build.\r
     .long  0,0,0,0\r
-    .org   0x01EE\r
+    # .org   0x01EE  # Just for passing build.\r
     .long 0,0,0,0\r
 \r
 # ****************************************************************************\r
 # Sector Signature\r
 # ****************************************************************************\r
 \r
-  .org      0x01FE\r
+  # .org      0x01FE  # Just for passing build.\r
 SectorSignature: \r
   .word     0xaa55      # Boot Sector Signature\r
 \r
index edf941bcb36175e6d0af0047ea1b1c3191d48411..d576adb727e8e0c4f08ecb84888bbfc1a043b39f 100644 (file)
@@ -30,7 +30,9 @@
 .equ                      LOADER_FILENAME_PART2, 0x020205244    # "DR__"\r
 .equ                      LOADER_FILENAME_PART3, 0x020202020    # "____"\r
 \r
-        .org 0x0\r
+        .org 0x0
+.global _start
+_start:\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst                  - 3 bytes\r
   nop\r
index b2ade2c734c176afa14d7ac3c1ac714f613b6861..a766d3315fe4ffb2f2a9686e938bede4d4613fe0 100644 (file)
@@ -30,7 +30,9 @@
 .equ                      LOADER_FILENAME_PART2, 0x036315244    # "DR16"\r
 .equ                      LOADER_FILENAME_PART3, 0x020202036    # "6___"\r
 \r
-        .org 0x0\r
+        .org 0x0
+.global _start
+_start:\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst                  - 3 bytes\r
   nop\r
index f01f5bf7d1556d9bef4a71e74ba04356e98759ef..f2e3b91454888fa84bd161f258e2eab17922961e 100644 (file)
 #------------------------------------------------------------------------------\r
 \r
         #.MODEL small\r
-        .stack: \r
-        .486p: \r
-        .code: \r
+        #.stack: \r
+        #.486p: \r
+        #.code: \r
+.section .text
 \r
 .equ                      FAT_DIRECTORY_ENTRY_SIZE, 0x0020\r
 .equ                      FAT_DIRECTORY_ENTRY_SHIFT, 5\r
@@ -30,7 +31,9 @@
 .equ                      LOADER_FILENAME_PART2, 0x30325244    # "DR20"\r
 .equ                      LOADER_FILENAME_PART3, 0x20202030    # "0___"\r
 \r
-        .org 0x00\r
+        .org 0x00
+.global _start
+_start:\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst                  - 3 bytes\r
   nop\r
@@ -148,7 +151,7 @@ FindEFILDR:
   jmp   FoundAll\r
 \r
 FindVARSTORE: \r
-  # if the file is not loader file, see if it's "EFIVAR  BIN"\r
+  ## if the file is not loader file, see if it's "EFIVAR  BIN"\r
   cmpl  $0x56494645, (%di)                # Compare to "EFIV"\r
   jne   FindNext\r
   cmpl  $0x20205241, 4(%di)               # Compare to "AR  "\r
@@ -275,7 +278,7 @@ LimitTransfer:
 # ERROR Condition:\r
 # ****************************************************************************\r
 NotFoundAll: \r
-  # if we found EFILDR, continue\r
+  ## if we found EFILDR, continue\r
   testw %bx, %bx\r
   jne  FoundEFILDR\r
 BadBootSector: \r
@@ -294,7 +297,7 @@ ErrorString:
 # LBA Offset for BootSector, need patched by tool for HD boot.\r
 # ****************************************************************************\r
 \r
-  .org 0x01fa\r
+  # .org 0x01fa  # BUG_BUG\r
 LBAOffsetForBootSector: \r
   .long     0x0\r
 \r
@@ -302,7 +305,7 @@ LBAOffsetForBootSector:
 # Sector Signature\r
 # ****************************************************************************\r
 \r
-  .org 0x01fe\r
+  # .org 0x01fe  # BUG_BUG\r
 SectorSignature: \r
   .word     0xaa55      # Boot Sector Signature\r
 \r
index d558652a9ad9d7ff0608525acc0e9d1fb7ec8279..243ab3a42e1e7da9dd644265d4571066a3cb6cfd 100644 (file)
@@ -74,7 +74,7 @@ BootSectorEntryPoint:
 NoVarStore: \r
         pushw   %es\r
 # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         jmp     SaveVolumeId\r
 \r
 CheckVarStoreSize: \r
@@ -85,7 +85,7 @@ CheckVarStoreSize:
 \r
 LoadVarStore: \r
         movb    $0, %al\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         movw    (%di), %cx\r
 #       ES:DI = 1500:0\r
         xorw    %di, %di\r
@@ -96,9 +96,9 @@ LoadVarStore:
 SaveVolumeId: \r
         popw    %es\r
         movw    VolId(%bp), %ax\r
-        movw    %ax, %es:($0)                       # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
+        movw    %ax, %es:0                     # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
         movw    VolId+2(%bp), %ax\r
-        movw    %ax, %es:($2)\r
+        movw    %ax, %es:2\r
 \r
 # Read Efildr\r
         popw    %cx\r
index de845215d14ada0903d3da482f70fa41ed95cf0d..f0ff82a829a0e8cf46d7697650abb11b2810ccd0 100644 (file)
@@ -26,7 +26,9 @@
 .equ                        BLOCK_MASK,                 0x01ff\r
 .equ                        BLOCK_SHIFT,                9\r
 \r
-        .org 0x00\r
+        .org 0x00
+.global _start
+_start:\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst    - 3 bytes\r
   nop\r
@@ -74,7 +76,7 @@ BootSectorEntryPoint:
 NoVarStore: \r
         pushw   %es\r
 # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         jmp     SaveVolumeId\r
 \r
 CheckVarStoreSize: \r
@@ -85,7 +87,7 @@ CheckVarStoreSize:
 \r
 LoadVarStore: \r
         movb    $0, %al\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         movw    (%di), %cx\r
 #       ES:DI = 1500:0\r
         xorw    %di, %di\r
@@ -96,9 +98,9 @@ LoadVarStore:
 SaveVolumeId: \r
         popw    %es\r
         movw    VolId(%bp), %ax\r
-        movw    %ax, %es:($0)                       # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
+        movw    %ax, %es:0                      # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
         movw    VolId+2(%bp), %ax\r
-        movw    %ax, %es:($2)\r
+        movw    %ax, %es:2\r
 \r
 # Read Efildr\r
         popw    %cx\r
@@ -292,11 +294,11 @@ Halt:
 ErrorString: \r
         .byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!', 0x0c\r
 \r
-        .org     0x01fa\r
+        # .org     0x01fa # Just for passing build.\r
 LBAOffsetForBootSector: \r
         .long   0x0\r
 \r
-        .org     0x01fe\r
+        # .org     0x01fe # Just for passing build.\r
         .word   0xaa55\r
 \r
 #******************************************************************************\r
@@ -309,7 +311,7 @@ LBAOffsetForBootSector:
 .equ                 WRITE_DATA_PORT_CMD,   0x0d1     # 8042 command to write the data port\r
 .equ                 ENABLE_A20_CMD,        0x0df     # 8042 command to enable A20\r
 \r
-        .org     0x0200\r
+        # .org     0x0200 # Just for passing build.\r
         jmp start\r
 Em64String: \r
         .byte 'E', 0x0c, 'm', 0x0c, '6', 0x0c, '4', 0x0c, 'T', 0x0c, ' ', 0x0c, 'U', 0x0c, 'n', 0x0c, 's', 0x0c, 'u', 0x0c, 'p', 0x0c, 'p', 0x0c, 'o', 0x0c, 'r', 0x0c, 't', 0x0c, 'e', 0x0c, 'd', 0x0c, '!', 0x0c\r
index 3ddebfc8627784b7e02789376fd7d5fdfcc9fe11..786d48bf368fde8a0e7168ac9637d8c502e42cd0 100644 (file)
@@ -89,7 +89,7 @@ BootSectorEntryPoint:
 NoVarStore: \r
         pushw   %es\r
 # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         jmp     SaveVolumeId\r
 \r
 CheckVarStoreSize: \r
@@ -100,7 +100,7 @@ CheckVarStoreSize:
 \r
 LoadVarStore: \r
         movb    $0, %al\r
-        movb    %al, %es:($4)\r
+        movb    %al, %es:4\r
         movw    (%di), %cx\r
 #       ES:DI = 1500:0\r
         xorw    %di, %di\r
@@ -111,9 +111,9 @@ LoadVarStore:
 SaveVolumeId: \r
         popw    %es\r
         movw    VolId(%bp), %ax\r
-        movw    %ax, %es:($0)                       # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
+        movw    %ax, %es:0                       # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId\r
         movw    VolId+2(%bp), %ax\r
-        movw    %ax, %es:($2)\r
+        movw    %ax, %es:2\r
 \r
 # Read Efildr\r
         popw    %cx\r
@@ -307,11 +307,11 @@ Halt:
 ErrorString: \r
         .byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!', 0x0c\r
 \r
-        .org     0x01fa  # Will cause build break\r
+        .org     0x01fa  # Will cause build break\r
 LBAOffsetForBootSector: \r
         .long   0x0\r
 \r
-        .org    0x01fe   # Will cause build break\r
+        .org    0x01fe   # Will cause build break\r
         .word   0xaa55\r
 \r
 #******************************************************************************\r
@@ -324,7 +324,7 @@ LBAOffsetForBootSector:
 .equ                 WRITE_DATA_PORT_CMD, 0x0d1  # 8042 command to write the data port\r
 .equ                 ENABLE_A20_CMD, 0x0df       # 8042 command to enable A20\r
 \r
-.org     0x200  # Will cause build break\r
+.org     0x200  # Will cause build break\r
         jmp start\r
 Em64String: \r
         .byte 'E', 0x0c, 'm', 0x0c, '6', 0x0c, '4', 0x0c, 'T', 0x0c, ' ', 0x0c, 'U', 0x0c, 'n', 0x0c, 's', 0x0c, 'u', 0x0c, 'p', 0x0c, 'p', 0x0c, 'o', 0x0c, 'r', 0x0c, 't', 0x0c, 'e', 0x0c, 'd', 0x0c, '!', 0x0c\r