Author: fireball
Date: Tue Dec 11 18:12:05 2007
New Revision: 31144
URL:
http://svn.reactos.org/svn/reactos?rev=31144&view=rev
Log:
- Add missing types to DDK.
- Fix FldrSetconfigurationData: ARC Configuration Data is a CM_PARTIAL_RESOURCE_LIST, not
a CM_FULL_RESOURCE_DESCRIPTOR!
- The Interface Types for PCI BIOS and PCI IRQ Routing Table are Internal, not PCIBus.
- Disk drives are Internal, not Unknown.
- Replace CmpDumpHardwareTree by CmpSetupConfigurationTree which now calls
CmpInitializeRegistryNode (a function previously used to build the CPU ARC nodes
previously in the kernel). We now write the ARC tree in the HARDWARE\Description\System
key.
Modified:
trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h
trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
trunk/reactos/include/ddk/winddk.h
trunk/reactos/ntoskrnl/config/cmconfig.c
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hardware.c Tue Dec 11 18:12:05 2007
@@ -79,44 +79,6 @@
/* Timeout in ms for sending to keyboard controller. */
#define CONTROLLER_TIMEOUT 250
-
-typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
-{
- ULONG BytesPerSector;
- ULONG NumberOfCylinders;
- ULONG SectorsPerTrack;
- ULONG NumberOfHeads;
-} CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
-
-
-typedef struct _CM_PNP_BIOS_DEVICE_NODE
-{
- USHORT Size;
- CHAR Node;
- ULONG ProductId;
- CHAR DeviceType[3];
- USHORT DeviceAttributes;
-} __attribute__((packed)) CM_PNP_BIOS_DEVICE_NODE, *PCM_PNP_BIOS_DEVICE_NODE;
-
-
-typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK
-{
- UCHAR Signature[4];
- UCHAR Revision;
- UCHAR Length;
- USHORT ControlField;
- UCHAR Checksum;
- ULONG EventFlagAddress;
- USHORT RealModeEntryOffset;
- USHORT RealModeEntrySegment;
- USHORT ProtectedModeEntryOffset;
- ULONG ProtectedModeCodeBaseAddress;
- ULONG OemDeviceId;
- USHORT RealModeDataBaseAddress;
- ULONG ProtectedModeDataBaseAddress;
-} __attribute__((packed)) CM_PNP_BIOS_INSTALLATION_CHECK,
*PCM_PNP_BIOS_INSTALLATION_CHECK;
-
-
static WCHAR Hex[] = L"0123456789ABCDEF";
static unsigned int delay_count = 1;
@@ -388,7 +350,7 @@
}
memset(FullResourceDescriptor, 0, Size);
- FullResourceDescriptor->InterfaceType = InterfaceTypeUndefined;
+ FullResourceDescriptor->InterfaceType = Isa;
FullResourceDescriptor->BusNumber = 0;
FullResourceDescriptor->PartialResourceList.Version = 1;
FullResourceDescriptor->PartialResourceList.Revision = 1;
Modified: trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/arch/…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/arch/i386/hwpci.c Tue Dec 11 18:12:05 2007
@@ -183,7 +183,7 @@
/* Initialize resource descriptor */
memset(FullResourceDescriptor, 0, Size);
- FullResourceDescriptor->InterfaceType = Isa;
+ FullResourceDescriptor->InterfaceType = Internal;
FullResourceDescriptor->BusNumber = 0;
FullResourceDescriptor->PartialResourceList.Version = 1;
FullResourceDescriptor->PartialResourceList.Revision = 1;
@@ -259,7 +259,7 @@
/* Initialize resource descriptor */
memset(FullResourceDescriptor, 0, Size);
- FullResourceDescriptor->InterfaceType = PCIBus;
+ FullResourceDescriptor->InterfaceType = Internal;
FullResourceDescriptor->BusNumber = 0;
FullResourceDescriptor->PartialResourceList.Version = 0;
FullResourceDescriptor->PartialResourceList.Revision = 0;
Modified: trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/inclu…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h (original)
+++ trunk/reactos/boot/freeldr/freeldr/include/arch/i386/hardware.h Tue Dec 11 18:12:05
2007
@@ -75,7 +75,7 @@
NTAPI
FldrSetConfigurationData(
IN PCONFIGURATION_COMPONENT_DATA ComponentKey,
- IN PVOID ConfigurationData,
+ IN PCM_FULL_RESOURCE_DESCRIPTOR ConfigurationData,
IN ULONG Size
);
Modified: trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/freeldr/freeldr/react…
==============================================================================
--- trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c (original)
+++ trunk/reactos/boot/freeldr/freeldr/reactos/archwsup.c Tue Dec 11 18:12:05 2007
@@ -218,7 +218,7 @@
VOID
NTAPI
FldrSetConfigurationData(IN PCONFIGURATION_COMPONENT_DATA ComponentData,
- IN PVOID Data,
+ IN PCM_FULL_RESOURCE_DESCRIPTOR Data,
IN ULONG Size)
{
LONG Error;
@@ -230,17 +230,19 @@
if (!ConfigurationData) return;
/* Copy component information */
- RtlCopyMemory(ConfigurationData, Data, Size);
+ RtlCopyMemory(ConfigurationData, &Data->PartialResourceList.Version, Size);
/* Set component information */
ComponentData->ConfigurationData = ConfigurationData;
- Component->ConfigurationDataLength = Size;
+ Component->ConfigurationDataLength = Size -
+ FIELD_OFFSET(CM_FULL_RESOURCE_DESCRIPTOR,
+ PartialResourceList);
/* Set 'Configuration Data' value */
Error = RegSetValue((FRLDRHKEY)Component->Key,
L"Configuration Data",
REG_FULL_RESOURCE_DESCRIPTOR,
- Data,
+ (PVOID)Data,
Size);
if (Error != ERROR_SUCCESS)
{
Modified: trunk/reactos/include/ddk/winddk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/winddk.h?rev=3…
==============================================================================
--- trunk/reactos/include/ddk/winddk.h (original)
+++ trunk/reactos/include/ddk/winddk.h Tue Dec 11 18:12:05 2007
@@ -1775,7 +1775,42 @@
USHORT MaxHeads;
USHORT NumberDrives;
} CM_INT13_DRIVE_PARAMETER, *PCM_INT13_DRIVE_PARAMETER;
+
+typedef struct _CM_PNP_BIOS_DEVICE_NODE
+{
+ USHORT Size;
+ UCHAR Node;
+ ULONG ProductId;
+ UCHAR DeviceType[3];
+ USHORT DeviceAttributes;
+} CM_PNP_BIOS_DEVICE_NODE,*PCM_PNP_BIOS_DEVICE_NODE;
+
+typedef struct _CM_PNP_BIOS_INSTALLATION_CHECK
+{
+ UCHAR Signature[4];
+ UCHAR Revision;
+ UCHAR Length;
+ USHORT ControlField;
+ UCHAR Checksum;
+ ULONG EventFlagAddress;
+ USHORT RealModeEntryOffset;
+ USHORT RealModeEntrySegment;
+ USHORT ProtectedModeEntryOffset;
+ ULONG ProtectedModeCodeBaseAddress;
+ ULONG OemDeviceId;
+ USHORT RealModeDataBaseAddress;
+ ULONG ProtectedModeDataBaseAddress;
+} CM_PNP_BIOS_INSTALLATION_CHECK, *PCM_PNP_BIOS_INSTALLATION_CHECK;
+
#include <poppack.h>
+
+typedef struct _CM_DISK_GEOMETRY_DEVICE_DATA
+{
+ ULONG BytesPerSector;
+ ULONG NumberOfCylinders;
+ ULONG SectorsPerTrack;
+ ULONG NumberOfHeads;
+} CM_DISK_GEOMETRY_DEVICE_DATA, *PCM_DISK_GEOMETRY_DEVICE_DATA;
typedef struct _CM_KEYBOARD_DEVICE_DATA {
USHORT Version;
Modified: trunk/reactos/ntoskrnl/config/cmconfig.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmconfig.c…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmconfig.c (original)
+++ trunk/reactos/ntoskrnl/config/cmconfig.c Tue Dec 11 18:12:05 2007
@@ -195,17 +195,19 @@
return Status;
}
-int t, tabLevel;
-
-VOID
+NTSTATUS
NTAPI
-CmpDumpHardwareTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
- IN INTERFACE_TYPE InterfaceType,
- IN ULONG BusNumber)
+CmpSetupConfigurationTree(IN PCONFIGURATION_COMPONENT_DATA CurrentEntry,
+ IN HANDLE ParentHandle,
+ IN INTERFACE_TYPE InterfaceType,
+ IN ULONG BusNumber)
{
PCONFIGURATION_COMPONENT Component;
USHORT DeviceIndexTable[MaximumType + 1] = {0};
ULONG Interface = InterfaceType, Bus = BusNumber, i;
+ NTSTATUS Status;
+ HANDLE NewHandle;
+ static ULONG t, tabLevel;
PCHAR InterfaceStrings[MaximumInterfaceType + 1] =
{
"Internal",
@@ -226,7 +228,8 @@
"PNPBus",
"Unknown"
};
-
+
+ /* Loop each entry */
while (CurrentEntry)
{
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
@@ -234,7 +237,7 @@
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
DbgPrint("Parent @ 0x%p Sibling @ 0x%p Child @ 0x%p\n",
CurrentEntry->Parent, CurrentEntry->Sibling,
CurrentEntry->Child);
-
+
/* Check if this is an adapter */
Component = &CurrentEntry->ComponentEntry;
if ((Component->Class == AdapterClass) &&
@@ -250,7 +253,7 @@
Interface = Eisa;
Bus = CmpTypeCount[EisaAdapter]++;
break;
-
+
/* Turbo-channel */
case TcAdapter:
@@ -258,7 +261,7 @@
Interface = TurboChannel;
Bus = CmpTypeCount[TurboChannel]++;
break;
-
+
/* ISA, PCI, etc busses */
case MultiFunctionAdapter:
@@ -282,15 +285,15 @@
Bus = CmpMultifunctionTypes[i].Count++;
}
break;
-
+
/* SCSI Bus */
case ScsiAdapter:
-
+
/* Fix up */
Interface = Internal;
Bus = CmpTypeCount[ScsiAdapter]++;
break;
-
+
/* Unknown */
default:
Interface = -1;
@@ -298,9 +301,6 @@
break;
}
}
-
- /* Convert from NT to ARC class */
- if (Component->Class == SystemClass) Component->Type = ArcSystem;
/* Dump information on the component */
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
@@ -310,7 +310,7 @@
if (Component->Class != SystemClass)
{
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
- DbgPrint("Device Index: %lx\n",
DeviceIndexTable[Component->Type]++);
+ DbgPrint("Device Index: %lx\n",
DeviceIndexTable[Component->Type]);
}
for (t = 0; t < tabLevel; t++) DbgPrint("\t");
DbgPrint("Component Information:\n");
@@ -332,18 +332,40 @@
InterfaceStrings[Interface],
Bus);
+ /* Setup the hardware node */
+ Status = CmpInitializeRegistryNode(CurrentEntry,
+ ParentHandle,
+ &NewHandle,
+ Interface,
+ Bus,
+ DeviceIndexTable);
+ if (!NT_SUCCESS(Status)) return Status;
+
/* Check for children */
if (CurrentEntry->Child)
{
/* Recurse child */
tabLevel++;
- CmpDumpHardwareTree(CurrentEntry->Child, Interface, Bus);
+ Status = CmpSetupConfigurationTree(CurrentEntry->Child,
+ NewHandle,
+ Interface,
+ Bus);
tabLevel--;
+ if (!NT_SUCCESS(Status))
+ {
+ /* Fail */
+ NtClose(NewHandle);
+ return Status;
+ }
}
/* Get to the next entry */
+ NtClose(NewHandle);
CurrentEntry = CurrentEntry->Sibling;
}
+
+ /* We're done */
+ return STATUS_SUCCESS;
}
NTSTATUS
@@ -410,10 +432,13 @@
/* Check if we got anything from NTLDR */
if (LoaderBlock->ConfigurationRoot)
{
- /* Dump the hardware tree */
+ /* Setup the configuration tree */
DPRINT1("ARC Hardware Tree Received @ 0x%p. Dumping HW Info:\n\n",
LoaderBlock->ConfigurationRoot);
- CmpDumpHardwareTree(LoaderBlock->ConfigurationRoot, -1, -1);
+ Status = CmpSetupConfigurationTree(LoaderBlock->ConfigurationRoot,
+ KeyHandle,
+ -1,
+ -1);
}
else
{
@@ -428,3 +453,4 @@
}
+