Author: ion
Date: Sun Oct 8 08:47:26 2006
New Revision: 24439
URL:
http://svn.reactos.org/svn/reactos?rev=24439&view=rev
Log:
- More re-shuffling of initialization calls, including enabling access to the blue screen
much much earlier (no point in doing it so late, but this change is not that useful since
soon we'll have bootvid).
- Split Po init in two, so the early Po init (which we'll need to do eventually)
doesn't depent on the later Po init (which uses a PnP notification which depends on
the Io system).
- Make I/O initialize quite a bit later.
Modified:
trunk/reactos/ntoskrnl/ex/init.c
trunk/reactos/ntoskrnl/include/internal/po.h
trunk/reactos/ntoskrnl/po/power.c
Modified: trunk/reactos/ntoskrnl/ex/init.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=244…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/init.c (original)
+++ trunk/reactos/ntoskrnl/ex/init.c Sun Oct 8 08:47:26 2006
@@ -876,6 +876,14 @@
/* Check if GUI Boot is enabled */
if (strstr(KeLoaderBlock->LoadOptions, "NOGUIBOOT")) NoGuiBoot = TRUE;
+ /* Clear the screen to blue and display the boot notice and debug status */
+ HalInitSystem(2, KeLoaderBlock);
+ if (NoGuiBoot) ExpDisplayNotice();
+ KdInitSystem(2, KeLoaderBlock);
+
+ /* Initialize Power Subsystem in Phase 0 */
+ PoInit(0, AcpiTableDetected);
+
/* Query the clock */
if (HalQueryRealTimeClock(&TimeFields))
{
@@ -925,69 +933,61 @@
KeBugCheckEx(PHASE1_INITIALIZATION_FAILED, 3, 0, 0, 0);
}
+ /* Create SystemRoot Link */
+
/* Create NLS section */
ExpInitNls(KeLoaderBlock);
+ /* Initialize Cache Views */
+ CcInitializeCacheManager();
+
+ /* Initialize the Registry (Hives are NOT yet loaded!) */
+ CmInitSystem1();
+
+ /* Update timezone information */
+ ExRefreshTimeZoneInformation(&SystemBootTime);
+
+ /* Initialize the File System Runtime Library */
+ FsRtlInitSystem();
+
+ /* Report all resources used by HAL */
+ HalReportResourceUsage();
+
+ /* Initialize LPC */
+ LpcpInitSystem();
+
/* Initialize I/O Objects, Filesystems, Error Logging and Shutdown */
IoInit();
- /* Initialize Cache Views */
- CcInitializeCacheManager();
-
- /* Initialize the Registry (Hives are NOT yet loaded!) */
- CmInitSystem1();
-
- /* Update timezone information */
- ExRefreshTimeZoneInformation(&SystemBootTime);
-
- /* TBD */
- PoInit(AcpiTableDetected, KeLoaderBlock);
-
/* Unmap Low memory, and initialize the MPW and Balancer Thread */
MmInit3();
- /* Initialize the File System Runtime Library */
- FsRtlInitSystem();
-
- /* Report all resources used by HAL */
- HalReportResourceUsage();
-
- /* Clear the screen to blue */
- HalInitSystem(2, KeLoaderBlock);
-
- /* Display version number and copyright/warranty message */
- if (NoGuiBoot) ExpDisplayNotice();
-
- /* Call KD Providers at Phase 2 */
- KdInitSystem(2, KeLoaderBlock);
-
- /* Initialize LPC */
- LpcpInitSystem();
-
/* Import and Load Registry Hives */
CmInitHives(ExpInTextModeSetup);
+ /* Enter the kernel debugger before starting up the boot drivers */
+ if (KdDebuggerEnabled && KdpEarlyBreak) DbgBreakPoint();
+
+ /* Setup Drivers and Root Device Node */
+ IoInit2(FALSE);
+
+ /* Display the boot screen image if not disabled */
+ if (!NoGuiBoot) InbvEnableBootDriver(TRUE);
+
+ /* Create ARC Names, SystemRoot SymLink, Load Drivers and Assign Letters */
+ IoInit3();
+
+ /* Load the System DLL and its Entrypoints */
+ PsLocateSystemDll();
+
+ /* Initialize shared user page. Set dos system path, dos device map, etc. */
+ InitSystemSharedUserPage(KeLoaderBlock);
+
/* Initialize VDM support */
KeI386VdmInitialize();
- /* Enter the kernel debugger before starting up the boot drivers */
- if (KdDebuggerEnabled && KdpEarlyBreak)
- DbgBreakPoint();
-
- /* Setup Drivers and Root Device Node */
- IoInit2(FALSE);
-
- /* Display the boot screen image if not disabled */
- if (!NoGuiBoot) InbvEnableBootDriver(TRUE);
-
- /* Create ARC Names, SystemRoot SymLink, Load Drivers and Assign Letters */
- IoInit3();
-
- /* Load the System DLL and its Entrypoints */
- PsLocateSystemDll();
-
- /* Initialize shared user page. Set dos system path, dos device map, etc. */
- InitSystemSharedUserPage(KeLoaderBlock);
+ /* Initialize Power Subsystem in Phase 1*/
+ PoInit(1, AcpiTableDetected);
/* Initialize the Process Manager at Phase 1 */
if (!PsInitSystem()) KeBugCheck(PROCESS1_INITIALIZATION_FAILED);
Modified: trunk/reactos/ntoskrnl/include/internal/po.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/include/internal/…
==============================================================================
--- trunk/reactos/ntoskrnl/include/internal/po.h (original)
+++ trunk/reactos/ntoskrnl/include/internal/po.h Sun Oct 8 08:47:26 2006
@@ -38,8 +38,8 @@
VOID
NTAPI
PoInit(
- BOOLEAN HaveAcpiTable,
- IN PLOADER_PARAMETER_BLOCK LoaderBlock
+ IN ULONG BootPhase,
+ IN BOOLEAN HaveAcpiTable
);
VOID
Modified: trunk/reactos/ntoskrnl/po/power.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/po/power.c?rev=24…
==============================================================================
--- trunk/reactos/ntoskrnl/po/power.c (original)
+++ trunk/reactos/ntoskrnl/po/power.c Sun Oct 8 08:47:26 2006
@@ -17,6 +17,7 @@
#pragma alloc_text(INIT, PoInit)
#endif
+extern ULONG ExpInitialiationPhase;
typedef struct _REQUEST_POWER_ITEM
{
@@ -306,41 +307,47 @@
VOID
INIT_FUNCTION
NTAPI
-PoInit(BOOLEAN HaveAcpiTable,
- IN PLOADER_PARAMETER_BLOCK LoaderBlock)
-{
- PVOID NotificationEntry;
- PCHAR CommandLine;
- BOOLEAN ForceAcpiDisable = FALSE;
-
- /* Get the Command Line */
- CommandLine = KeLoaderBlock->LoadOptions;
-
- /* Upcase it */
- _strupr(CommandLine);
-
- /* Check for ACPI disable */
- if (strstr(CommandLine, "NOACPI")) ForceAcpiDisable = TRUE;
-
- if (ForceAcpiDisable)
+PoInit(IN ULONG BootPhase,
+ IN BOOLEAN HaveAcpiTable)
+{
+ PVOID NotificationEntry;
+ PCHAR CommandLine;
+ BOOLEAN ForceAcpiDisable = FALSE;
+
+ /* Check if this is phase 1 init */
+ if (BootPhase == 1)
{
- /* Set the ACPI State to False if it's been forced that way */
- PopAcpiPresent = FALSE;
+ /* Registry power button notification */
+ IoRegisterPlugPlayNotification(EventCategoryDeviceInterfaceChange,
+ 0, /* The registry has not been initialized yet
*/
+ (PVOID)&GUID_DEVICE_SYS_BUTTON,
+ IopRootDeviceNode->
+ PhysicalDeviceObject->DriverObject,
+ PopAddRemoveSysCapsCallback,
+ NULL,
+ &NotificationEntry);
+ return;
}
- else
+
+ /* Get the Command Line */
+ CommandLine = KeLoaderBlock->LoadOptions;
+
+ /* Upcase it */
+ _strupr(CommandLine);
+
+ /* Check for ACPI disable */
+ if (strstr(CommandLine, "NOACPI")) ForceAcpiDisable = TRUE;
+
+ if (ForceAcpiDisable)
{
- /* Otherwise check the LoaderBlock's Flag */
- PopAcpiPresent = HaveAcpiTable;
+ /* Set the ACPI State to False if it's been forced that way */
+ PopAcpiPresent = FALSE;
}
-
- IoRegisterPlugPlayNotification(
- EventCategoryDeviceInterfaceChange,
- 0, /* The registry has not been initialized yet */
- (PVOID)&GUID_DEVICE_SYS_BUTTON,
- IopRootDeviceNode->PhysicalDeviceObject->DriverObject,
- PopAddRemoveSysCapsCallback,
- NULL,
- &NotificationEntry);
+ else
+ {
+ /* Otherwise check the LoaderBlock's Flag */
+ PopAcpiPresent = HaveAcpiTable;
+ }
}
VOID