Author: ion
Date: Thu May 10 20:42:24 2007
New Revision: 26675
URL:
http://svn.reactos.org/svn/reactos?rev=26675&view=rev
Log:
- Add i386/cmhardwr.c and start implementing CmpInitializeMachineDependentConfiguration.
Currently it only detects and writes the key for PAE.
- Call the API from CmInitSystem1.
Added:
trunk/reactos/ntoskrnl/config/i386/
trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
Modified:
trunk/reactos/ntoskrnl/cm/registry.c
trunk/reactos/ntoskrnl/ntoskrnl.rbuild
Modified: trunk/reactos/ntoskrnl/cm/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/cm/registry.c?rev…
==============================================================================
--- trunk/reactos/ntoskrnl/cm/registry.c (original)
+++ trunk/reactos/ntoskrnl/cm/registry.c Thu May 10 20:42:24 2007
@@ -73,6 +73,10 @@
NTSTATUS
NTAPI
CmpCreateControlSet(IN PLOADER_PARAMETER_BLOCK LoaderBlock);
+
+NTSTATUS
+NTAPI
+CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock);
static VOID STDCALL
CmiHiveSyncDpcRoutine(PKDPC Dpc,
@@ -508,6 +512,14 @@
{
/* Bugcheck */
KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 12, Status, 0);
+ }
+
+ /* Initialize machine-dependent information into the registry */
+ Status = CmpInitializeMachineDependentConfiguration(KeLoaderBlock);
+ if (!NT_SUCCESS(Status))
+ {
+ /* Bugcheck */
+ KEBUGCHECKEX(CONFIG_INITIALIZATION_FAILED, 1, 14, Status, 0);
}
/* Initialize volatile registry settings */
Added: trunk/reactos/ntoskrnl/config/i386/cmhardwr.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/i386/cmhar…
==============================================================================
--- trunk/reactos/ntoskrnl/config/i386/cmhardwr.c (added)
+++ trunk/reactos/ntoskrnl/config/i386/cmhardwr.c Thu May 10 20:42:24 2007
@@ -1,0 +1,57 @@
+/*
+ * PROJECT: ReactOS Kernel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: ntoskrnl/config/i386/cmhardwr.c
+ * PURPOSE: Configuration Manager - Hardware-Specific Code
+ * PROGRAMMERS: Alex Ionescu (alex.ionescu(a)reactos.org)
+ */
+
+/* INCLUDES ******************************************************************/
+
+#include "ntoskrnl.h"
+#include "../cm.h"
+#define NDEBUG
+#include "debug.h"
+
+/* FUNCTIONS *****************************************************************/
+
+NTSTATUS
+NTAPI
+CmpInitializeMachineDependentConfiguration(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
+{
+ UNICODE_STRING KeyName, ValueName;
+ OBJECT_ATTRIBUTES ObjectAttributes;
+ ULONG HavePae;
+ NTSTATUS Status;
+ HANDLE KeyHandle;
+
+ RtlInitUnicodeString(&KeyName,
+ L"\\Registry\\Machine\\SYSTEM\\CurrentControlSet\\"
+ L"Control\\Session Manager\\Memory Management");
+ InitializeObjectAttributes(&ObjectAttributes,
+ &KeyName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL);
+ Status = NtOpenKey(&KeyHandle, KEY_READ | KEY_WRITE, &ObjectAttributes);
+ if (NT_SUCCESS(Status))
+ {
+ /* Detect if PAE is enabled */
+ HavePae = SharedUserData->ProcessorFeatures[PF_PAE_ENABLED];
+
+ /* Set the value */
+ RtlInitUnicodeString(&ValueName, L"PhysicalAddressExtension");
+ NtSetValueKey(KeyHandle,
+ &ValueName,
+ 0,
+ REG_DWORD,
+ &HavePae,
+ sizeof(HavePae));
+
+ /* Close the key */
+ NtClose(KeyHandle);
+ }
+
+ /* All done*/
+ return STATUS_SUCCESS;
+}
Modified: trunk/reactos/ntoskrnl/ntoskrnl.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ntoskrnl.rbuild?r…
==============================================================================
--- trunk/reactos/ntoskrnl/ntoskrnl.rbuild (original)
+++ trunk/reactos/ntoskrnl/ntoskrnl.rbuild Thu May 10 20:42:24 2007
@@ -84,6 +84,11 @@
<file>view.c</file>
</directory>
<directory name="config">
+ <if property="ARCH" value="i386">
+ <directory name="i386">
+ <file>cmhardwr.c</file>
+ </directory>
+ </if>
<file>cmboot.c</file>
<file>cmcontrl.c</file>
<file>cmdata.c</file>