//\r
// INT 10 - VESA SuperVGA BIOS (VBE) - GET SuperVGA INFORMATION\r
//\r
- // AX = 4F00h\r
- // ES:DI -> buffer for SuperVGA information (see #00077)\r
+ // AX = 4F00h\r
+ // ES:DI -> buffer for SuperVGA information (see #00077)\r
// Return: AL = 4Fh if function supported\r
- // AH = status\r
- // 00h successful\r
- // ES:DI buffer filled\r
- // 01h failed\r
- // ---VBE v2.0---\r
- // 02h function not supported by current hardware configuration\r
- // 03h function invalid in current video mode\r
- // Desc: determine whether VESA BIOS extensions are present and the capabilities\r
- // supported by the display adapter\r
+ // AH = status\r
+ // 00h successful\r
+ // ES:DI buffer filled\r
+ // 01h failed\r
+ // ---VBE v2.0---\r
+ // 02h function not supported by current hardware configuration\r
+ // 03h function invalid in current video mode\r
+ // Desc: determine whether VESA BIOS extensions are present and the capabilities\r
+ // supported by the display adapter\r
//\r
gBS->SetMem (&Regs, sizeof (Regs), 0);\r
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_CONTROLLER_INFORMATION;\r
//\r
// INT 10 - VESA SuperVGA BIOS - GET SuperVGA MODE INFORMATION\r
//\r
- // AX = 4F01h\r
- // CX = SuperVGA video mode (see #04082 for bitfields)\r
- // ES:DI -> 256-byte buffer for mode information (see #00079)\r
+ // AX = 4F01h\r
+ // CX = SuperVGA video mode (see #04082 for bitfields)\r
+ // ES:DI -> 256-byte buffer for mode information (see #00079)\r
// Return: AL = 4Fh if function supported\r
- // AH = status\r
- // 00h successful\r
- // ES:DI buffer filled\r
- // 01h failed\r
- // Desc: determine the attributes of the specified video mode\r
+ // AH = status\r
+ // 00h successful\r
+ // ES:DI buffer filled\r
+ // 01h failed\r
+ // Desc: determine the attributes of the specified video mode\r
//\r
gBS->SetMem (&Regs, sizeof (Regs), 0);\r
Regs.X.AX = VESA_BIOS_EXTENSIONS_RETURN_MODE_INFORMATION;\r
/** @file\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation \r
+Copyright (c) 2006 - 2009, Intel Corporation \r
All rights reserved. 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
#define BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS(a) CR (a, BIOS_VIDEO_DEV, GraphicsOutput, BIOS_VIDEO_DEV_SIGNATURE)\r
#define BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS(a) CR (a, BIOS_VIDEO_DEV, VgaMiniPort, BIOS_VIDEO_DEV_SIGNATURE)\r
\r
-#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r
+#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff\r
\r
#define EFI_SEGMENT(_Adr) (UINT16) ((UINT16) (((UINTN) (_Adr)) >> 4) & 0xf000)\r
#define EFI_OFFSET(_Adr) (UINT16) (((UINT16) ((UINTN) (_Adr))) & 0xffff)\r
# This module provides EFI_GRAPHIC_OUT_PROTOCOL based on functions of video \r
# on legacy BIOS.\r
# \r
-# Copyright (c) 2006 - 2008, Intel Corporation\r
+# Copyright (c) 2006 - 2009, Intel Corporation\r
# All rights reserved. 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
gEfiVgaMiniPortProtocolGuid\r
gEfiLegacy8259ProtocolGuid\r
gEfiEdidDiscoveredProtocolGuid\r
- gEfiEdidActiveProtocolGuid
\ No newline at end of file
+ gEfiEdidActiveProtocolGuid\r
xorw %bx, %bx\r
\r
FindEFILDR: \r
- cmpl $LOADER_FILENAME_PART1, (%di) # Compare to "EFIL"\r
+ cmpl $LOADER_FILENAME_PART1, (%di) # Compare to "EFIL"\r
jne FindVARSTORE\r
cmpl $LOADER_FILENAME_PART2, 4(%di) \r
jne FindVARSTORE\r
FindEFILDR: \r
cmpl $LOADER_FILENAME_PART1, (%di) # Compare to "EFIL"\r
jne FindVARSTORE\r
- cmpl $LOADER_FILENAME_PART2, 4(%di) \r
+ cmpl $LOADER_FILENAME_PART2, 4(%di) \r
jne FindVARSTORE\r
cmpl $LOADER_FILENAME_PART3, 7(%di) \r
jne FindVARSTORE\r
LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler\r
movw %bx, (%edi) # write bits 15..0 of offset\r
movw $0x20, 2(%edi) # SYS_CODE_SEL from GDT\r
- movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
+ movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
movw %ax, 6(%edi) # write bits 31..16 of offset\r
addl $8, %edi # move up to next descriptor\r
addw DEFAULT_HANDLER_SIZE, %bx # move to next entry point\r
# within 255 bytes of the common entry. This must\r
# be done to maintain the consistency of the size\r
# of entry points...\r
- .byte 0xe9 # jmp 16 bit relative\r
- .long commonIdtEntry - . - 4 # offset to jump to\r
+ .byte 0xe9 # jmp 16 bit relative\r
+ .long commonIdtEntry - . - 4 # offset to jump to\r
.endm\r
\r
\r
call ClearScreen\r
\r
# Populate IDT with meaningful offsets for exception handlers...\r
- sidt Idtr \r
- \r
+ sidt Idtr \r
+ \r
\r
- movl Halt, %eax\r
+ movl Halt, %eax\r
movl %eax,%ebx # use bx to copy 15..0 to descriptors\r
shrl $16,%eax # use ax to copy 31..16 to descriptors \r
# 63..32 of descriptors is 0\r
movl $0x78,%ecx # 78h IDT entries to initialize with unique entry points (exceptions)\r
- movl (Idtr + 2), %esi\r
+ movl (Idtr + 2), %esi\r
movl (%esi),%edi\r
\r
LOOP_1: # loop through all IDT entries exception handlers and initialize to default handler\r
movw %bx, (%edi) # write bits 15..0 of offset\r
movw $0x38, 2(%edi) # SYS_CODE_SEL64 from GDT\r
- movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
+ movw $(0x0e00 | 0x8000), 4(%edi) # type = 386 interrupt gate, present\r
movw %ax, 6(%edi) # write bits 31..16 of offset\r
movl $0, 8(%edi) # write bits 31..16 of offset \r
addl $16, %edi # move up to next descriptor\r
movl 0x30(%ebp),%edi # edi = [[22000 + [22014] + 3c] + 2c] = ImageBase (63..32 is zero, ignore)\r
movl 0x28(%ebp),%eax # eax = [[22000 + [22014] + 3c] + 24] = EntryPoint\r
addl %edi,%eax # eax = ImageBase + EntryPoint\r
- movl %ebx, EfiLdrOffset \r
+ movl %ebx, EfiLdrOffset \r
movl %eax, (%ebx) # Modify far jump instruction for correct entry point\r
\r
- movw 6(%ebp), %bx # bx = Number of sections\r
+ movw 6(%ebp), %bx # bx = Number of sections\r
xorl %eax,%eax\r
- movw 0x14(%ebp), %ax # ax = Optional Header Size\r
+ movw 0x14(%ebp), %ax # ax = Optional Header Size\r
addl %eax,%ebp\r
addl $0x18,%ebp # ebp = Start of 1st Section\r
\r
cmpw $0,%bx\r
jne SectionLoop\r
\r
- movl (Idtr), %eax # get size of IDT\r
- movzx (%edx), %eax\r
+ movl (Idtr), %eax # get size of IDT\r
+ movzx (%edx), %eax\r
.byte 0xff\r
.byte 0xc0\r
# inc eax\r
- addl 2(%edx), %eax # add to base of IDT to get location of memory map...\r
+ addl 2(%edx), %eax # add to base of IDT to get location of memory map...\r
xorl %ecx,%ecx\r
movl %eax,%ecx # put argument to RCX\r
\r
ja PrintDefaultString\r
PrintExceptionString: \r
shll $3,%eax ## multiply by 8 to get offset from StringTable to actual string address\r
- addl StringTable, %eax\r
+ addl StringTable, %eax\r
movl (%eax),%esi\r
jmp PrintTheString\r
PrintDefaultString: \r
- movl IntUnknownString, %esi\r
+ movl IntUnknownString, %esi\r
# patch Int number\r
movl %eax,%edx\r
call A2C\r
movb %al,(%esi)\r
PrintTheString: \r
call PrintString\r
- movl String2, %esi\r
+ movl String2, %esi\r
call PrintString\r
.byte 0x48\r
movl 19*8(%ebp),%eax # CS\r
call PrintQword\r
movb $':', %al\r
- movb %al, (%edi)\r
+ movb %al, (%edi)\r
addl $2,%edi\r
.byte 0x48\r
movl 18*8(%ebp),%eax # RIP\r
call PrintQword\r
- movl String3, %esi\r
+ movl String3, %esi\r
call PrintString\r
\r
movl $0xb8140,%edi\r
\r
- movl StringRax, %esi\r
+ movl StringRax, %esi\r
call PrintString\r
.byte 0x48\r
movl 15*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringRcx, %esi\r
+ movl StringRcx, %esi\r
call PrintString\r
.byte 0x48\r
movl 14*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringRdx, %esi\r
+ movl StringRdx, %esi\r
call PrintString\r
.byte 0x48\r
movl 13*8(%ebp),%eax\r
\r
movl $0xb81e0,%edi\r
\r
- movl StringRbx, %esi\r
+ movl StringRbx, %esi\r
call PrintString\r
.byte 0x48\r
movl 12*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringRsp, %esi\r
+ movl StringRsp, %esi\r
call PrintString\r
.byte 0x48\r
movl 21*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringRbp, %esi\r
+ movl StringRbp, %esi\r
call PrintString\r
.byte 0x48\r
movl 10*8(%ebp),%eax\r
\r
movl $0xb8280,%edi\r
\r
- movl StringRsi, %esi\r
+ movl StringRsi, %esi\r
call PrintString\r
.byte 0x48\r
movl 9*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringRdi, %esi\r
+ movl StringRdi, %esi\r
call PrintString\r
.byte 0x48\r
movl 8*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringEcode, %esi\r
+ movl StringEcode, %esi\r
call PrintString\r
.byte 0x48\r
movl 17*8(%ebp),%eax\r
\r
movl $0xb8320,%edi\r
\r
- movl StringR8, %esi\r
+ movl StringR8, %esi\r
call PrintString\r
.byte 0x48\r
movl 7*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringR9, %esi\r
+ movl StringR9, %esi\r
call PrintString\r
.byte 0x48\r
movl 6*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringR10, %esi\r
+ movl StringR10, %esi\r
call PrintString\r
.byte 0x48\r
movl 5*8(%ebp),%eax\r
\r
movl $0xb83c0,%edi\r
\r
- movl StringR11, %esi\r
+ movl StringR11, %esi\r
call PrintString\r
.byte 0x48\r
movl 4*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringR12, %esi\r
+ movl StringR12, %esi\r
call PrintString\r
.byte 0x48\r
movl 3*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringR13, %esi\r
+ movl StringR13, %esi\r
call PrintString\r
.byte 0x48\r
movl 2*8(%ebp),%eax\r
\r
movl $0xb8460,%edi\r
\r
- movl StringR14, %esi\r
+ movl StringR14, %esi\r
call PrintString\r
.byte 0x48\r
movl 1*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringR15, %esi\r
+ movl StringR15, %esi\r
call PrintString\r
.byte 0x48\r
movl 0*8(%ebp),%eax\r
call PrintQword\r
\r
- movl StringSs, %esi\r
+ movl StringSs, %esi\r
call PrintString\r
.byte 0x48\r
movl 22*8(%ebp),%eax\r
\r
movl $0xb8500,%edi\r
\r
- movl StringRflags, %esi\r
+ movl StringRflags, %esi\r
call PrintString\r
.byte 0x48\r
movl 20*8(%ebp),%eax\r
movl (%esi),%eax\r
call PrintQword\r
addl $8,%esi\r
- mov $0x00, %al \r
+ mov $0x00, %al \r
movb %al,(%edi)\r
addl $2,%edi\r
loop InnerLoop\r
movl (%esi),%eax\r
call PrintQword\r
addl $8,%esi\r
- movb $0x00, %al\r
+ movb $0x00, %al\r
movb %al,(%edi)\r
addl $2,%edi\r
loop InnerLoop1\r
PrintString: \r
pushl %eax\r
LN_C2: \r
- movb (%esi), %al\r
+ movb (%esi), %al\r
cmpb $0,%al\r
je LN_C3\r
- movb %al, (%edi)\r
+ movb %al, (%edi)\r
.byte 0xff\r
.byte 0xc6\r
# inc esi\r
jle @f\r
addb $7,%bl\r
@@: \r
- movb %bl, (%edi)\r
+ movb %bl, (%edi)\r
addl $2,%edi\r
loop looptop\r
#wbinvd\r
pushl %eax\r
pushl %ecx\r
\r
- movb $0x00, %al\r
+ movb $0x00, %al\r
movb $0xc,%ah\r
movl $0xb8000,%edi\r
movl $80*24,%ecx\r
LN_C4: \r
- movw %ax, (%edi)\r
+ movw %ax, (%edi)\r
addl $2,%edi\r
loop LN_C4\r
movl $0xb8000,%edi\r
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
movw $0x7bfc,%bp # bp = 0x7bfc\r
movl %esi,%eax # eax = Start LBA\r
xorl %edx,%edx # edx = 0\r
- movzwl (%bp), %ebx # bx = MaxSector\r
+ movzwl (%bp), %ebx # bx = MaxSector\r
divl %ebx # ax = StartLBA / MaxSector\r
incw %dx # dx = (StartLBA % MaxSector) + 1\r
\r
MemMapDone: \r
leal MemoryMap, %eax\r
subl %eax,%edi # Get the address of the memory map\r
- movl %edi, MemoryMapSize # Save the size of the memory map\r
+ movl %edi, MemoryMapSize # Save the size of the memory map\r
\r
xorl %ebx,%ebx\r
movw %cs,%bx # BX=segment\r
\r
leal OffsetIn32BitProtectedMode, %eax\r
addl $0x20000+0x6,%eax\r
- movl %eax, OffsetIn32BitProtectedMode \r
+ movl %eax, OffsetIn32BitProtectedMode \r
\r
leal OffsetInLongMode, %eax\r
addl $0x20000+0x6,%eax\r
\r
.p2align 1\r
\r
- gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
+ gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
.long 0 # (GDT base gets set above)\r
##############################################################################\r
# global descriptor table (GDT)\r
IDT_BASE: \r
# divide by zero (INT 0)\r
.equ DIV_ZERO_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# debug exception (INT 1)\r
.equ DEBUG_EXCEPT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# NMI (INT 2)\r
.equ NMI_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# soft breakpoint (INT 3)\r
.equ BREAKPOINT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# overflow (INT 4)\r
.equ OVERFLOW_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# bounds check (INT 5)\r
.equ BOUNDS_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid opcode (INT 6)\r
.equ INVALID_OPCODE_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# device not available (INT 7)\r
.equ DEV_NOT_AVAIL_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# double fault (INT 8)\r
.equ DOUBLE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Coprocessor segment overrun - reserved (INT 9)\r
.equ RSVD_INTR_SEL1, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid TSS (INT 0ah)\r
.equ INVALID_TSS_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# segment not present (INT 0bh)\r
.equ SEG_NOT_PRESENT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# stack fault (INT 0ch)\r
.equ STACK_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# general protection (INT 0dh)\r
.equ GP_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# page fault (INT 0eh)\r
.equ PAGE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Intel reserved - do not use (INT 0fh)\r
.equ RSVD_INTR_SEL2, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# floating point error (INT 10h)\r
.equ FLT_POINT_ERR_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# alignment check (INT 11h)\r
.equ ALIGNMENT_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# machine check (INT 12h)\r
.equ MACHINE_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# SIMD floating-point exception (INT 13h)\r
.equ SIMD_EXCEPTION_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# 85 unspecified descriptors, First 12 of them are reserved, the rest are avail\r
- .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
+ .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
\r
# IRQ 0 (System timer) - (INT 68h)\r
.equ IRQ0_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 1 (8042 Keyboard controller) - (INT 69h)\r
.equ IRQ1_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Reserved - IRQ 2 redirect (IRQ 2) - DO NOT USE!!! - (INT 6ah)\r
.equ IRQ2_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 3 (COM 2) - (INT 6bh)\r
.equ IRQ3_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 4 (COM 1) - (INT 6ch)\r
.equ IRQ4_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 5 (LPT 2) - (INT 6dh)\r
.equ IRQ5_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 6 (Floppy controller) - (INT 6eh)\r
.equ IRQ6_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 7 (LPT 1) - (INT 6fh)\r
.equ IRQ7_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 8 (RTC Alarm) - (INT 70h)\r
.equ IRQ8_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 9 - (INT 71h)\r
.equ IRQ9_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 10 - (INT 72h)\r
.equ IRQ10_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 11 - (INT 73h)\r
.equ IRQ11_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 12 (PS/2 mouse) - (INT 74h)\r
.equ IRQ12_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 13 (Floating point error) - (INT 75h)\r
.equ IRQ13_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 14 (Secondary IDE) - (INT 76h)\r
.equ IRQ14_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 15 (Primary IDE) - (INT 77h)\r
.equ IRQ15_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
IDT_END: \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 #Just for pass build\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 #Just for pass build\r
BlockSignature: \r
.word 0xaa55\r
\r
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
movw $0x7bfc,%bp # bp = 0x7bfc\r
movl %esi,%eax # eax = Start LBA\r
xorl %edx,%edx # edx = 0\r
- movzwl (%bp), %ebx # bx = MaxSector\r
+ movzwl (%bp), %ebx # bx = MaxSector\r
divl %ebx # ax = StartLBA / MaxSector\r
incw %dx # dx = (StartLBA % MaxSector) + 1\r
\r
MemMapDone: \r
leal MemoryMap, %eax\r
subl %eax,%edi # Get the address of the memory map\r
- movl %edi, MemoryMapSize # Save the size of the memory map\r
+ movl %edi, MemoryMapSize # Save the size of the memory map\r
\r
xorl %ebx,%ebx\r
movw %cs,%bx # BX=segment\r
\r
leal OffsetIn32BitProtectedMode, %eax\r
addl $0x20000+0x6,%eax\r
- movl %eax, OffsetIn32BitProtectedMode \r
+ movl %eax, OffsetIn32BitProtectedMode \r
\r
leal OffsetInLongMode, %eax\r
addl $0x20000+0x6,%eax\r
\r
.p2align 1\r
\r
- gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
+ gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
.long 0 # (GDT base gets set above)\r
##############################################################################\r
# global descriptor table (GDT)\r
IDT_BASE: \r
# divide by zero (INT 0)\r
.equ DIV_ZERO_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# debug exception (INT 1)\r
.equ DEBUG_EXCEPT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# NMI (INT 2)\r
.equ NMI_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# soft breakpoint (INT 3)\r
.equ BREAKPOINT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# overflow (INT 4)\r
.equ OVERFLOW_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# bounds check (INT 5)\r
.equ BOUNDS_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid opcode (INT 6)\r
.equ INVALID_OPCODE_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# device not available (INT 7)\r
.equ DEV_NOT_AVAIL_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# double fault (INT 8)\r
.equ DOUBLE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Coprocessor segment overrun - reserved (INT 9)\r
.equ RSVD_INTR_SEL1, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid TSS (INT 0ah)\r
.equ INVALID_TSS_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# segment not present (INT 0bh)\r
.equ SEG_NOT_PRESENT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# stack fault (INT 0ch)\r
.equ STACK_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# general protection (INT 0dh)\r
.equ GP_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# page fault (INT 0eh)\r
.equ PAGE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Intel reserved - do not use (INT 0fh)\r
.equ RSVD_INTR_SEL2, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# floating point error (INT 10h)\r
.equ FLT_POINT_ERR_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# alignment check (INT 11h)\r
.equ ALIGNMENT_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# machine check (INT 12h)\r
.equ MACHINE_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# SIMD floating-point exception (INT 13h)\r
.equ SIMD_EXCEPTION_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# 85 unspecified descriptors, First 12 of them are reserved, the rest are avail\r
- .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
+ .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
\r
# IRQ 0 (System timer) - (INT 68h)\r
.equ IRQ0_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 1 (8042 Keyboard controller) - (INT 69h)\r
.equ IRQ1_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Reserved - IRQ 2 redirect (IRQ 2) - DO NOT USE!!! - (INT 6ah)\r
.equ IRQ2_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 3 (COM 2) - (INT 6bh)\r
.equ IRQ3_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 4 (COM 1) - (INT 6ch)\r
.equ IRQ4_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 5 (LPT 2) - (INT 6dh)\r
.equ IRQ5_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 6 (Floppy controller) - (INT 6eh)\r
.equ IRQ6_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 7 (LPT 1) - (INT 6fh)\r
.equ IRQ7_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 8 (RTC Alarm) - (INT 70h)\r
.equ IRQ8_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 9 - (INT 71h)\r
.equ IRQ9_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 10 - (INT 72h)\r
.equ IRQ10_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 11 - (INT 73h)\r
.equ IRQ11_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 12 (PS/2 mouse) - (INT 74h)\r
.equ IRQ12_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 13 (Floating point error) - (INT 75h)\r
.equ IRQ13_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 14 (Secondary IDE) - (INT 76h)\r
.equ IRQ14_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 15 (Primary IDE) - (INT 77h)\r
.equ IRQ15_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
IDT_END: \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 #Just for pass build\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 #Just for pass build\r
BlockSignature: \r
.word 0xaa55\r
\r
.stack: \r
.486p: \r
.code16\r
- \r
+ \r
.equ FAT_DIRECTORY_ENTRY_SIZE, 0x020\r
.equ FAT_DIRECTORY_ENTRY_SHIFT, 5\r
.equ BLOCK_SIZE, 0x0200\r
.word 0 # offset 31:16\r
\r
# 85 unspecified descriptors, First 12 of them are reserved, the rest are avail\r
- .fill 85 * 8, 1, 0 # db (85 * 8) dup(0)\r
+ .fill 85 * 8, 1, 0 # db (85 * 8) dup(0)\r
\r
# IRQ 0 (System timer) - (INT 0x68)\r
.equ IRQ0_SEL, .-IDT_BASE\r
\r
BootSectorEntryPoint: \r
# ASSUME ds:@code"\r
- # ASSUME ss:@code"\r
+ # ASSUME ss:@code"\r
# ds = 1000, es = 2000 + x (size of first cluster >> 4)\r
# cx = Start Cluster of EfiLdr\r
# dx = Start Cluster of Efivar.bin\r
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
LoadVarStore: \r
movb $0,%al\r
movb %al, %es:(4)\r
- movw (%di), %cx\r
+ movw (%di), %cx\r
# ES:DI = 1500:0\r
xorw %di,%di\r
pushw %es\r
movw VolId(%bp), %ax\r
movw %ax, %es:(0) \r
movw VolId+2(%bp), %ax\r
- movw %ax, %es:(2)\r
+ movw %ax, %es:(2)\r
\r
# Read Efildr\r
popw %cx\r
pushw %si # Save si\r
movw %ax,%si # si = FatOffset\r
shrw $BLOCK_SHIFT, %ax # ax = FatOffset >> BLOCK_SHIFT\r
- addw ReservedSectors(%bp), %ax # ax = FatSectorNumber = ReservedSectors + (FatOffset >> BLOCK_OFFSET)\r
+ addw ReservedSectors(%bp), %ax # ax = FatSectorNumber = ReservedSectors + (FatOffset >> BLOCK_OFFSET)\r
andw $BLOCK_MASK, %si # si = FatOffset & BLOCK_MASK\r
cmpw %dx,%ax # Compare FatSectorNumber to CachedFatSectorNumber\r
je SkipFatRead\r
popw %es\r
movw %ax,%dx # CachedFatSectorNumber = FatSectorNumber\r
SkipFatRead: \r
- movw (%si), %bx # bx = NextClusterNumber\r
+ movw (%si), %bx # bx = NextClusterNumber\r
movw %cx,%ax # ax = ClusterNumber\r
andw $1,%ax # See if this is an odd cluster number\r
je EvenFatEntry\r
movw %bx,%cx # ClusterNumber = NextClusterNumber\r
subw $2,%ax # ax = StartCluster - 2\r
xorb %bh,%bh\r
- movb SectorsPerCluster(%bp), %bl # bx = SectorsPerCluster\r
+ movb SectorsPerCluster(%bp), %bl # bx = SectorsPerCluster\r
mulw %bx # ax = (StartCluster - 2) * SectorsPerCluster\r
- addw (%bp), %ax # ax = FirstClusterLBA + (StartCluster-2)*SectorsPerCluster\r
+ addw (%bp), %ax # ax = FirstClusterLBA + (StartCluster-2)*SectorsPerCluster\r
pushw %ax # save start sector\r
movw %si,%ax # ax = NumberOfClusters\r
mulw %bx # ax = NumberOfClusters * SectorsPerCluster\r
divl %ebx # ax = StartLBA / MaxSector\r
incw %dx # dx = (StartLBA % MaxSector) + 1\r
\r
- movw (%bp), %bx # bx = MaxSector\r
+ movw (%bp), %bx # bx = MaxSector\r
subw %dx,%bx # bx = MaxSector - Sector\r
incw %bx # bx = MaxSector - Sector + 1\r
cmpw %bx,%cx # Compare (Blocks) to (MaxSector - Sector + 1)\r
ErrorString: \r
.byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!',0x0c\r
\r
- .org 0x01fa\r
+ .org 0x01fa\r
LBAOffsetForBootSector: \r
.long 0x0\r
\r
- .org 0x01fe\r
+ .org 0x01fe\r
.word 0xaa55\r
\r
#******************************************************************************\r
.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\r
+ .org 0x200\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
MemMapDone: \r
leal MemoryMap, %eax\r
subl %eax,%edi # Get the address of the memory map\r
- movl %edi, MemoryMapSize # Save the size of the memory map\r
+ movl %edi, MemoryMapSize # Save the size of the memory map\r
\r
xorl %ebx,%ebx\r
movw %cs,%bx # BX=segment\r
\r
leal OffsetIn32BitProtectedMode, %eax\r
addl $0x20000+0x6,%eax\r
- movl %eax, OffsetIn32BitProtectedMode \r
+ movl %eax, OffsetIn32BitProtectedMode \r
\r
leal OffsetInLongMode, %eax\r
addl $0x20000+0x6,%eax\r
\r
.p2align 1\r
\r
- gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
+ gdtr: .long GDT_END - GDT_BASE - 1 # GDT limit \r
.long 0 # (GDT base gets set above)\r
##############################################################################\r
# global descriptor table (GDT)\r
IDT_BASE: \r
# divide by zero (INT 0)\r
.equ DIV_ZERO_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# debug exception (INT 1)\r
.equ DEBUG_EXCEPT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# NMI (INT 2)\r
.equ NMI_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# soft breakpoint (INT 3)\r
.equ BREAKPOINT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# overflow (INT 4)\r
.equ OVERFLOW_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# bounds check (INT 5)\r
.equ BOUNDS_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid opcode (INT 6)\r
.equ INVALID_OPCODE_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# device not available (INT 7)\r
.equ DEV_NOT_AVAIL_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# double fault (INT 8)\r
.equ DOUBLE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Coprocessor segment overrun - reserved (INT 9)\r
.equ RSVD_INTR_SEL1, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# invalid TSS (INT 0ah)\r
.equ INVALID_TSS_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# segment not present (INT 0bh)\r
.equ SEG_NOT_PRESENT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# stack fault (INT 0ch)\r
.equ STACK_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# general protection (INT 0dh)\r
.equ GP_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# page fault (INT 0eh)\r
.equ PAGE_FAULT_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Intel reserved - do not use (INT 0fh)\r
.equ RSVD_INTR_SEL2, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# floating point error (INT 10h)\r
.equ FLT_POINT_ERR_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# alignment check (INT 11h)\r
.equ ALIGNMENT_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# machine check (INT 12h)\r
.equ MACHINE_CHECK_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# SIMD floating-point exception (INT 13h)\r
.equ SIMD_EXCEPTION_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# 85 unspecified descriptors, First 12 of them are reserved, the rest are avail\r
- .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
+ .fill 85 * 16, 1, 0 # db (85 * 16) dup(0)\r
\r
# IRQ 0 (System timer) - (INT 68h)\r
.equ IRQ0_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 1 (8042 Keyboard controller) - (INT 69h)\r
.equ IRQ1_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# Reserved - IRQ 2 redirect (IRQ 2) - DO NOT USE!!! - (INT 6ah)\r
.equ IRQ2_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 3 (COM 2) - (INT 6bh)\r
.equ IRQ3_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 4 (COM 1) - (INT 6ch)\r
.equ IRQ4_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 5 (LPT 2) - (INT 6dh)\r
.equ IRQ5_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 6 (Floppy controller) - (INT 6eh)\r
.equ IRQ6_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 7 (LPT 1) - (INT 6fh)\r
.equ IRQ7_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 8 (RTC Alarm) - (INT 70h)\r
.equ IRQ8_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 9 - (INT 71h)\r
.equ IRQ9_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 10 - (INT 72h)\r
.equ IRQ10_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 11 - (INT 73h)\r
.equ IRQ11_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 12 (PS/2 mouse) - (INT 74h)\r
.equ IRQ12_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 13 (Floating point error) - (INT 75h)\r
.equ IRQ13_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 14 (Secondary IDE) - (INT 76h)\r
.equ IRQ14_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
# IRQ 15 (Primary IDE) - (INT 77h)\r
.equ IRQ15_SEL, .-IDT_BASE\r
- .word 0 # offset 15:0\r
+ .word 0 # offset 15:0\r
.long SYS_CODE64_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # type = 386 interrupt gate, present\r
- .word 0 # offset 31:16\r
- .long 0 # offset 63:32\r
- .long 0 # 0 for reserved\r
+ .word 0 # offset 31:16\r
+ .long 0 # offset 63:32\r
+ .long 0 # 0 for reserved\r
\r
IDT_END: \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
+ .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\r
+ .org 0x0ffe\r
BlockSignature: \r
.word 0xaa55\r
\r
#EXTERN ExceptionHandler: NEAR\r
#EXTERN mTimerVector: DWORD\r
\r
- .data\r
- ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
+ .data\r
+ ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
ASM_PFX(mExceptionCodeSize): .long 9\r
\r
- .text\r
- ASM_GLOBAL ASM_PFX(InitDescriptor)\r
+ .text\r
+ ASM_GLOBAL ASM_PFX(InitDescriptor)\r
\r
ASM_PFX(InitDescriptor):\r
movl $GDT_BASE,%eax # EAX=PHYSICAL address of gdt\r
# UINTN Vector,\r
# VOID (*Handler)(VOID)\r
# )\r
- ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
+ ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
ASM_PFX(InstallInterruptHandler):\r
# Vector:DWORD @ 4(%esp)\r
# Handler:DWORD @ 8(%esp)\r
pop %edi\r
ret\r
\r
- .macro JmpCommonIdtEntry\r
+ .macro JmpCommonIdtEntry\r
# jmp commonIdtEntry - this must be hand coded to keep the assembler from\r
# using a 8 bit reletive jump when the entries are\r
# within 255 bytes of the common entry. This must\r
# of entry points...\r
.byte 0xe9 # jmp 16 bit reletive \r
.long commonIdtEntry - . - 4 # offset to jump to\r
- .endm\r
+ .endm\r
\r
.p2align 1\r
- ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
ASM_PFX(SystemExceptionHandler):\r
INT0:\r
pushl $0x0 # push error code place holder on the stack\r
JmpCommonIdtEntry\r
\r
INTUnknown:\r
- .rept (32 - 20)\r
+ .rept (32 - 20)\r
pushl $0x0 # push error code place holder on the stack\r
# push xxh # push vector number\r
.byte 0x6a\r
.byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
JmpCommonIdtEntry\r
- .endr\r
+ .endr\r
\r
- ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
ASM_PFX(SystemTimerHandler):\r
pushl $0\r
pushl $ASM_PFX(mTimerVector)\r
# data\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
\r
- .data\r
+ .data\r
.p2align 2\r
\r
-gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
+gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
.long 0 # (GDT base gets set above)\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
# global descriptor table (GDT)\r
\r
\r
\r
-idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
+idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
.long 0 # (IDT base gets set above)\r
#;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;\r
# interrupt descriptor table (IDT)\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .rept (32 - 20)\r
+ .rept (32 - 20)\r
.short 0 # offset 15:0\r
.short SYS_CODE_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
- .endr\r
+ .endr\r
\r
# 72 unspecified descriptors\r
- .fill 72 * 8, 1, 0\r
+ .fill 72 * 8, 1, 0\r
\r
# IRQ 0 (System timer) - (INT 0x68)\r
IRQ0_SEL = .-IDT_BASE\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .fill 1 * 8, 1, 0\r
+ .fill 1 * 8, 1, 0\r
\r
IDT_END:\r
\r
#EXTERN ExceptionHandler: NEAR\r
#EXTERN mTimerVector: DWORD\r
\r
- .data\r
- ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
+ .data\r
+ ASM_GLOBAL ASM_PFX(mExceptionCodeSize)\r
ASM_PFX(mExceptionCodeSize): .long 9\r
\r
- .text\r
- ASM_GLOBAL ASM_PFX(InitDescriptor)\r
+ .text\r
+ ASM_GLOBAL ASM_PFX(InitDescriptor)\r
\r
ASM_PFX(InitDescriptor):\r
movq $GDT_BASE,%rax # EAX=PHYSICAL address of gdt\r
# UINTN Vector,\r
# VOID (*Handler)(VOID)\r
# )\r
- ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
+ ASM_GLOBAL ASM_PFX(InstallInterruptHandler)\r
ASM_PFX(InstallInterruptHandler):\r
# Vector:DWORD @ 4(%esp)\r
# Handler:DWORD @ 8(%esp)\r
pop %rbx\r
ret\r
\r
- .macro JmpCommonIdtEntry\r
+ .macro JmpCommonIdtEntry\r
# jmp commonIdtEntry - this must be hand coded to keep the assembler from\r
# using a 8 bit reletive jump when the entries are\r
# within 255 bytes of the common entry. This must\r
# of entry points...\r
.byte 0xe9 # jmp 16 bit reletive \r
.long commonIdtEntry - . - 4 # offset to jump to\r
- .endm\r
+ .endm\r
\r
.p2align 1\r
- ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemExceptionHandler)\r
ASM_PFX(SystemExceptionHandler):\r
INT0:\r
push $0x0 # push error code place holder on the stack\r
JmpCommonIdtEntry\r
\r
INTUnknown:\r
- .rept (32 - 20)\r
+ .rept (32 - 20)\r
push $0x0 # push error code place holder on the stack\r
# push xxh # push vector number\r
.byte 0x6a\r
.byte ( . - INTUnknown - 3 ) / 9 + 20 # vector number\r
JmpCommonIdtEntry\r
- .endr\r
+ .endr\r
\r
- ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
+ ASM_GLOBAL ASM_PFX(SystemTimerHandler)\r
ASM_PFX(SystemTimerHandler):\r
push $0\r
push $ASM_PFX(mTimerVector)\r
# data\r
##############################################################################\r
\r
- .data\r
+ .data\r
.p2align 4\r
\r
-gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
+gdtr: .short GDT_END - GDT_BASE - 1 # GDT limit\r
.quad 0 # (GDT base gets set above)\r
##############################################################################\r
# global descriptor table (GDT)\r
\r
\r
\r
-idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
+idtr: .short IDT_END - IDT_BASE - 1 # IDT limit\r
.quad 0 # (IDT base gets set above)\r
##############################################################################\r
# interrupt descriptor table (IDT)\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .rept (32 - 20)\r
+ .rept (32 - 20)\r
.short 0 # offset 15:0\r
.short SYS_CODE_SEL # selector 15:0\r
.byte 0 # 0 for interrupt gate\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
- .endr\r
+ .endr\r
\r
# 72 unspecified descriptors\r
- .fill 72 * 8, 1, 0\r
+ .fill 72 * 8, 1, 0\r
\r
# IRQ 0 (System timer) - (INT 0x68)\r
IRQ0_SEL = .-IDT_BASE\r
.byte 0x0e | 0x80 # (10001110)type = 386 interrupt gate, present\r
.short 0 # offset 31:16\r
\r
- .fill 16, 1, 0\r
+ .fill 16, 1, 0\r
\r
IDT_END:\r
\r
/*++\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation\r
+Copyright (c) 2006 - 2009, Intel Corporation\r
All rights reserved. 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
\r
@param[in] DataSize Size of data. 0 means delete\r
\r
- @param[in] Attributes Attribues of the variable\r
+ @param[in] Attributes Attribues of the variable\r
\r
@param[in] Variable The variable information which is used to keep track of variable usage.\r
\r
\r
@param[in] DataSize Size of data. 0 means delete\r
\r
- @param[in] Attributes Attribues of the variable\r
+ @param[in] Attributes Attribues of the variable\r
\r
@param[in] Variable The variable information which is used to keep track of variable usage.\r
\r
#/*++\r
#\r
-# Copyright (c) 2006 - 2007, Intel Corporation \r
+# Copyright (c) 2006 - 2009, Intel Corporation \r
# All rights reserved. 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
[Pcd]\r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdPlatformBootTimeOut \r
gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile \r
-
\ No newline at end of file
+ \r
/*++\r
\r
-Copyright (c) 2006 - 2007, Intel Corporation \r
+Copyright (c) 2006 - 2009, Intel Corporation \r
All rights reserved. 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
// (CONSOLE_IN | STD_ERROR)\r
// },\r
// {\r
-// (EFI_DEVICE_PATH_PROTOCOL *) &gDummyPciVgaDevicePath,\r
-// CONSOLE_OUT\r
+// (EFI_DEVICE_PATH_PROTOCOL *) &gDummyPciVgaDevicePath,\r
+// CONSOLE_OUT\r
// },\r
// {\r
-// (EFI_DEVICE_PATH_PROTOCOL *) &gDummyPciSerialDevicePath,\r
-// (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
+// (EFI_DEVICE_PATH_PROTOCOL *) &gDummyPciSerialDevicePath,\r
+// (CONSOLE_OUT | CONSOLE_IN | STD_ERROR)\r
// },\r
{\r
(EFI_DEVICE_PATH_PROTOCOL*) &gUsbClassKeyboardDevicePath, \r
# and ITC could be programmed by OS, it cannot be used by SMM drivers\r
# and runtime drivers, ACPI timer is recommended for SMM drivers and RUNTIME\r
# drivers.\r
-# Copyright (c) 2007, Intel Corporation.\r
+# Copyright (c) 2007 - 2009, Intel Corporation.\r
#\r
# All rights reserved. This program and the accompanying materials\r
# are licensed and made available under the terms and conditions of the BSD License\r
[Guids]\r
gEfiAcpiDescriptionGuid\r
\r
-
\ No newline at end of file
+ \r
/*++\r
\r
-Copyright (c) 2005 - 2007, Intel Corporation \r
+Copyright (c) 2005 - 2009, Intel Corporation \r
All rights reserved. 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
Data = Value;\r
Index = 0;\r
for (Data = Value; Data != 0; Data >>= 1) {\r
- Index ++;\r
+ Index ++;\r
}\r
Value |= ((UINT32)(-1) << Index); \r
\r
/*++\r
\r
-Copyright (c) 2005 - 2007, Intel Corporation \r
+Copyright (c) 2005 - 2009, Intel Corporation \r
All rights reserved. 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
PCI_IO_DEVICE *PciIoDevice;\r
\r
if (Buffer == NULL){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
PCI_IO_DEVICE *PciIoDevice;\r
\r
if (Buffer == NULL){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
PCI_IO_DEVICE *PciIoDevice;\r
\r
if (Buffer == NULL){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
PCI_IO_DEVICE *PciIoDevice;\r
\r
if (Buffer == NULL){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
}\r
\r
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
PCI_IO_DEVICE *PciIoDevice;\r
\r
if( HostAddress == NULL ){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
} \r
\r
PciIoDevice = PCI_IO_DEVICE_FROM_PCI_IO_THIS (This);\r
return EFI_SUCCESS;\r
\r
case EfiPciIoAttributeOperationEnable:\r
- if(Attributes & ~(PciIoDevice->Supports)) {\r
- return EFI_UNSUPPORTED;\r
- }\r
- NewAttributes = PciIoDevice->Attributes | Attributes;\r
+ if(Attributes & ~(PciIoDevice->Supports)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
+ NewAttributes = PciIoDevice->Attributes | Attributes;\r
break;\r
case EfiPciIoAttributeOperationDisable:\r
- if(Attributes & ~(PciIoDevice->Supports)) {\r
- return EFI_UNSUPPORTED;\r
- }\r
+ if(Attributes & ~(PciIoDevice->Supports)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
NewAttributes = PciIoDevice->Attributes & (~Attributes);\r
break;\r
case EfiPciIoAttributeOperationSet:\r
- if(Attributes & ~(PciIoDevice->Supports)) {\r
- return EFI_UNSUPPORTED;\r
- }\r
+ if(Attributes & ~(PciIoDevice->Supports)) {\r
+ return EFI_UNSUPPORTED;\r
+ }\r
NewAttributes = Attributes;\r
break;\r
default:\r
/*++\r
\r
-Copyright (c) 2005, Intel Corporation \r
+Copyright (c) 2005 - 2009, Intel Corporation \r
All rights reserved. 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
)\r
{\r
PCAT_PCI_ROOT_BRIDGE_INSTANCE *PrivateData;\r
- UINTN InStride;\r
- UINTN OutStride;\r
+ UINTN InStride;\r
+ UINTN OutStride;\r
UINTN AlignMask;\r
UINTN Address;\r
PTR Buffer;\r
)\r
{\r
PCAT_PCI_ROOT_BRIDGE_INSTANCE *PrivateData;\r
- UINTN InStride;\r
- UINTN OutStride;\r
- UINTN AlignMask;\r
+ UINTN InStride;\r
+ UINTN OutStride;\r
+ UINTN AlignMask;\r
UINTN Address;\r
PTR Buffer;\r
UINT16 Data16;\r
)\r
{\r
PCAT_PCI_ROOT_BRIDGE_INSTANCE *PrivateData;\r
- UINTN AlignMask;\r
- UINTN InStride;\r
- UINTN OutStride;\r
+ UINTN AlignMask;\r
+ UINTN InStride;\r
+ UINTN OutStride;\r
UINT64 Address;\r
DEFIO_PCI_ADDR *Defio;\r
PTR Buffer;\r
/*++\r
\r
-Copyright (c) 2005 - 2008, Intel Corporation \r
+Copyright (c) 2005 - 2009, Intel Corporation \r
All rights reserved. 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
\r
--*/\r
{\r
- EFI_STATUS Status;\r
+ EFI_STATUS Status;\r
PCAT_PCI_ROOT_BRIDGE_INSTANCE *PrivateData;\r
UINTN PciSegmentIndex;\r
UINTN PciRootBridgeIndex;\r
PrivateData->Signature = PCAT_PCI_ROOT_BRIDGE_SIGNATURE;\r
PrivateData->Handle = NULL;\r
PrivateData->DevicePath = NULL;\r
- InitializeListHead (&PrivateData->MapInfo);\r
+ InitializeListHead (&PrivateData->MapInfo);\r
\r
//\r
// Initialize the PCI root bridge number and the bus range for that root bridge\r
/*++\r
\r
-Copyright (c) 2005 - 2008, Intel Corporation \r
+Copyright (c) 2005 - 2009, Intel Corporation \r
All rights reserved. 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
\r
EFI_STATUS\r
PcatRootBridgeIoConstructor (\r
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *Protocol,\r
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *Protocol,\r
IN UINTN SegmentNumber\r
)\r
/*++\r
}\r
\r
\r
- Status =gBS->AllocatePool (\r
+ Status =gBS->AllocatePool (\r
EfiBootServicesData, \r
sizeof(MAP_INFO_INSTANCE), \r
(VOID **)&MapInstance\r
PrivateData = DRIVER_INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS(This);\r
InsertTailList(&PrivateData->MapInfo,&MapInstance->Link);\r
\r
- //\r
+ //\r
// The DeviceAddress is the address of the maped buffer below 4GB\r
//\r
*DeviceAddress = MapInfo->MappedHostAddress;\r
//\r
MapInfo = (MAP_INFO *)Mapping;\r
\r
- for (Link = PrivateData->MapInfo.ForwardLink; Link != &PrivateData->MapInfo; Link = Link->ForwardLink) {\r
- if (((MAP_INFO_INSTANCE*)Link)->Map == MapInfo)\r
- break;\r
+ for (Link = PrivateData->MapInfo.ForwardLink; Link != &PrivateData->MapInfo; Link = Link->ForwardLink) {\r
+ if (((MAP_INFO_INSTANCE*)Link)->Map == MapInfo)\r
+ break;\r
}\r
\r
if (Link == &PrivateData->MapInfo) {\r
- return EFI_INVALID_PARAMETER;\r
- }\r
+ return EFI_INVALID_PARAMETER;\r
+ }\r
\r
RemoveEntryList(Link);\r
((MAP_INFO_INSTANCE*)Link)->Map = NULL;\r
{\r
\r
if( HostAddress == NULL ){\r
- return EFI_INVALID_PARAMETER;\r
+ return EFI_INVALID_PARAMETER;\r
} \r
return gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress, Pages);\r
}\r