diff --git a/reactos/boot/freeldr/freeldr/arch/i386/i386idt.S b/reactos/boot/freeldr/freeldr/arch/i386/i386idt.S index 7fc46fa9ff0..22e931f2ee7 100644 --- a/reactos/boot/freeldr/freeldr/arch/i386/i386idt.S +++ b/reactos/boot/freeldr/freeldr/arch/i386/i386idt.S @@ -27,91 +27,91 @@ .p2align 2 /* force 4-byte alignment */ EXTERN(i386idt) /* Exception 0 - Divide By Zero */ - .word i386DivideByZero /* Offset 0 - 15 */ + .word i386DivideByZero /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Flags, Zero Byte */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 1 - Debug Exception */ - .word i386DebugException /* Offset 0 - 15 */ + .word i386DebugException /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 2 - NMI */ - .word i386NMIException /* Offset 0 - 15 */ + .word i386NMIException /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 3 - Breakpoint (INT 3) */ - .word i386Breakpoint /* Offset 0 - 15 */ + .word i386Breakpoint /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 4 - Overflow (INTO with EFLAGS[OF] set) */ - .word i386Overflow /* Offset 0 - 15 */ + .word i386Overflow /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 5 - Bound Exception */ - .word i386BoundException /* Offset 0 - 15 */ + .word i386BoundException /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 6 - Invalid Opcode */ - .word i386InvalidOpcode /* Offset 0 - 15 */ + .word i386InvalidOpcode /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 7 - FPU Not Available */ - .word i386FPUNotAvailable /* Offset 0 - 15 */ + .word i386FPUNotAvailable /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 8 - Double Fault */ - .word i386DoubleFault /* Offset 0 - 15 */ + .word i386DoubleFault /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 9 - Coprocessor Segment Overrun */ - .word i386CoprocessorSegment /* Offset 0 - 15 */ + .word i386CoprocessorSegment /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 10 (0x0A) - Invalid TSS */ - .word i386InvalidTSS /* Offset 0 - 15 */ + .word i386InvalidTSS /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 11 (0x0B) - Segment Not Present */ - .word i386SegmentNotPresent /* Offset 0 - 15 */ + .word i386SegmentNotPresent /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 12 (0x0C) - Stack Exception */ - .word i386StackException /* Offset 0 - 15 */ + .word i386StackException /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 13 (0x0D) - General Protection Fault */ - .word i386GeneralProtectionFault /* Offset 0 - 15 */ + .word i386GeneralProtectionFault /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 14 (0x0E) - Page Fault */ - .word i386PageFault /* Offset 0 - 15 */ + .word i386PageFault /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ @@ -123,19 +123,19 @@ EXTERN(i386idt) .word 0x0000 /* Offset 16 - 31 */ /* Exception 16 (0x10) - Coprocessor Error */ - .word i386CoprocessorError /* Offset 0 - 15 */ + .word i386CoprocessorError /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 17 (0x11) - Alignment Check */ - .word i386AlignmentCheck /* Offset 0 - 15 */ + .word i386AlignmentCheck /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ /* Exception 18 (0x12) - Machine Check */ - .word i386MachineCheck /* Offset 0 - 15 */ + .word i386MachineCheck /* Offset 0 - 15 */ .word 0x0008 /* Selector */ .word 0x8e00 /* Zero byte, flags */ .word 0x0000 /* Offset 16 - 31 */ @@ -220,5 +220,5 @@ EXTERN(i386idt) /* IDT table pointer */ EXTERN(i386idtptr) - .word (i386idtptr-i386idt) /* Limit */ + .word (i386idtptr - i386idt - 1) /* Limit */ .long i386idt /* Base Address */ diff --git a/reactos/boot/freeldr/freeldr/windows/wlmemory.c b/reactos/boot/freeldr/freeldr/windows/wlmemory.c index 2de36ab08e2..5384c400a38 100644 --- a/reactos/boot/freeldr/freeldr/windows/wlmemory.c +++ b/reactos/boot/freeldr/freeldr/windows/wlmemory.c @@ -912,7 +912,7 @@ WinLdrSetProcessorContext(PVOID GdtIdt, IN ULONG Pcr, IN ULONG Tss) // // Copy the old IDT - RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit); + RtlCopyMemory(pIdt, (PVOID)OldIdt.Base, OldIdt.Limit + 1); // Mask interrupts //asm("cli\n"); // they are already masked before enabling paged mode