diff --git a/reactos/ntoskrnl/ke/i386/boot.S b/reactos/ntoskrnl/ke/i386/boot.S index c0a68014fc4..7c94f74e162 100644 --- a/reactos/ntoskrnl/ke/i386/boot.S +++ b/reactos/ntoskrnl/ke/i386/boot.S @@ -30,6 +30,11 @@ _KiDoubleFaultStack: .text .func NtProcessStartup _NtProcessStartup: - /* Call the main kernel initialization */ + + /* NTLDR Boot: Call the main kernel initialization */ + test dword ptr [esp+4], 0x80000000 + jnz _KiSystemStartup@4 + + /* FREELDR Boot: Cal the FreeLDR wrapper */ jmp @KiRosPrepareForSystemStartup@8 .endfunc diff --git a/reactos/ntoskrnl/ke/i386/kiinit.c b/reactos/ntoskrnl/ke/i386/kiinit.c index 154be617d13..3bd35b1271d 100644 --- a/reactos/ntoskrnl/ke/i386/kiinit.c +++ b/reactos/ntoskrnl/ke/i386/kiinit.c @@ -294,7 +294,7 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) { /* If this is the boot CPU, set FS and the CPU Number*/ Ke386SetFs(KGDT_R0_PCR); - KeGetPcr()->Number = Cpu; + __writefsdword(0x130, Cpu); /* Set the initial stack and idle thread as well */ LoaderBlock->KernelStack = (ULONG_PTR)P0BootStack;