- 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.

svn path=/trunk/; revision=24336
This commit is contained in:
Alex Ionescu
2006-10-01 07:24:24 +00:00
parent 00564d63b7
commit 7c753a339a
3 changed files with 17 additions and 19 deletions
+14 -18
View File
@@ -554,12 +554,13 @@ FASTCALL
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 @@ Ki386InitializeTss(IN PKTSS Tss,
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 @@ Ki386InitializeTss(IN PKTSS Tss,
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;
+1 -1
View File
@@ -367,7 +367,7 @@ AppCpuInit:
if (!Cpu)
{
/* Initialize debugging system */
KdInitSystem (0, KeLoaderBlock);
KdInitSystem(0, KeLoaderBlock);
/* Check for break-in */
if (KdPollBreakIn()) DbgBreakPointWithStatus(1);
+2
View File
@@ -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 @@ _UnexpectedMsg:
.asciz "\n\x7\x7!!! Unexpected Interrupt %02lx !!!\n"
/* SOFTWARE INTERRUPT SERVICES ***********************************************/
.text
_KiGetTickCount:
_KiCallbackReturn: