]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DuetPkg BootSector: Clean up .S files for 64-bit Duet for GCC build.
authorrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Jan 2012 04:30:33 +0000 (04:30 +0000)
committerrsun3 <rsun3@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 10 Jan 2012 04:30:33 +0000 (04:30 +0000)
Partly contributed by Sergey Isakov [isakov-sl@bk.ru].

Signed-off-by: rsun3
Reviewed-by: niruiyu
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12921 6f19259b-4bc3-4df7-8a09-765794883524

DuetPkg/BootSector/GNUmakefile
DuetPkg/BootSector/efi64.S
DuetPkg/BootSector/st16_64.S
DuetPkg/BootSector/st32_64.S
DuetPkg/BootSector/start64.S

index 66298daf3b40da5ff12f70da9bbdebb461f78fb0..dc26e1f9ec2a59e5ef609aa481049ebcfb469619 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 #  Just use host GCC to compile boot sector image.\r
 #\r
-#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -20,11 +20,15 @@ ASSEMBLY_CODE_FILE_LIST = $(MODULE_DIR)/bootsect.S \
                           $(MODULE_DIR)/bs16.S \
                           $(MODULE_DIR)/bs32.S \
                           $(MODULE_DIR)/efi32.S \
+                          $(MODULE_DIR)/efi64.S \
                           $(MODULE_DIR)/Gpt.S \
                           $(MODULE_DIR)/Mbr.S \
                           $(MODULE_DIR)/start.S \
                           $(MODULE_DIR)/start16.S \
-                          $(MODULE_DIR)/start32.S
+                          $(MODULE_DIR)/start32.S \
+                          $(MODULE_DIR)/start64.S \
+                          $(MODULE_DIR)/st16_64.S \
+                          $(MODULE_DIR)/st32_64.S
 
 TARGET_FILES = $(OUTPUT_DIR)/bootsect.com \
                $(OUTPUT_DIR)/bs16.com \
@@ -34,11 +38,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)/efi64.com2
+               $(OUTPUT_DIR)/efi32.com2 \
+               $(OUTPUT_DIR)/start64.com \
+               $(OUTPUT_DIR)/st16_64.com \
+               $(OUTPUT_DIR)/st32_64.com \
+               $(OUTPUT_DIR)/efi64.com2
 
 .PHONY : all
 all: $(TARGET_FILES)
@@ -98,16 +102,16 @@ $(OUTPUT_DIR)/start64.com: $(OUTPUT_DIR)/start64.o
        $(DLINK) --oformat binary -o $(OUTPUT_DIR)/start64.com $(OUTPUT_DIR)/start64.o -Ttext 0 -Map $(OUTPUT_DIR)/start64.map
 
 # start16_64.S
-$(OUTPUT_DIR)/start16_64.o: $(MODULE_DIR)/start16_64.S
-       $(ASM) -c -o $(OUTPUT_DIR)/start16_64.o $(MODULE_DIR)/start16_64.S
-$(OUTPUT_DIR)/start16_64.com: $(OUTPUT_DIR)/start16_64.o
-       $(DLINK) --oformat binary -o $(OUTPUT_DIR)/start16_64.com $(OUTPUT_DIR)/start16_64.o -Ttext 0 -Map $(OUTPUT_DIR)/start16_64.map
+$(OUTPUT_DIR)/st16_64.o: $(MODULE_DIR)/st16_64.S
+       $(ASM) -c -o $(OUTPUT_DIR)/st16_64.o $(MODULE_DIR)/st16_64.S
+$(OUTPUT_DIR)/st16_64.com: $(OUTPUT_DIR)/st16_64.o
+       $(DLINK) --oformat binary -o $(OUTPUT_DIR)/st16_64.com $(OUTPUT_DIR)/st16_64.o -Ttext 0 -Map $(OUTPUT_DIR)/st16_64.map
 
 # start32_64.S
-$(OUTPUT_DIR)/start32_64.o: $(MODULE_DIR)/start32_64.S
-       $(ASM) -c -o $(OUTPUT_DIR)/start32_64.o $(MODULE_DIR)/start32_64.S
-$(OUTPUT_DIR)/start32_64.com: $(OUTPUT_DIR)/start32_64.o
-       $(DLINK) --oformat binary -o $(OUTPUT_DIR)/start32_64.com $(OUTPUT_DIR)/start32_64.o -Ttext 0 -Map $(OUTPUT_DIR)/start32_64.map
+$(OUTPUT_DIR)/st32_64.o: $(MODULE_DIR)/st32_64.S
+       $(ASM) -c -o $(OUTPUT_DIR)/st32_64.o $(MODULE_DIR)/st32_64.S
+$(OUTPUT_DIR)/st32_64.com: $(OUTPUT_DIR)/st32_64.o
+       $(DLINK) --oformat binary -o $(OUTPUT_DIR)/st32_64.com $(OUTPUT_DIR)/st32_64.o -Ttext 0 -Map $(OUTPUT_DIR)/st32_64.map
 
 # efi32.S
 $(OUTPUT_DIR)/efi32.o: $(MODULE_DIR)/efi32.S
index fe7a3647ad9efb493006aa56ac0b5043500211d4..ec6ad89761ea4a50e20b983bff45b407f7565fe7 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #*\r
-#*   Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #*   This program and the accompanying materials                          \r
 #*   are licensed and made available under the terms and conditions of the BSD License         \r
 #*   which accompanies this distribution.  The full text of the license may be found at        \r
@@ -24,6 +24,9 @@
         .code: \r
         .org 0x21000\r
 \r
+.global _start\r
+_start:\r
+\r
 .equ                 DEFAULT_HANDLER_SIZE, INT1 - INT0\r
 \r
 .macro jmpCommonIdtEntry  \r
@@ -1279,9 +1282,9 @@ looptop:
     andb    $0xf,%bl\r
     addb    $'0', %bl\r
     cmpb    $'9', %bl\r
-    jle     @f\r
+    jle     LN_C4\r
     addb    $7,%bl\r
-@@\r
+LN_C4\r
     movb %bl, (%edi)\r
     addl    $2,%edi\r
     loop    looptop\r
@@ -1300,10 +1303,10 @@ ClearScreen:
     movb    $0xc,%ah\r
     movl    $0xb8000,%edi\r
     movl    $80*24,%ecx\r
-LN_C4\r
+LN_C5\r
     movw    %ax, (%edi)\r
     addl    $2,%edi\r
-    loop    LN_C4\r
+    loop    LN_C5\r
     movl    $0xb8000,%edi\r
 \r
     popl    %ecx\r
@@ -1315,9 +1318,9 @@ A2C:
     andb    $0xf,%al\r
     addb    $'0', %al\r
     cmpb    $'9', %al\r
-    jle     @f\r
+    jle     LN_C6\r
     addb    $7,%al\r
-LN_C5\r
+LN_C6\r
     ret\r
 \r
 String1:            .asciz      "*** INT "\r
index c6cc5169f672ed241289a5763463ee5536dadcc5..8eadd28d35dd72a92f8d30f8c4e6439a8e6801bc 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #*\r
-#*   Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #*   This program and the accompanying materials                          \r
 #*   are licensed and made available under the terms and conditions of the BSD License         \r
 #*   which accompanies this distribution.  The full text of the license may be found at        \r
 .equ                        BLOCK_SHIFT, 9\r
 \r
        .org 0x0\r
+\r
+.global _start\r
+_start:\r
+\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst    - 3 bytes\r
   nop\r
@@ -123,11 +127,11 @@ CheckEm64T:
         movw $18,%cx\r
         jmp  PrintStringAndHalt\r
 CheckEm64TPass: \r
-jumpFarInstruction: \r
+JumpFarInstruction: \r
         .byte 0xea\r
-jumpOffset: \r
+JumpOffset: \r
         .word 0x200\r
-jumpSegment: \r
+JumpSegment: \r
         .word 0x2000\r
 \r
 \r
@@ -431,7 +435,7 @@ A20GateEnabled:
     #\r
     # Enable Protect Mode (set CR0.PE=1)\r
     #\r
-    movl  $cr0, %eax      # Read CR0.\r
+    movl  %cr0, %eax      # Read CR0.\r
     orl   $0x1,%eax       # Set PE=1\r
     movl  %eax, %cr0      # Write CR0.\r
     .byte 0x66\r
@@ -503,7 +507,7 @@ In32BitProtectedMode:
     #\r
     # Enable paging to activate long mode (set CR0.PG=1)\r
     #\r
-    movl  $cr0, %eax      # Read CR0.\r
+    movl  %cr0, %eax      # Read CR0.\r
     .byte 0xf\r
     .byte 0xba\r
     .byte 0xe8\r
@@ -1098,10 +1102,9 @@ MemoryMap:  .long 0,0,0,0,0,0,0,0
         .long 0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0\r
 \r
-        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
 \r
-        #.org 0x0fe0  #Just for pass build\r
+        .org 0x0fe0\r
 MyStack:    \r
         # below is the pieces of the IVT that is used to redirect INT 68h - 6fh\r
         #    back to INT 08h - 0fh  when in real mode...  It is 'org'ed to a\r
@@ -1133,7 +1136,7 @@ MyStack:
         iret\r
 \r
 \r
-        #.org 0x0ffe #Just for pass build\r
+        .org 0x0ffe\r
 BlockSignature: \r
         .word 0xaa55\r
 \r
index f1ebf67d186a6aa021ab0c1bdd64fcf8d1362ddf..465b1cf9b2867e532635390b18e086caab7694e3 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #*\r
-#*   Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #*   This program and the accompanying materials                          \r
 #*   are licensed and made available under the terms and conditions of the BSD License         \r
 #*   which accompanies this distribution.  The full text of the license may be found at        \r
 .equ                        BLOCK_SHIFT, 9\r
 \r
        .org 0x0\r
+\r
+.global _start\r
+_start:\r
+\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst    - 3 bytes\r
   nop\r
@@ -138,11 +142,11 @@ CheckEm64T:
         movw $18,%cx\r
         jmp  PrintStringAndHalt\r
 CheckEm64TPass: \r
-jumpFarInstruction: \r
+JumpFarInstruction: \r
         .byte 0xea\r
-jumpOffset: \r
+JumpOffset: \r
         .word 0x200\r
-jumpSegment: \r
+JumpSegment: \r
         .word 0x2000\r
 \r
 \r
@@ -446,7 +450,7 @@ A20GateEnabled:
     #\r
     # Enable Protect Mode (set CR0.PE=1)\r
     #\r
-    movl  $cr0, %eax      # Read CR0.\r
+    movl  %cr0, %eax      # Read CR0.\r
     orl   $0x1,%eax       # Set PE=1\r
     movl  %eax, %cr0      # Write CR0.\r
     .byte 0x66\r
@@ -518,7 +522,7 @@ In32BitProtectedMode:
     #\r
     # Enable paging to activate long mode (set CR0.PG=1)\r
     #\r
-    movl  $cr0, %eax      # Read CR0.\r
+    movl  %cr0, %eax      # Read CR0.\r
     .byte 0xf\r
     .byte 0xba\r
     .byte 0xe8\r
@@ -1113,10 +1117,9 @@ MemoryMap:  .long 0,0,0,0,0,0,0,0
         .long 0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0\r
 \r
-        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
 \r
-        #.org 0x0fe0  #Just for pass build\r
+        .org 0x0fe0\r
 MyStack:    \r
         # below is the pieces of the IVT that is used to redirect INT 68h - 6fh\r
         #    back to INT 08h - 0fh  when in real mode...  It is 'org'ed to a\r
@@ -1148,7 +1151,7 @@ MyStack:
         iret\r
 \r
 \r
-        #.org 0x0ffe #Just for pass build\r
+        .org 0x0ffe\r
 BlockSignature: \r
         .word 0xaa55\r
 \r
index b8f1e60f8a154a84fe839c9b5c08737ca5499613..75626b86a48799afb4db523cda995c48f0029d96 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------\r
 #*\r
-#*   Copyright (c) 2006 - 2007, Intel Corporation. All rights reserved.<BR>\r
+#*   Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
 #*   This program and the accompanying materials                          \r
 #*   are licensed and made available under the terms and conditions of the BSD License         \r
 #*   which accompanies this distribution.  The full text of the license may be found at        \r
 .equ                        BLOCK_SHIFT, 9\r
 \r
         .org 0x0\r
+\r
+.global _start\r
+_start:\r
+\r
 Ia32Jump: \r
   jmp   BootSectorEntryPoint  # JMP inst    - 3 bytes\r
   nop\r
@@ -123,11 +127,11 @@ CheckEm64T:
         movw $18,%cx\r
         jmp  PrintStringAndHalt\r
 CheckEm64TPass: \r
-jumpFarInstruction: \r
+JumpFarInstruction: \r
         .byte 0xea\r
-jumpOffset: \r
+JumpOffset: \r
         .word 0x200\r
-jumpSegment: \r
+JumpSegment: \r
         .word 0x2000\r
 \r
 \r
@@ -510,7 +514,7 @@ In32BitProtectedMode:
     #\r
     # Enable paging to activate long mode (set CR0.PG=1)\r
     #\r
-    movl  $cr0, %eax      # Read CR0.\r
+    movl  %cr0, %eax      # Read CR0.\r
     .byte 0xf\r
     .byte 0xba\r
     .byte 0xe8\r
@@ -1105,7 +1109,6 @@ MemoryMap:  .long 0,0,0,0,0,0,0,0
         .long 0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0\r
 \r
-        .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
         .long 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0\r
 \r
         .org 0x0fe0\r