mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
50db9e551a
commit
fd549a4db9
|
@ -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
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
all:
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue