## @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
$(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 \
$(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)
$(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
#------------------------------------------------------------------------------\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
.code: \r
.org 0x21000\r
\r
+.global _start\r
+_start:\r
+\r
.equ DEFAULT_HANDLER_SIZE, INT1 - INT0\r
\r
.macro jmpCommonIdtEntry \r
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
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
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
#------------------------------------------------------------------------------\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
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
#\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
#\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
.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
iret\r
\r
\r
- #.org 0x0ffe #Just for pass build\r
+ .org 0x0ffe\r
BlockSignature: \r
.word 0xaa55\r
\r
#------------------------------------------------------------------------------\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
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
#\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
#\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
.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
iret\r
\r
\r
- #.org 0x0ffe #Just for pass build\r
+ .org 0x0ffe\r
BlockSignature: \r
.word 0xaa55\r
\r
#------------------------------------------------------------------------------\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
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
#\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
.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