From fd549a4db9c562587652c23884bab5a4f3631d10 Mon Sep 17 00:00:00 2001 From: gikidy Date: Thu, 26 Feb 2009 03:39:15 +0000 Subject: [PATCH] 1. Add GNUmakefile for Linux GCC to build BootSector; 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 | 20 ++++++++++---------- DuetPkg/BootSector/GnuMakefile | 1 - DuetPkg/BootSector/Gpt.S | 18 +++++++++--------- DuetPkg/BootSector/bootsect.S | 4 +++- DuetPkg/BootSector/bs16.S | 4 +++- DuetPkg/BootSector/bs32.S | 19 +++++++++++-------- DuetPkg/BootSector/start.S | 8 ++++---- DuetPkg/BootSector/start16.S | 18 ++++++++++-------- DuetPkg/BootSector/start32.S | 14 +++++++------- 9 files changed, 57 insertions(+), 49 deletions(-) delete mode 100644 DuetPkg/BootSector/GnuMakefile diff --git a/DuetPkg/BootSector/BootSector.inf b/DuetPkg/BootSector/BootSector.inf index 429ed2e7e1..130a1e2dd3 100644 --- a/DuetPkg/BootSector/BootSector.inf +++ b/DuetPkg/BootSector/BootSector.inf @@ -7,7 +7,7 @@ EDK_RELEASE_VERSION = 0x00020000 EFI_SPECIFICATION_VERSION = 0x00020000 CUSTOM_MAKEFILE = MSFT|Makefile - CUSTOM_MAKEFILE = GCC|GnuMakefile + CUSTOM_MAKEFILE = GCC|GNUmakefile [Packages] MdePkg/MdePkg.dec @@ -16,37 +16,37 @@ [Sources] bootsect.asm | INTEL bootsect.asm | MSFT -# bootsect.S | GCC + bootsect.S | GCC bs16.asm | INTEL bs16.asm | MSFT -# bs16.S | GCC + bs16.S | GCC bs32.asm | INTEL bs32.asm | MSFT -# bs32.S | GCC + bs32.S | GCC Gpt.asm | INTEL Gpt.asm | MSFT -# Gpt.S | GCC + Gpt.S | GCC Mbr.asm | INTEL Mbr.asm | MSFT -# Mbr.S | GCC + Mbr.S | GCC start.asm | INTEL start.asm | MSFT -# start.S | GCC + start.S | GCC start16.asm | INTEL start16.asm | MSFT -# start16.S | GCC + start16.S | GCC start32.asm | INTEL start32.asm | MSFT -# start32.S | GCC + start32.S | GCC efi32.asm | INTEL efi32.asm | MSFT -# efi32.S | GCC + efi32.S | GCC diff --git a/DuetPkg/BootSector/GnuMakefile b/DuetPkg/BootSector/GnuMakefile deleted file mode 100644 index 1263948fb8..0000000000 --- a/DuetPkg/BootSector/GnuMakefile +++ /dev/null @@ -1 +0,0 @@ -all: diff --git a/DuetPkg/BootSector/Gpt.S b/DuetPkg/BootSector/Gpt.S index 763513c7a0..ef70a80a2f 100644 --- a/DuetPkg/BootSector/Gpt.S +++ b/DuetPkg/BootSector/Gpt.S @@ -241,32 +241,32 @@ ErrorString: # PhysicalDrive - Used to indicate which disk to be boot # Can be patched by tool # **************************************************************************** - .org 0x01B6 + # .org 0x01B6 # Just for passing build. PhysicalDrive: .byte 0x80 # **************************************************************************** # GptPartitionIndicator - Used to indicate which GPT partition to be boot # Can be patched by tool # **************************************************************************** - .org 0x01B7 + # .org 0x01B7 # Just for passing build. GptPartitionIndicator: .byte 0 # **************************************************************************** # Unique MBR signature # **************************************************************************** - .org 0x01B8 + # .org 0x01B8 # Just for passing build. .ascii "DUET" # **************************************************************************** # Unknown # **************************************************************************** - .org 0x01BC + # .org 0x01BC # Just for passing build. .word 0 # **************************************************************************** # PMBR Entry - Can be patched by tool # **************************************************************************** - .org 0x01BE + # .org 0x01BE # Just for passing build. .byte 0 # Boot Indicator .byte 0xff # Start Header .byte 0xff # Start Sector @@ -278,18 +278,18 @@ GptPartitionIndicator: .byte 0 .long 1 # Starting LBA .long 0xFFFFFFFF # End LBA - .org 0x01CE + # .org 0x01CE # Just for passing build. .long 0,0,0,0 - .org 0x01DE + # .org 0x01DE # Just for passing build. .long 0,0,0,0 - .org 0x01EE + # .org 0x01EE # Just for passing build. .long 0,0,0,0 # **************************************************************************** # Sector Signature # **************************************************************************** - .org 0x01FE + # .org 0x01FE # Just for passing build. SectorSignature: .word 0xaa55 # Boot Sector Signature diff --git a/DuetPkg/BootSector/bootsect.S b/DuetPkg/BootSector/bootsect.S index edf941bcb3..d576adb727 100644 --- a/DuetPkg/BootSector/bootsect.S +++ b/DuetPkg/BootSector/bootsect.S @@ -30,7 +30,9 @@ .equ LOADER_FILENAME_PART2, 0x020205244 # "DR__" .equ LOADER_FILENAME_PART3, 0x020202020 # "____" - .org 0x0 + .org 0x0 +.global _start +_start: Ia32Jump: jmp BootSectorEntryPoint # JMP inst - 3 bytes nop diff --git a/DuetPkg/BootSector/bs16.S b/DuetPkg/BootSector/bs16.S index b2ade2c734..a766d3315f 100644 --- a/DuetPkg/BootSector/bs16.S +++ b/DuetPkg/BootSector/bs16.S @@ -30,7 +30,9 @@ .equ LOADER_FILENAME_PART2, 0x036315244 # "DR16" .equ LOADER_FILENAME_PART3, 0x020202036 # "6___" - .org 0x0 + .org 0x0 +.global _start +_start: Ia32Jump: jmp BootSectorEntryPoint # JMP inst - 3 bytes nop diff --git a/DuetPkg/BootSector/bs32.S b/DuetPkg/BootSector/bs32.S index f01f5bf7d1..f2e3b91454 100644 --- a/DuetPkg/BootSector/bs32.S +++ b/DuetPkg/BootSector/bs32.S @@ -16,9 +16,10 @@ #------------------------------------------------------------------------------ #.MODEL small - .stack: - .486p: - .code: + #.stack: + #.486p: + #.code: +.section .text .equ FAT_DIRECTORY_ENTRY_SIZE, 0x0020 .equ FAT_DIRECTORY_ENTRY_SHIFT, 5 @@ -30,7 +31,9 @@ .equ LOADER_FILENAME_PART2, 0x30325244 # "DR20" .equ LOADER_FILENAME_PART3, 0x20202030 # "0___" - .org 0x00 + .org 0x00 +.global _start +_start: Ia32Jump: jmp BootSectorEntryPoint # JMP inst - 3 bytes nop @@ -148,7 +151,7 @@ FindEFILDR: jmp FoundAll FindVARSTORE: - # if the file is not loader file, see if it's "EFIVAR BIN" + ## if the file is not loader file, see if it's "EFIVAR BIN" cmpl $0x56494645, (%di) # Compare to "EFIV" jne FindNext cmpl $0x20205241, 4(%di) # Compare to "AR " @@ -275,7 +278,7 @@ LimitTransfer: # ERROR Condition: # **************************************************************************** NotFoundAll: - # if we found EFILDR, continue + ## if we found EFILDR, continue testw %bx, %bx jne FoundEFILDR BadBootSector: @@ -294,7 +297,7 @@ ErrorString: # LBA Offset for BootSector, need patched by tool for HD boot. # **************************************************************************** - .org 0x01fa + # .org 0x01fa # BUG_BUG LBAOffsetForBootSector: .long 0x0 @@ -302,7 +305,7 @@ LBAOffsetForBootSector: # Sector Signature # **************************************************************************** - .org 0x01fe + # .org 0x01fe # BUG_BUG SectorSignature: .word 0xaa55 # Boot Sector Signature diff --git a/DuetPkg/BootSector/start.S b/DuetPkg/BootSector/start.S index d558652a9a..243ab3a42e 100644 --- a/DuetPkg/BootSector/start.S +++ b/DuetPkg/BootSector/start.S @@ -74,7 +74,7 @@ BootSectorEntryPoint: NoVarStore: pushw %es # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl - movb %al, %es:($4) + movb %al, %es:4 jmp SaveVolumeId CheckVarStoreSize: @@ -85,7 +85,7 @@ CheckVarStoreSize: LoadVarStore: movb $0, %al - movb %al, %es:($4) + movb %al, %es:4 movw (%di), %cx # ES:DI = 1500:0 xorw %di, %di @@ -96,9 +96,9 @@ LoadVarStore: SaveVolumeId: popw %es movw VolId(%bp), %ax - movw %ax, %es:($0) # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId + movw %ax, %es:0 # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId movw VolId+2(%bp), %ax - movw %ax, %es:($2) + movw %ax, %es:2 # Read Efildr popw %cx diff --git a/DuetPkg/BootSector/start16.S b/DuetPkg/BootSector/start16.S index de845215d1..f0ff82a829 100644 --- a/DuetPkg/BootSector/start16.S +++ b/DuetPkg/BootSector/start16.S @@ -26,7 +26,9 @@ .equ BLOCK_MASK, 0x01ff .equ BLOCK_SHIFT, 9 - .org 0x00 + .org 0x00 +.global _start +_start: Ia32Jump: jmp BootSectorEntryPoint # JMP inst - 3 bytes nop @@ -74,7 +76,7 @@ BootSectorEntryPoint: NoVarStore: pushw %es # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl - movb %al, %es:($4) + movb %al, %es:4 jmp SaveVolumeId CheckVarStoreSize: @@ -85,7 +87,7 @@ CheckVarStoreSize: LoadVarStore: movb $0, %al - movb %al, %es:($4) + movb %al, %es:4 movw (%di), %cx # ES:DI = 1500:0 xorw %di, %di @@ -96,9 +98,9 @@ LoadVarStore: SaveVolumeId: popw %es movw VolId(%bp), %ax - movw %ax, %es:($0) # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId + movw %ax, %es:0 # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId movw VolId+2(%bp), %ax - movw %ax, %es:($2) + movw %ax, %es:2 # Read Efildr popw %cx @@ -292,11 +294,11 @@ Halt: ErrorString: .byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!', 0x0c - .org 0x01fa + # .org 0x01fa # Just for passing build. LBAOffsetForBootSector: .long 0x0 - .org 0x01fe + # .org 0x01fe # Just for passing build. .word 0xaa55 #****************************************************************************** @@ -309,7 +311,7 @@ LBAOffsetForBootSector: .equ WRITE_DATA_PORT_CMD, 0x0d1 # 8042 command to write the data port .equ ENABLE_A20_CMD, 0x0df # 8042 command to enable A20 - .org 0x0200 + # .org 0x0200 # Just for passing build. jmp start Em64String: .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 diff --git a/DuetPkg/BootSector/start32.S b/DuetPkg/BootSector/start32.S index 3ddebfc862..786d48bf36 100644 --- a/DuetPkg/BootSector/start32.S +++ b/DuetPkg/BootSector/start32.S @@ -89,7 +89,7 @@ BootSectorEntryPoint: NoVarStore: pushw %es # Set the 5th byte start @ 0:19000 to non-zero indicating we should init var store header in DxeIpl - movb %al, %es:($4) + movb %al, %es:4 jmp SaveVolumeId CheckVarStoreSize: @@ -100,7 +100,7 @@ CheckVarStoreSize: LoadVarStore: movb $0, %al - movb %al, %es:($4) + movb %al, %es:4 movw (%di), %cx # ES:DI = 1500:0 xorw %di, %di @@ -111,9 +111,9 @@ LoadVarStore: SaveVolumeId: popw %es movw VolId(%bp), %ax - movw %ax, %es:($0) # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId + movw %ax, %es:0 # Save Volume Id to 0:19000. we will find the correct volume according to this VolumeId movw VolId+2(%bp), %ax - movw %ax, %es:($2) + movw %ax, %es:2 # Read Efildr popw %cx @@ -307,11 +307,11 @@ Halt: ErrorString: .byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!', 0x0c - .org 0x01fa # Will cause build break + # .org 0x01fa # Will cause build break LBAOffsetForBootSector: .long 0x0 - .org 0x01fe # Will cause build break + # .org 0x01fe # Will cause build break .word 0xaa55 #****************************************************************************** @@ -324,7 +324,7 @@ LBAOffsetForBootSector: .equ WRITE_DATA_PORT_CMD, 0x0d1 # 8042 command to write the data port .equ ENABLE_A20_CMD, 0x0df # 8042 command to enable A20 -.org 0x200 # Will cause build break +# .org 0x200 # Will cause build break jmp start Em64String: .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 -- 2.39.2