Author: fireball Date: Sat Dec 9 00:40:45 2006 New Revision: 25094
URL: http://svn.reactos.org/svn/reactos?rev=25094&view=rev Log: - Fix a bunch of lame bugs in keyboard/pointer controllers creation (missing configuration data length, wrong count of resources, etc).
Now NT boots up with working keyboard and mouse.
Modified: branches/winldr/arch/i386/hardware.c
Modified: branches/winldr/arch/i386/hardware.c URL: http://svn.reactos.org/svn/reactos/branches/winldr/arch/i386/hardware.c?rev=... ============================================================================== --- branches/winldr/arch/i386/hardware.c (original) +++ branches/winldr/arch/i386/hardware.c Sat Dec 9 00:40:45 2006 @@ -1822,6 +1822,7 @@ PCONFIGURATION_COMPONENT_DATA ControllerComponent; PCONFIGURATION_COMPONENT ControllerEntry; PCM_PARTIAL_RESOURCE_LIST ResourceList; + ULONG Size;
/* Create controller key */ ControllerComponent = (PCONFIGURATION_COMPONENT_DATA)MmAllocateMemory(sizeof(CONFIGURATION_COMPONENT_DATA)); @@ -1837,12 +1838,12 @@
/* Fill keyboard controller resources descriptor, which consists of: Partial Resource List + 2 Partial Resource Descriptors (Irq and 2 Ports) */ - ControllerComponent->ConfigurationData = MmAllocateMemory(sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - RtlZeroMemory(ControllerComponent->ConfigurationData, sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + 2*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + ControllerComponent->ConfigurationData = MmAllocateMemory(Size); + ControllerEntry->ConfigurationDataLength = Size; + RtlZeroMemory(ControllerComponent->ConfigurationData, Size); ResourceList = (PCM_PARTIAL_RESOURCE_LIST)ControllerComponent->ConfigurationData; - ResourceList->Count = 2; // Interrupt + Port + Port + ResourceList->Count = 3; // Interrupt + Port + Port
/* Interrupt */ ResourceList->PartialDescriptors[0].Type = CmResourceTypeInterrupt; @@ -2045,6 +2046,7 @@ PCONFIGURATION_COMPONENT_DATA ControllerComponent; PCONFIGURATION_COMPONENT ControllerEntry; PCM_PARTIAL_RESOURCE_LIST ResourceList; + ULONG Size;
/* If there is no PS2 aux port - return */ if (!DetectPS2AuxPort()) @@ -2066,10 +2068,10 @@
/* Fill mouse controller resources descriptor, which consists of: Partial Resource List */ - ControllerComponent->ConfigurationData = MmAllocateMemory(sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); - RtlZeroMemory(ControllerComponent->ConfigurationData, sizeof(CM_PARTIAL_RESOURCE_LIST) + - sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)); + Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR); + ControllerComponent->ConfigurationData = MmAllocateMemory(Size); + ControllerEntry->ConfigurationDataLength = Size; + RtlZeroMemory(ControllerComponent->ConfigurationData, Size); ResourceList = (PCM_PARTIAL_RESOURCE_LIST)ControllerComponent->ConfigurationData; ResourceList->Count = 1; // Interrupt