mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
- Add two more lines in boot.S which detect boot-by-NTLDR and jump into KiSystemService (I thought FreeLdr didn't use the entrypoint, but it looks like it does, so this hack is needed). Detection is done by checking for the high bit in the PLOADER_PARAMETER_BLOCK pointer, which will be set on NT.
- Fix a double bug in KiSystemStartup. First, we were setting KPCR->Number instead of KPRCB->Number. Second, we were using KeGetPcr instead of __writefsdword. It worked on ROS because KeGetPcr is hard-coded to ROS's KPCR buffer. svn path=/trunk/; revision=24334
This commit is contained in:
parent
790760dcf4
commit
aebf830821
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue