Author: ion Date: Sun Oct 1 11:24:24 2006 New Revision: 24336
URL: http://svn.reactos.org/svn/reactos?rev=24336&view=rev Log: - Put IDT in RW .data section - Fix Ki386InitializeTss to properly set Boot TSS descriptor data (set it to 32-bits). Also properly setup the DF/NMI Task Gates in the IDT.
Modified: trunk/reactos/ntoskrnl/ke/i386/cpu.c trunk/reactos/ntoskrnl/ke/i386/kiinit.c trunk/reactos/ntoskrnl/ke/i386/trap.s
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 Sun Oct 1 11:24:24 2006 @@ -554,12 +554,13 @@ Ki386InitializeTss(IN PKTSS Tss, IN PKIDTENTRY Idt) { - PKGDTENTRY TssEntry; - PKIDTENTRY TaskGateEntry; - PKIDT_ACCESS TaskGateAccess; + PKGDTENTRY TssEntry, TaskGateEntry;
/* Initialize the boot TSS. */ TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)]; + TssEntry->HighWord.Bits.Type = I386_TSS; + TssEntry->HighWord.Bits.Pres = 1; + TssEntry->HighWord.Bits.Dpl = 0; KiInitializeTSS2(Tss, TssEntry); KiInitializeTSS(Tss);
@@ -567,14 +568,11 @@ Ke386SetTr(KGDT_TSS);
/* Setup the Task Gate for Double Fault Traps */ - TaskGateEntry = &Idt[8]; - TaskGateAccess = (PKIDT_ACCESS)&TaskGateEntry->Access; -#if 0 - TaskGateAccess->SegmentType = I386_TASK_GATE; - TaskGateAccess->Present = 1; - TaskGateAccess->Dpl = 0; - TaskGateEntry->Selector = KGDT_DF_TSS; -#endif + TaskGateEntry = (PKGDTENTRY)&Idt[8]; + TaskGateEntry->HighWord.Bits.Type = I386_TASK_GATE; + TaskGateEntry->HighWord.Bits.Pres = 1; + TaskGateEntry->HighWord.Bits.Dpl = 0; + ((PKIDTENTRY)TaskGateEntry)->Selector = KGDT_DF_TSS;
/* Initialize the TSS used for handling double faults. */ Tss = (PKTSS)KiDoubleFaultTSS; @@ -599,13 +597,11 @@ TssEntry->LimitLow = KTSS_IO_MAPS;
/* Now setup the NMI Task Gate */ - TaskGateEntry = &Idt[2]; - TaskGateAccess = (PKIDT_ACCESS)&TaskGateEntry->Access; -#if 0 - TaskGateAccess->SegmentType = I386_TASK_GATE; - TaskGateAccess->Present = 1; - TaskGateEntry->Selector = KGDT_NMI_TSS; -#endif + TaskGateEntry = (PKGDTENTRY)&Idt[2]; + TaskGateEntry->HighWord.Bits.Type = I386_TASK_GATE; + TaskGateEntry->HighWord.Bits.Pres = 1; + TaskGateEntry->HighWord.Bits.Dpl = 0; + ((PKIDTENTRY)TaskGateEntry)->Selector = KGDT_NMI_TSS;
/* Initialize the actual TSS */ Tss = (PKTSS)KiNMITSS;
Modified: trunk/reactos/ntoskrnl/ke/i386/kiinit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/kiinit.c?r... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/kiinit.c (original) +++ trunk/reactos/ntoskrnl/ke/i386/kiinit.c Sun Oct 1 11:24:24 2006 @@ -367,7 +367,7 @@ if (!Cpu) { /* Initialize debugging system */ - KdInitSystem (0, KeLoaderBlock); + KdInitSystem(0, KeLoaderBlock);
/* Check for break-in */ if (KdPollBreakIn()) DbgBreakPointWithStatus(1);
Modified: trunk/reactos/ntoskrnl/ke/i386/trap.s URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/i386/trap.s?rev... ============================================================================== --- trunk/reactos/ntoskrnl/ke/i386/trap.s (original) +++ trunk/reactos/ntoskrnl/ke/i386/trap.s Sun Oct 1 11:24:24 2006 @@ -14,6 +14,7 @@
/* GLOBALS *******************************************************************/
+.data .globl _KiIdt _KiIdt: /* This is the Software Interrupt Table that we handle in this file: */ @@ -87,6 +88,7 @@ .asciz "\n\x7\x7!!! Unexpected Interrupt %02lx !!!\n"
/* SOFTWARE INTERRUPT SERVICES ***********************************************/ +.text
_KiGetTickCount: _KiCallbackReturn: