diff --git a/reactos/ntoskrnl/cm/regobj.c b/reactos/ntoskrnl/cm/regobj.c index 6ed5f62ca10..43c549b8aa6 100644 --- a/reactos/ntoskrnl/cm/regobj.c +++ b/reactos/ntoskrnl/cm/regobj.c @@ -850,7 +850,7 @@ CmiScanKeyList(PKEY_OBJECT Parent, ULONG Attributes, PKEY_OBJECT* ReturnedObject) { - PKEY_OBJECT CurKey; + PKEY_OBJECT CurKey = 0; ULONG Index; DPRINT("Scanning key list for: %wZ (Parent: %wZ)\n", diff --git a/reactos/ntoskrnl/kd/kdinit.c b/reactos/ntoskrnl/kd/kdinit.c index 263faaa865a..aed40e9f6c4 100644 --- a/reactos/ntoskrnl/kd/kdinit.c +++ b/reactos/ntoskrnl/kd/kdinit.c @@ -34,10 +34,15 @@ BOOLEAN KdpEarlyBreak = FALSE; LIST_ENTRY KdProviders = {&KdProviders, &KdProviders}; KD_DISPATCH_TABLE DispatchTable[KdMax]; +#ifdef _M_IX86 PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit, KdpSerialInit, KdpInitDebugLog, KdpBochsInit}; +#elif defined(_M_PPC) +PKDP_INIT_ROUTINE InitRoutines[KdMax] = {KdpScreenInit, + KdpInitDebugLog}; +#endif /* PRIVATE FUNCTIONS *********************************************************/ @@ -248,7 +253,10 @@ KdInitSystem(ULONG BootPhase, /* Call Providers at Phase 0 */ for (i = 0; i < KdMax; i++) { - InitRoutines[i](&DispatchTable[i], 0); + if(InitRoutines[i]) + { + InitRoutines[i](&DispatchTable[i], 0); + } } /* Call Wrapper at Phase 0 */ diff --git a/reactos/ntoskrnl/kd/wrappers/gdbstub.c b/reactos/ntoskrnl/kd/wrappers/gdbstub.c index a9b2342523e..0a9bcfd9b8f 100644 --- a/reactos/ntoskrnl/kd/wrappers/gdbstub.c +++ b/reactos/ntoskrnl/kd/wrappers/gdbstub.c @@ -1552,7 +1552,7 @@ KdpGdbEnterDebuggerException(PEXCEPTION_RECORD ExceptionRecord, case 'c': { ULONG BreakpointNumber; - ULONG dr6_; + ULONG dr6_ = 0; /* try to read optional parameter, pc unchanged if no parm */ if (GspHex2Long (&ptr, &Address)) diff --git a/reactos/ntoskrnl/ke/bug.c b/reactos/ntoskrnl/ke/bug.c index f6e837c3887..5ce8e7cca20 100644 --- a/reactos/ntoskrnl/ke/bug.c +++ b/reactos/ntoskrnl/ke/bug.c @@ -122,6 +122,7 @@ INIT_FUNCTION NTAPI KiInitializeBugCheck(VOID) { +#if 0 PRTL_MESSAGE_RESOURCE_DATA BugCheckData; LDR_RESOURCE_INFO ResourceInfo; PIMAGE_RESOURCE_DATA_ENTRY ResourceDataEntry; @@ -148,6 +149,7 @@ KiInitializeBugCheck(VOID) NULL); if (NT_SUCCESS(Status)) KiBugCodeMessages = BugCheckData; } +#endif } VOID diff --git a/reactos/ntoskrnl/ke/freeldr.c b/reactos/ntoskrnl/ke/freeldr.c index 575809edd9a..1308e937465 100644 --- a/reactos/ntoskrnl/ke/freeldr.c +++ b/reactos/ntoskrnl/ke/freeldr.c @@ -294,6 +294,11 @@ KiRosFrldrLpbToNtLpb(IN PROS_LOADER_PARAMETER_BLOCK RosLoaderBlock, /* Parse it and change every slash to a space */ BootPath = LoaderBlock->LoadOptions; do {if (*BootPath == '/') *BootPath = ' ';} while (*BootPath++); + +#ifdef _M_PPC + /* Finally link to the ReactOS specific part in the extension section */ + LoaderBlock->u.PowerPC.BootInfo = &KeRosLoaderBlock; +#endif } VOID @@ -325,6 +330,7 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, boot_infos_t *XBootInfo = (boot_infos_t *)LoaderBlock->ArchExtra; memcpy(&PpcEarlybootInfo, XBootInfo, sizeof(PpcEarlybootInfo)); PpcEarlybootInfo.dispFont = BootDigits; + LoaderBlock->ArchExtra = (ULONG)&PpcEarlybootInfo; BootInfo = (struct _boot_infos_t *)&PpcEarlybootInfo; DrawNumber(BootInfo, 0x1234abcd, 10, 100); DrawNumber(BootInfo, (ULONG)nk, 10 , 150); @@ -447,10 +453,14 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, } /* Choose last module address as the final kernel address */ + /* This is a workaround re: high and low adjust. + * The ABI we're using doesn't respect HIGHADJ pairing like compilers for NT do, so well be a bit + * lenient. This can be fixed later. + */ +#ifndef _M_PPC MmFreeLdrLastKernelAddress = PAGE_ROUND_UP(KeLoaderModules[KeRosLoaderBlock.ModsCount - 1].ModEnd); -#ifndef _M_PPC /* Select the HAL Base */ HalBase = KeLoaderModules[1].ModStart; @@ -458,7 +468,13 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, DriverBase = MmFreeLdrLastKernelAddress; LdrHalBase = (ULONG_PTR)DriverBase; #else + MmFreeLdrLastKernelAddress = + ROUND_UP(KeLoaderModules[KeRosLoaderBlock.ModsCount - 1].ModEnd, 0x10000); + + /* Select the HAL Base */ HalBase = KeLoaderModules[1].ModStart; + + /* Choose Driver Base */ DriverBase = MmFreeLdrLastKernelAddress; LdrHalBase = KeLoaderModules[1].ModStart; #endif @@ -466,16 +482,16 @@ KiRosPrepareForSystemStartup(IN ULONG Dummy, /* Initialize Module Management */ LdrInitModuleManagement((PVOID)KeLoaderModules[0].ModStart); +#ifdef _M_PPC + LdrpSettleHal((PVOID)DriverBase); +#endif + /* Load HAL.DLL with the PE Loader */ LdrSafePEProcessModule((PVOID)HalBase, (PVOID)DriverBase, (PVOID)KeLoaderModules[0].ModStart, &DriverSize); -#ifdef _M_PPC - LdrpSettleHal((PVOID)DriverBase); -#endif - /* Increase the last kernel address with the size of HAL */ MmFreeLdrLastKernelAddress += PAGE_ROUND_UP(DriverSize); diff --git a/reactos/ntoskrnl/ke/powerpc/kiinit.c b/reactos/ntoskrnl/ke/powerpc/kiinit.c index c2036558836..496246d9761 100644 --- a/reactos/ntoskrnl/ke/powerpc/kiinit.c +++ b/reactos/ntoskrnl/ke/powerpc/kiinit.c @@ -14,11 +14,17 @@ #define NDEBUG #include +#include /* GLOBALS *******************************************************************/ +/* Ku bit should be set, so that we get the best options for page protection */ +#define PPC_SEG_Ku 0x40000000 +#define PPC_SEG_Ks 0x20000000 + extern LOADER_MODULE KeLoaderModules[64]; extern ULONG KeLoaderModuleCount; +extern ULONG_PTR MmFreeLdrLastKernelAddress; KPRCB PrcbData[MAXIMUM_PROCESSORS]; /* FUNCTIONS *****************************************************************/ @@ -78,29 +84,17 @@ KiInitializePcr(IN ULONG ProcessorNumber, IN PKTHREAD IdleThread, IN PVOID DpcStack) { - TRACE; Pcr->MajorVersion = PCR_MAJOR_VERSION; - TRACE; Pcr->MinorVersion = PCR_MINOR_VERSION; - TRACE; Pcr->CurrentIrql = PASSIVE_LEVEL; - TRACE; Pcr->Prcb = PrcbData; - TRACEXY(Pcr->Prcb, PrcbData); Pcr->Prcb->MajorVersion = 1; - TRACE; Pcr->Prcb->MinorVersion = 1; - TRACE; Pcr->Prcb->Number = 0; /* UP for now */ - TRACE; Pcr->Prcb->SetMember = 1; - TRACE; Pcr->Prcb->BuildType = 0; - TRACE; Pcr->Prcb->DpcStack = DpcStack; - TRACE; KiProcessorBlock[ProcessorNumber] = Pcr->Prcb; - TRACEXY(0xd00d,0xbeef); } extern ULONG KiGetFeatureBits(); @@ -257,7 +251,7 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* Set up segs for normal paged address space. */ for( i = 0; i < 16; i++ ) { - SetSR(i, i); + SetSR(i, (i < 8 ? PPC_SEG_Ku : PPC_SEG_Ks) | i); } /* Save the loader block and get the current CPU */ @@ -269,14 +263,13 @@ KiSystemStartup(IN PLOADER_PARAMETER_BLOCK LoaderBlock) /* We'll allocate a page from the end of the kernel area for KPCR. This code will probably * change when we get SMP support. */ - ULONG LastPage = ROUND_UP(KeLoaderModules[KeLoaderModuleCount-1].ModEnd,1<Prcb; Pcr->Number = Cpu; Pcr->SetMember = 1 << Cpu; Prcb->SetMember = 1 << Cpu; - TRACE; /* Initialize the Processor with HAL */ HalInitializeProcessor(Cpu, LoaderBlock); - TRACE; /* Set active processors */ KeActiveProcessors |= Pcr->SetMember; KeNumberProcessors++; - TRACE; /* Initialize the Debugger for the Boot CPU */ if (!Cpu) KdInitSystem (0, LoaderBlock); - TRACE; /* Check for break-in */ if (KdPollBreakIn()) { DbgBreakPointWithStatus(1); } - TRACE; /* Raise to HIGH_LEVEL */ KfRaiseIrql(HIGH_LEVEL); - TRACE; /* Call main kernel intialization */ KiInitializeKernel(&KiInitialProcess.Pcb, &KiInitialThread.Tcb, @@ -334,6 +318,5 @@ AppCpuInit: Prcb, Cpu, (PVOID)LoaderBlock); - TRACE; }