Author: ion
Date: Sun Oct 1 11:31:33 2006
New Revision: 24337
URL:
http://svn.reactos.org/svn/reactos?rev=24337&view=rev
Log:
- Fix Ki386InitializeTss to use dynamic GDT calculated from KiGetMachineBootPointers
instead of static internal address. Now NTLDR boots us all the way to
HalInitializeProcessor.
Modified:
trunk/reactos/ntoskrnl/include/internal/i386/ke.h
trunk/reactos/ntoskrnl/ke/i386/cpu.c
trunk/reactos/ntoskrnl/ke/i386/kiinit.c
Modified: trunk/reactos/ntoskrnl/include/internal/i386/ke.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/i386/ke.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/i386/ke.h Sun Oct 1 11:31:33 2006
@@ -61,7 +61,8 @@
FASTCALL
Ki386InitializeTss(
IN PKTSS Tss,
- IN PKIDTENTRY Idt
+ IN PKIDTENTRY Idt,
+ IN PKGDTENTRY Gdt
);
VOID
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:31:33 2006
@@ -552,12 +552,13 @@
VOID
FASTCALL
Ki386InitializeTss(IN PKTSS Tss,
- IN PKIDTENTRY Idt)
+ IN PKIDTENTRY Idt,
+ IN PKGDTENTRY Gdt)
{
PKGDTENTRY TssEntry, TaskGateEntry;
/* Initialize the boot TSS. */
- TssEntry = &KiBootGdt[KGDT_TSS / sizeof(KGDTENTRY)];
+ TssEntry = &Gdt[KGDT_TSS / sizeof(KGDTENTRY)];
TssEntry->HighWord.Bits.Type = I386_TSS;
TssEntry->HighWord.Bits.Pres = 1;
TssEntry->HighWord.Bits.Dpl = 0;
@@ -587,7 +588,7 @@
Tss->Ds = KGDT_R3_DATA | RPL_MASK;
/* Setup the Double Trap TSS entry in the GDT */
- TssEntry = &KiBootGdt[KGDT_DF_TSS / sizeof(KGDTENTRY)];
+ TssEntry = &Gdt[KGDT_DF_TSS / sizeof(KGDTENTRY)];
TssEntry->HighWord.Bits.Type = I386_TSS;
TssEntry->HighWord.Bits.Pres = 1;
TssEntry->HighWord.Bits.Dpl = 0;
@@ -616,7 +617,7 @@
Tss->Ds = KGDT_R3_DATA | RPL_MASK;
/* And its associated TSS Entry */
- TssEntry = &KiBootGdt[KGDT_NMI_TSS / sizeof(KGDTENTRY)];
+ TssEntry = &Gdt[KGDT_NMI_TSS / sizeof(KGDTENTRY)];
TssEntry->HighWord.Bits.Type = I386_TSS;
TssEntry->HighWord.Bits.Pres = 1;
TssEntry->HighWord.Bits.Dpl = 0;
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 Sun Oct 1 11:31:33 2006
@@ -318,7 +318,7 @@
KiGetMachineBootPointers(&Gdt, &Idt, &Pcr, &Tss);
/* Setup the TSS descriptors and entries */
- Ki386InitializeTss(Tss, Idt);
+ Ki386InitializeTss(Tss, Idt, Gdt);
/* Initialize the PCR */
RtlZeroMemory(Pcr, PAGE_SIZE);