Author: fireball
Date: Thu Aug 9 11:12:59 2007
New Revision: 28254
URL:
http://svn.reactos.org/svn/reactos?rev=28254&view=rev
Log:
- Fix definition of _DESCRIPTOR/KDESCRIPTOR
- Fix all code/data structures of GDT/IDT to match new definition
- Kernel is now MSVC/WDK compilable (but not linkable yet)
- Remove two previous fixes for bootvid/kdcom MSVC/WDK compiling
Modified:
trunk/reactos/drivers/base/bootvid/precomp.h
trunk/reactos/drivers/base/kdcom/kdbg.c
trunk/reactos/include/ndk/i386/ketypes.h
trunk/reactos/ntoskrnl/ke/freeldr.c
trunk/reactos/ntoskrnl/ke/i386/cpu.c
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
trunk/reactos/ntoskrnl/ke/i386/trap.s
Modified: trunk/reactos/drivers/base/bootvid/precomp.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/bootvid/preco…
==============================================================================
--- trunk/reactos/drivers/base/bootvid/precomp.h (original)
+++ trunk/reactos/drivers/base/bootvid/precomp.h Thu Aug 9 11:12:59 2007
@@ -1,7 +1,3 @@
-#ifdef _MSC_VER
-void _enable(void);
-void _disable(void);
-#endif
#include "ntddk.h"
#include "arc/arc.h"
#include "halfuncs.h"
Modified: trunk/reactos/drivers/base/kdcom/kdbg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/base/kdcom/kdbg.c?…
==============================================================================
--- trunk/reactos/drivers/base/kdcom/kdbg.c (original)
+++ trunk/reactos/drivers/base/kdcom/kdbg.c Thu Aug 9 11:12:59 2007
@@ -11,11 +11,6 @@
*/
/* INCLUDES *****************************************************************/
-
-#ifdef _MSC_VER
-void _enable(void);
-void _disable(void);
-#endif
#define NOEXTAPI
#include <ntddk.h>
Modified: trunk/reactos/include/ndk/i386/ketypes.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ndk/i386/ketypes.h…
==============================================================================
--- trunk/reactos/include/ndk/i386/ketypes.h (original)
+++ trunk/reactos/include/ndk/i386/ketypes.h Thu Aug 9 11:12:59 2007
@@ -261,14 +261,12 @@
USHORT ExtendedOffset;
} KIDTENTRY, *PKIDTENTRY;
-#include <pshpack2.h>
typedef struct _DESCRIPTOR
{
+ USHORT Pad;
USHORT Limit;
ULONG Base;
- USHORT Padding;
} KDESCRIPTOR, *PKDESCRIPTOR;
-#include <poppack.h>
#ifndef NTOS_MODE_USER
//
Modified: trunk/reactos/ntoskrnl/ke/freeldr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/freeldr.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/freeldr.c (original)
+++ trunk/reactos/ntoskrnl/ke/freeldr.c Thu Aug 9 11:12:59 2007
@@ -356,8 +356,8 @@
PKGDTENTRY TssEntry;
/* Load the GDT and IDT */
- Ke386SetGlobalDescriptorTable(KiGdtDescriptor);
- Ke386SetInterruptDescriptorTable(KiIdtDescriptor);
+ Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&KiGdtDescriptor.Limit);
+ Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&KiIdtDescriptor.Limit);
/* Initialize the boot TSS */
Tss = &KiBootTss;
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/cpu.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/cpu.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/cpu.c Thu Aug 9 11:12:59 2007
@@ -47,7 +47,7 @@
};
/* GDT Descriptor */
-KDESCRIPTOR KiGdtDescriptor = {sizeof(KiBootGdt), (ULONG)KiBootGdt};
+KDESCRIPTOR KiGdtDescriptor = {0, sizeof(KiBootGdt), (ULONG)KiBootGdt};
/* CPU Features and Flags */
ULONG KeI386CpuType;
@@ -705,8 +705,8 @@
//
// Restore GDT, IDT, LDT and TSS
//
- Ke386SetGlobalDescriptorTable(ProcessorState->SpecialRegisters.Gdtr.Base);
- Ke386SetInterruptDescriptorTable(ProcessorState->SpecialRegisters.Idtr.Base);
+
Ke386SetGlobalDescriptorTable(*(PKDESCRIPTOR)&ProcessorState->SpecialRegisters.Gdtr.Limit);
+
Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&ProcessorState->SpecialRegisters.Idtr.Limit);
Ke386SetTr(ProcessorState->SpecialRegisters.Tr);
Ke386SetLocalDescriptorTable(ProcessorState->SpecialRegisters.Ldtr);
}
@@ -732,8 +732,8 @@
Ke386SetDr7(0);
/* Save GDT, IDT, LDT and TSS */
- Ke386GetGlobalDescriptorTable(ProcessorState->SpecialRegisters.Gdtr.Base);
- Ke386GetInterruptDescriptorTable(ProcessorState->SpecialRegisters.Idtr.Base);
+
Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&ProcessorState->SpecialRegisters.Gdtr.Limit);
+
Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&ProcessorState->SpecialRegisters.Idtr.Limit);
Ke386GetTr(ProcessorState->SpecialRegisters.Tr);
Ke386GetLocalDescriptorTable(ProcessorState->SpecialRegisters.Ldtr);
}
@@ -832,14 +832,14 @@
_disable();
/* Get the current IDT and copy it */
- Ke386GetInterruptDescriptorTable(IdtDescriptor);
+ Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit);
RtlCopyMemory(NewIdt2,
(PVOID)IdtDescriptor.Base,
IdtDescriptor.Limit + 1);
IdtDescriptor.Base = (ULONG)NewIdt2;
/* Set the new IDT */
- Ke386SetInterruptDescriptorTable(IdtDescriptor);
+ Ke386SetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit);
((PKIPCR)KeGetPcr())->IDT = NewIdt2;
/* Restore interrupts */
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original)
+++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Thu Aug 9 11:12:59 2007
@@ -619,8 +619,8 @@
USHORT Tr = 0, Fs;
/* Get GDT and IDT descriptors */
- Ke386GetGlobalDescriptorTable(GdtDescriptor);
- Ke386GetInterruptDescriptorTable(IdtDescriptor);
+ Ke386GetGlobalDescriptorTable(*(PKDESCRIPTOR)&GdtDescriptor.Limit);
+ Ke386GetInterruptDescriptorTable(*(PKDESCRIPTOR)&IdtDescriptor.Limit);
/* Save IDT and GDT */
*Gdt = (PKGDTENTRY)GdtDescriptor.Base;
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?re…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/i386/trap.s (original)
+++ trunk/reactos/ntoskrnl/ke/i386/trap.s Thu Aug 9 11:12:59 2007
@@ -80,6 +80,7 @@
.globl _KiIdtDescriptor
_KiIdtDescriptor:
+ .short 0
.short 0x800
.long _KiIdt