ReactOS  0.4.15-dev-5089-g555bec6
machpc.c
Go to the documentation of this file.
1 /*
2  * FreeLoader
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #include <freeldr.h>
20 #include <cportlib/cportlib.h>
21 
22 #include <debug.h>
23 DBG_DEFAULT_CHANNEL(HWDETECT);
24 
25 
26 /* Maximum number of COM and LPT ports */
27 #define MAX_COM_PORTS 4
28 #define MAX_LPT_PORTS 3
29 
30 /* No Mouse */
31 #define MOUSE_TYPE_NONE 0
32 /* Microsoft Mouse with 2 buttons */
33 #define MOUSE_TYPE_MICROSOFT 1
34 /* Logitech Mouse with 3 buttons */
35 #define MOUSE_TYPE_LOGITECH 2
36 /* Microsoft Wheel Mouse (aka Z Mouse) */
37 #define MOUSE_TYPE_WHEELZ 3
38 /* Mouse Systems Mouse */
39 #define MOUSE_TYPE_MOUSESYSTEMS 4
40 
41 
42 /* PS2 stuff */
43 
44 /* Controller registers. */
45 #define CONTROLLER_REGISTER_STATUS 0x64
46 #define CONTROLLER_REGISTER_CONTROL 0x64
47 #define CONTROLLER_REGISTER_DATA 0x60
48 
49 /* Controller commands. */
50 #define CONTROLLER_COMMAND_READ_MODE 0x20
51 #define CONTROLLER_COMMAND_WRITE_MODE 0x60
52 #define CONTROLLER_COMMAND_GET_VERSION 0xA1
53 #define CONTROLLER_COMMAND_MOUSE_DISABLE 0xA7
54 #define CONTROLLER_COMMAND_MOUSE_ENABLE 0xA8
55 #define CONTROLLER_COMMAND_TEST_MOUSE 0xA9
56 #define CONTROLLER_COMMAND_SELF_TEST 0xAA
57 #define CONTROLLER_COMMAND_KEYBOARD_TEST 0xAB
58 #define CONTROLLER_COMMAND_KEYBOARD_DISABLE 0xAD
59 #define CONTROLLER_COMMAND_KEYBOARD_ENABLE 0xAE
60 #define CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER 0xD3
61 #define CONTROLLER_COMMAND_WRITE_MOUSE 0xD4
62 
63 /* Controller status */
64 #define CONTROLLER_STATUS_OUTPUT_BUFFER_FULL 0x01
65 #define CONTROLLER_STATUS_INPUT_BUFFER_FULL 0x02
66 #define CONTROLLER_STATUS_SELF_TEST 0x04
67 #define CONTROLLER_STATUS_COMMAND 0x08
68 #define CONTROLLER_STATUS_UNLOCKED 0x10
69 #define CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL 0x20
70 #define CONTROLLER_STATUS_GENERAL_TIMEOUT 0x40
71 #define CONTROLLER_STATUS_PARITY_ERROR 0x80
72 #define AUX_STATUS_OUTPUT_BUFFER_FULL (CONTROLLER_STATUS_OUTPUT_BUFFER_FULL | \
73  CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL)
74 
75 /* Timeout in ms for sending to keyboard controller. */
76 #define CONTROLLER_TIMEOUT 250
77 
78 
79 VOID
81 {
82  REGS BiosRegs;
83 
84  /* Get address and size of the extended BIOS data area */
85  BiosRegs.d.eax = 0xC100;
86  Int386(0x15, &BiosRegs, &BiosRegs);
87  if (INT386_SUCCESS(BiosRegs))
88  {
89  *ExtendedBIOSDataArea = BiosRegs.w.es << 4;
90  *ExtendedBIOSDataSize = 1024;
91  }
92  else
93  {
94  WARN("Int 15h AH=C1h call failed\n");
97  }
98 }
99 
100 // NOTE: Similar to machxbox.c!XboxGetHarddiskConfigurationData(),
101 // but with extended geometry support.
102 static
105 {
106  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
107  PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
108  // EXTENDED_GEOMETRY ExtGeometry;
109  GEOMETRY Geometry;
110  ULONG Size;
111 
112  //
113  // Initialize returned size
114  //
115  *pSize = 0;
116 
117  /* Set 'Configuration Data' value */
118  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
120  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
121  if (PartialResourceList == NULL)
122  {
123  ERR("Failed to allocate resource descriptor\n");
124  return NULL;
125  }
126 
127  RtlZeroMemory(PartialResourceList, Size);
128  PartialResourceList->Version = 1;
129  PartialResourceList->Revision = 1;
130  PartialResourceList->Count = 1;
131  PartialResourceList->PartialDescriptors[0].Type =
133 // PartialResourceList->PartialDescriptors[0].ShareDisposition =
134 // PartialResourceList->PartialDescriptors[0].Flags =
135  PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
137 
138  /* Get pointer to geometry data */
139  DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
140 
141  /* Get the disk geometry */
142 #if 0 // This is somehow replaced by what PcDiskGetDriveGeometry() does internally.
143  ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
144  if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size))
145  {
146  DiskGeometry->BytesPerSector = ExtGeometry.BytesPerSector;
147  DiskGeometry->NumberOfCylinders = ExtGeometry.Cylinders;
148  DiskGeometry->SectorsPerTrack = ExtGeometry.SectorsPerTrack;
149  DiskGeometry->NumberOfHeads = ExtGeometry.Heads;
150  }
151  else
152 #endif
153  if (PcDiskGetDriveGeometry(DriveNumber, &Geometry))
154  {
155  DiskGeometry->BytesPerSector = Geometry.BytesPerSector;
156  DiskGeometry->NumberOfCylinders = Geometry.Cylinders;
157  DiskGeometry->SectorsPerTrack = Geometry.Sectors;
158  DiskGeometry->NumberOfHeads = Geometry.Heads;
159  }
160  else
161  {
162  TRACE("Reading disk geometry failed\n");
163  FrLdrHeapFree(PartialResourceList, TAG_HW_RESOURCE_LIST);
164  return NULL;
165  }
166  TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
167  DriveNumber,
168  DiskGeometry->NumberOfCylinders,
169  DiskGeometry->NumberOfHeads,
170  DiskGeometry->SectorsPerTrack,
171  DiskGeometry->BytesPerSector);
172 
173  //
174  // Return configuration data
175  //
176  *pSize = Size;
177  return PartialResourceList;
178 }
179 
180 static
181 VOID
183 {
184  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
188  ULONG x;
189  ULONG NodeSize = 0;
190  ULONG NodeCount = 0;
192  ULONG FoundNodeCount;
193  int i;
194  ULONG PnpBufferSize;
195  ULONG PnpBufferSizeLimit;
196  ULONG Size;
197  char *Ptr;
198 
200  if (InstData == NULL || strncmp((CHAR*)InstData->Signature, "$PnP", 4))
201  {
202  TRACE("PnP-BIOS not supported\n");
203  return;
204  }
205 
206  TRACE("PnP-BIOS supported\n");
207  TRACE("Signature '%c%c%c%c'\n",
208  InstData->Signature[0], InstData->Signature[1],
209  InstData->Signature[2], InstData->Signature[3]);
210 
211  x = PnpBiosGetDeviceNodeCount(&NodeSize, &NodeCount);
212  if (x == 0x82)
213  {
214  TRACE("PnP-BIOS function 'Get Number of System Device Nodes' not supported\n");
215  return;
216  }
217 
218  NodeCount &= 0xFF; // needed since some fscked up BIOSes return
219  // wrong info (e.g. Mac Virtual PC)
220  // e.g. look: http://my.execpc.com/~geezer/osd/pnp/pnp16.c
221  if (x != 0 || NodeSize == 0 || NodeCount == 0)
222  {
223  ERR("PnP-BIOS failed to enumerate device nodes\n");
224  return;
225  }
226  TRACE("MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount);
227  TRACE("Estimated buffer size %u\n", NodeSize * NodeCount);
228 
229  /* Set 'Configuration Data' value */
230  PnpBufferSizeLimit = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK)
231  + (NodeSize * NodeCount);
232  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSizeLimit;
233  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
234  if (PartialResourceList == NULL)
235  {
236  ERR("Failed to allocate resource descriptor\n");
237  return;
238  }
239 
240  /* Initialize resource descriptor */
241  RtlZeroMemory(PartialResourceList, Size);
242  PartialResourceList->Version = 1;
243  PartialResourceList->Revision = 1;
244  PartialResourceList->Count = 1;
245  PartialResourceList->PartialDescriptors[0].Type =
247  PartialResourceList->PartialDescriptors[0].ShareDisposition =
249 
250  /* The buffer starts after PartialResourceList->PartialDescriptors[0] */
251  Ptr = (char *)(PartialResourceList + 1);
252 
253  /* Set installation check data */
254  memcpy (Ptr, InstData, sizeof(CM_PNP_BIOS_INSTALLATION_CHECK));
256  PnpBufferSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK);
257 
258  /* Copy device nodes */
259  FoundNodeCount = 0;
260  for (i = 0; i < 0xFF; i++)
261  {
262  NodeNumber = (UCHAR)i;
263 
265  if (x == 0)
266  {
268 
269  TRACE("Node: %u Size %u (0x%x)\n",
270  DeviceNode->Node,
271  DeviceNode->Size,
272  DeviceNode->Size);
273 
274  if (PnpBufferSize + DeviceNode->Size > PnpBufferSizeLimit)
275  {
276  ERR("Buffer too small! Ignoring remaining device nodes. (i = %d)\n", i);
277  break;
278  }
279 
280  memcpy(Ptr, DeviceNode, DeviceNode->Size);
281 
282  Ptr += DeviceNode->Size;
283  PnpBufferSize += DeviceNode->Size;
284 
285  FoundNodeCount++;
286  if (FoundNodeCount >= NodeCount)
287  break;
288  }
289  }
290 
291  /* Set real data size */
292  PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
293  PnpBufferSize;
294  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize;
295 
296  TRACE("Real buffer size: %u\n", PnpBufferSize);
297  TRACE("Resource size: %u\n", Size);
298 
299  /* Create component key */
300  FldrCreateComponentKey(SystemKey,
301  AdapterClass,
302  MultiFunctionAdapter,
303  0x0,
304  0x0,
305  0xFFFFFFFF,
306  "PNP BIOS",
307  PartialResourceList,
308  Size,
309  &BusKey);
310 
311  (*BusNumber)++;
312 }
313 
314 static
315 VOID
317  UCHAR LineControl)
318 {
319  WRITE_PORT_UCHAR(Port + 3, 0x80); /* set DLAB on */
320  WRITE_PORT_UCHAR(Port, 0x60); /* speed LO byte */
321  WRITE_PORT_UCHAR(Port + 1, 0); /* speed HI byte */
322  WRITE_PORT_UCHAR(Port + 3, LineControl);
323  WRITE_PORT_UCHAR(Port + 1, 0); /* set comm and DLAB to 0 */
324  WRITE_PORT_UCHAR(Port + 4, 0x09); /* DR int enable */
325  READ_PORT_UCHAR(Port + 5); /* clear error bits */
326 }
327 
328 static
329 ULONG
331 {
332  CHAR Buffer[4];
333  ULONG i;
334  ULONG TimeOut;
335  UCHAR LineControl;
336 
337  /* Shutdown mouse or something like that */
338  LineControl = READ_PORT_UCHAR(Port + 4);
339  WRITE_PORT_UCHAR(Port + 4, (LineControl & ~0x02) | 0x01);
340  StallExecutionProcessor(100000);
341 
342  /*
343  * Clear buffer
344  * Maybe there is no serial port although BIOS reported one (this
345  * is the case on Apple hardware), or the serial port is misbehaving,
346  * therefore we must give up after some time.
347  */
348  TimeOut = 200;
349  while (READ_PORT_UCHAR(Port + 5) & 0x01)
350  {
351  if (--TimeOut == 0)
352  return MOUSE_TYPE_NONE;
354  }
355 
356  /*
357  * Send modem control with 'Data Terminal Ready', 'Request To Send' and
358  * 'Output Line 2' message. This enables mouse to identify.
359  */
360  WRITE_PORT_UCHAR(Port + 4, 0x0b);
361 
362  /* Wait 10 milliseconds for the mouse getting ready */
364 
365  /* Read first four bytes, which contains Microsoft Mouse signs */
366  TimeOut = 20;
367  for (i = 0; i < 4; i++)
368  {
369  while ((READ_PORT_UCHAR(Port + 5) & 1) == 0)
370  {
372  --TimeOut;
373  if (TimeOut == 0)
374  return MOUSE_TYPE_NONE;
375  }
377  }
378 
379  TRACE("Mouse data: %x %x %x %x\n",
380  Buffer[0], Buffer[1], Buffer[2], Buffer[3]);
381 
382  /* Check that four bytes for signs */
383  for (i = 0; i < 4; ++i)
384  {
385  if (Buffer[i] == 'B')
386  {
387  /* Sign for Microsoft Ballpoint */
388 // DbgPrint("Microsoft Ballpoint device detected\n");
389 // DbgPrint("THIS DEVICE IS NOT SUPPORTED, YET\n");
390  return MOUSE_TYPE_NONE;
391  }
392  else if (Buffer[i] == 'M')
393  {
394  /* Sign for Microsoft Mouse protocol followed by button specifier */
395  if (i == 3)
396  {
397  /* Overflow Error */
398  return MOUSE_TYPE_NONE;
399  }
400 
401  switch (Buffer[i + 1])
402  {
403  case '3':
404  TRACE("Microsoft Mouse with 3-buttons detected\n");
405  return MOUSE_TYPE_LOGITECH;
406 
407  case 'Z':
408  TRACE("Microsoft Wheel Mouse detected\n");
409  return MOUSE_TYPE_WHEELZ;
410 
411  /* case '2': */
412  default:
413  TRACE("Microsoft Mouse with 2-buttons detected\n");
414  return MOUSE_TYPE_MICROSOFT;
415  }
416  }
417  }
418 
419  return MOUSE_TYPE_NONE;
420 }
421 
422 static ULONG
424 {
425  ULONG TimeOut;
426  ULONG i = 0;
427  char c;
428  char x;
429 
430  WRITE_PORT_UCHAR(Port + 4, 0x09);
431 
432  /* Wait 10 milliseconds for the mouse getting ready */
434 
435  WRITE_PORT_UCHAR(Port + 4, 0x0b);
436 
438 
439  for (;;)
440  {
441  TimeOut = 200;
442  while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
443  {
445  --TimeOut;
446  if (TimeOut == 0)
447  {
448  return 0;
449  }
450  }
451 
453  if (c == 0x08 || c == 0x28)
454  break;
455  }
456 
457  Buffer[i++] = c;
458  x = c + 1;
459 
460  for (;;)
461  {
462  TimeOut = 200;
463  while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
464  {
466  --TimeOut;
467  if (TimeOut == 0)
468  return 0;
469  }
471  Buffer[i++] = c;
472  if (c == x)
473  break;
474  if (i >= 256)
475  break;
476  }
477 
478  return i;
479 }
480 
481 static
482 VOID
484  PUCHAR Base)
485 {
486  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
487  char Buffer[256];
488  CHAR Identifier[256];
489  PCONFIGURATION_COMPONENT_DATA PeripheralKey;
490  ULONG MouseType;
491  ULONG Size, Length;
492  ULONG i;
493  ULONG j;
494  ULONG k;
495 
496  TRACE("DetectSerialPointerPeripheral()\n");
497 
498  Identifier[0] = 0;
499 
501  MouseType = DetectSerialMouse(Base);
502 
503  if (MouseType != MOUSE_TYPE_NONE)
504  {
506  TRACE( "PnP ID length: %u\n", Length);
507 
508  if (Length != 0)
509  {
510  /* Convert PnP sting to ASCII */
511  if (Buffer[0] == 0x08)
512  {
513  for (i = 0; i < Length; i++)
514  Buffer[i] += 0x20;
515  }
516  Buffer[Length] = 0;
517 
518  TRACE("PnP ID string: %s\n", Buffer);
519 
520  /* Copy PnpId string */
521  for (i = 0; i < 7; i++)
522  {
523  Identifier[i] = Buffer[3 + i];
524  }
525  memcpy(&Identifier[7],
526  L" - ",
527  3 * sizeof(WCHAR));
528 
529  /* Skip device serial number */
530  i = 10;
531  if (Buffer[i] == '\\')
532  {
533  for (j = ++i; i < Length; ++i)
534  {
535  if (Buffer[i] == '\\')
536  break;
537  }
538  if (i >= Length)
539  i -= 3;
540  }
541 
542  /* Skip PnP class */
543  if (Buffer[i] == '\\')
544  {
545  for (j = ++i; i < Length; ++i)
546  {
547  if (Buffer[i] == '\\')
548  break;
549  }
550 
551  if (i >= Length)
552  i -= 3;
553  }
554 
555  /* Skip compatible PnP Id */
556  if (Buffer[i] == '\\')
557  {
558  for (j = ++i; i < Length; ++i)
559  {
560  if (Buffer[i] == '\\')
561  break;
562  }
563  if (Buffer[j] == '*')
564  ++j;
565  if (i >= Length)
566  i -= 3;
567  }
568 
569  /* Get product description */
570  if (Buffer[i] == '\\')
571  {
572  for (j = ++i; i < Length; ++i)
573  {
574  if (Buffer[i] == ';')
575  break;
576  }
577  if (i >= Length)
578  i -= 3;
579  if (i > j + 1)
580  {
581  for (k = 0; k < i - j; k++)
582  {
583  Identifier[k + 10] = Buffer[k + j];
584  }
585  Identifier[10 + (i - j)] = 0;
586  }
587  }
588 
589  TRACE("Identifier string: %s\n", Identifier);
590  }
591 
592  if (Length == 0 || strlen(Identifier) < 11)
593  {
594  switch (MouseType)
595  {
596  case MOUSE_TYPE_LOGITECH:
597  strcpy(Identifier, "LOGITECH SERIAL MOUSE");
598  break;
599 
600  case MOUSE_TYPE_WHEELZ:
601  strcpy(Identifier, "MICROSOFT SERIAL MOUSE WITH WHEEL");
602  break;
603 
605  default:
606  strcpy(Identifier, "MICROSOFT SERIAL MOUSE");
607  break;
608  }
609  }
610 
611  /* Set 'Configuration Data' value */
612  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
614  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
615  if (PartialResourceList == NULL)
616  {
617  ERR("Failed to allocate resource descriptor\n");
618  return;
619  }
620 
621  RtlZeroMemory(PartialResourceList, Size);
622  PartialResourceList->Version = 1;
623  PartialResourceList->Revision = 1;
624  PartialResourceList->Count = 0;
625 
626  /* Create 'PointerPeripheral' key */
627  FldrCreateComponentKey(ControllerKey,
629  PointerPeripheral,
630  Input,
631  0x0,
632  0xFFFFFFFF,
633  Identifier,
634  PartialResourceList,
635  Size,
636  &PeripheralKey);
637 
638  TRACE("Created key: PointerPeripheral\\0\n");
639  }
640 }
641 
642 ULONG
644 {
645  static const ULONG PcIrq[MAX_COM_PORTS] = {4, 3, 4, 3};
646  PUSHORT BasePtr;
647 
648  /*
649  * The BIOS data area 0x400 holds the address of the first valid COM port.
650  * Each COM port address is stored in a 2-byte field.
651  * Infos at: http://www.bioscentral.com/misc/bda.htm
652  */
653  BasePtr = (PUSHORT)0x400;
654  *Irq = PcIrq[Index];
655 
656  return (ULONG) *(BasePtr + Index);
657 }
658 
659 VOID
661 {
662  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
663  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
664  PCM_SERIAL_DEVICE_DATA SerialDeviceData;
665  ULONG Irq;
666  ULONG Base;
667  CHAR Buffer[80];
668  ULONG ControllerNumber = 0;
669  PCONFIGURATION_COMPONENT_DATA ControllerKey;
670  ULONG i;
671  ULONG Size;
672 
673  TRACE("DetectSerialPorts()\n");
674 
675  for (i = 0; i < Count; i++)
676  {
677  Base = MachGetSerialPort(i, &Irq);
678  if ((Base == 0) || !CpDoesPortExist(UlongToPtr(Base)))
679  continue;
680 
681  TRACE("Found COM%u port at 0x%x\n", i + 1, Base);
682 
683  /* Set 'Identifier' value */
684  sprintf(Buffer, "COM%ld", i + 1);
685 
686  /* Build full device descriptor */
687  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
688  2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
689  sizeof(CM_SERIAL_DEVICE_DATA);
690  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
691  if (PartialResourceList == NULL)
692  {
693  ERR("Failed to allocate resource descriptor! Ignoring remaining serial ports. (i = %lu, Count = %lu)\n",
694  i, Count);
695  break;
696  }
697 
698  /* Initialize resource descriptor */
699  RtlZeroMemory(PartialResourceList, Size);
700  PartialResourceList->Version = 1;
701  PartialResourceList->Revision = 1;
702  PartialResourceList->Count = 3;
703 
704  /* Set IO Port */
705  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
706  PartialDescriptor->Type = CmResourceTypePort;
708  PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
709  PartialDescriptor->u.Port.Start.LowPart = Base;
710  PartialDescriptor->u.Port.Start.HighPart = 0x0;
711  PartialDescriptor->u.Port.Length = 8;
712 
713  /* Set Interrupt */
714  PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
715  PartialDescriptor->Type = CmResourceTypeInterrupt;
716  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
717  PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
718  PartialDescriptor->u.Interrupt.Level = Irq;
719  PartialDescriptor->u.Interrupt.Vector = Irq;
720  PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
721 
722  /* Set serial data (device specific) */
723  PartialDescriptor = &PartialResourceList->PartialDescriptors[2];
724  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
725  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
726  PartialDescriptor->Flags = 0;
727  PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_SERIAL_DEVICE_DATA);
728 
729  SerialDeviceData =
730  (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3];
731  SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
732 
733  /* Create controller key */
734  FldrCreateComponentKey(BusKey,
736  SerialController,
738  ControllerNumber,
739  0xFFFFFFFF,
740  Buffer,
741  PartialResourceList,
742  Size,
743  &ControllerKey);
744 
746  {
747  /* Detect serial mouse */
749  }
750 
751  ControllerNumber++;
752  }
753 }
754 
755 static VOID
757 {
758  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
759  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
760  ULONG Irq[MAX_LPT_PORTS] = {7, 5, (ULONG) - 1};
761  CHAR Buffer[80];
762  PCONFIGURATION_COMPONENT_DATA ControllerKey;
763  PUSHORT BasePtr;
764  ULONG Base;
765  ULONG ControllerNumber = 0;
766  ULONG i;
767  ULONG Size;
768 
769  TRACE("DetectParallelPorts() called\n");
770 
771  /*
772  * The BIOS data area 0x408 holds the address of the first valid LPT port.
773  * Each LPT port address is stored in a 2-byte field.
774  * Infos at: http://www.bioscentral.com/misc/bda.htm
775  */
776  BasePtr = (PUSHORT)0x408;
777 
778  for (i = 0; i < MAX_LPT_PORTS; i++, BasePtr++)
779  {
780  Base = (ULONG) * BasePtr;
781  if (Base == 0)
782  continue;
783 
784  TRACE("Parallel port %u: %x\n", ControllerNumber, Base);
785 
786  /* Set 'Identifier' value */
787  sprintf(Buffer, "PARALLEL%ld", i + 1);
788 
789  /* Build full device descriptor */
790  Size = sizeof(CM_PARTIAL_RESOURCE_LIST);
791  if (Irq[i] != (ULONG) - 1)
793 
794  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
795  if (PartialResourceList == NULL)
796  {
797  ERR("Failed to allocate resource descriptor! Ignoring remaining parallel ports. (i = %lu)\n", i);
798  break;
799  }
800 
801  /* Initialize resource descriptor */
802  RtlZeroMemory(PartialResourceList, Size);
803  PartialResourceList->Version = 1;
804  PartialResourceList->Revision = 1;
805  PartialResourceList->Count = (Irq[i] != (ULONG) - 1) ? 2 : 1;
806 
807  /* Set IO Port */
808  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
809  PartialDescriptor->Type = CmResourceTypePort;
811  PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
812  PartialDescriptor->u.Port.Start.LowPart = Base;
813  PartialDescriptor->u.Port.Start.HighPart = 0x0;
814  PartialDescriptor->u.Port.Length = 3;
815 
816  /* Set Interrupt */
817  if (Irq[i] != (ULONG) - 1)
818  {
819  PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
820  PartialDescriptor->Type = CmResourceTypeInterrupt;
821  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
822  PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
823  PartialDescriptor->u.Interrupt.Level = Irq[i];
824  PartialDescriptor->u.Interrupt.Vector = Irq[i];
825  PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
826  }
827 
828  /* Create controller key */
829  FldrCreateComponentKey(BusKey,
831  ParallelController,
832  Output,
833  ControllerNumber,
834  0xFFFFFFFF,
835  Buffer,
836  PartialResourceList,
837  Size,
838  &ControllerKey);
839 
840  ControllerNumber++;
841  }
842 
843  TRACE("DetectParallelPorts() done\n");
844 }
845 
846 // static
847 BOOLEAN
849 {
850  UCHAR Status;
851  UCHAR Scancode;
852  ULONG Loops;
853  BOOLEAN Result = TRUE;
854 
855  /* Identify device */
857 
858  /* Wait for reply */
859  for (Loops = 0; Loops < 100; Loops++)
860  {
864  break;
865  }
866 
868  {
869  /* PC/XT keyboard or no keyboard */
870  Result = FALSE;
871  }
872 
874  if (Scancode != 0xFA)
875  {
876  /* No ACK received */
877  Result = FALSE;
878  }
879 
881 
884  {
885  /* Found AT keyboard */
886  return Result;
887  }
888 
890  if (Scancode != 0xAB)
891  {
892  /* No 0xAB received */
893  Result = FALSE;
894  }
895 
897 
900  {
901  /* No byte in buffer */
902  Result = FALSE;
903  }
904 
906  if (Scancode != 0x41)
907  {
908  /* No 0x41 received */
909  Result = FALSE;
910  }
911 
912  /* Found MF-II keyboard */
913  return Result;
914 }
915 
916 static VOID
918 {
919  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
920  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
921  PCM_KEYBOARD_DEVICE_DATA KeyboardData;
922  PCONFIGURATION_COMPONENT_DATA PeripheralKey;
923  ULONG Size;
924  REGS Regs;
925 
926  /* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2
927  if (DetectKeyboardDevice()) */
928  {
929  /* Set 'Configuration Data' value */
930  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
931  sizeof(CM_KEYBOARD_DEVICE_DATA);
932  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
933  if (PartialResourceList == NULL)
934  {
935  ERR("Failed to allocate resource descriptor\n");
936  return;
937  }
938 
939  /* Initialize resource descriptor */
940  RtlZeroMemory(PartialResourceList, Size);
941  PartialResourceList->Version = 1;
942  PartialResourceList->Revision = 1;
943  PartialResourceList->Count = 1;
944 
945  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
946  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
947  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
948  PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_KEYBOARD_DEVICE_DATA);
949 
950  /* Int 16h AH=02h
951  * KEYBOARD - GET SHIFT FLAGS
952  *
953  * Return:
954  * AL - shift flags
955  */
956  Regs.b.ah = 0x02;
957  Int386(0x16, &Regs, &Regs);
958 
959  KeyboardData = (PCM_KEYBOARD_DEVICE_DATA)(PartialDescriptor + 1);
960  KeyboardData->Version = 1;
961  KeyboardData->Revision = 1;
962  KeyboardData->Type = 4;
963  KeyboardData->Subtype = 0;
964  KeyboardData->KeyboardFlags = Regs.b.al;
965 
966  /* Create controller key */
967  FldrCreateComponentKey(ControllerKey,
969  KeyboardPeripheral,
970  Input | ConsoleIn,
971  0x0,
972  0xFFFFFFFF,
973  "PCAT_ENHANCED",
974  PartialResourceList,
975  Size,
976  &PeripheralKey);
977  TRACE("Created key: KeyboardPeripheral\\0\n");
978  }
979 }
980 
981 static
982 VOID
984 {
985  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
986  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
987  PCONFIGURATION_COMPONENT_DATA ControllerKey;
988  ULONG Size;
989 
990  /* Set 'Configuration Data' value */
991  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
992  2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
993  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
994  if (PartialResourceList == NULL)
995  {
996  ERR("Failed to allocate resource descriptor\n");
997  return;
998  }
999 
1000  /* Initialize resource descriptor */
1001  RtlZeroMemory(PartialResourceList, Size);
1002  PartialResourceList->Version = 1;
1003  PartialResourceList->Revision = 1;
1004  PartialResourceList->Count = 3;
1005 
1006  /* Set Interrupt */
1007  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1008  PartialDescriptor->Type = CmResourceTypeInterrupt;
1009  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1010  PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
1011  PartialDescriptor->u.Interrupt.Level = 1;
1012  PartialDescriptor->u.Interrupt.Vector = 1;
1013  PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
1014 
1015  /* Set IO Port 0x60 */
1016  PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
1017  PartialDescriptor->Type = CmResourceTypePort;
1018  PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1019  PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
1020  PartialDescriptor->u.Port.Start.LowPart = 0x60;
1021  PartialDescriptor->u.Port.Start.HighPart = 0x0;
1022  PartialDescriptor->u.Port.Length = 1;
1023 
1024  /* Set IO Port 0x64 */
1025  PartialDescriptor = &PartialResourceList->PartialDescriptors[2];
1026  PartialDescriptor->Type = CmResourceTypePort;
1027  PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1028  PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
1029  PartialDescriptor->u.Port.Start.LowPart = 0x64;
1030  PartialDescriptor->u.Port.Start.HighPart = 0x0;
1031  PartialDescriptor->u.Port.Length = 1;
1032 
1033  /* Create controller key */
1034  FldrCreateComponentKey(BusKey,
1036  KeyboardController,
1037  Input | ConsoleIn,
1038  0x0,
1039  0xFFFFFFFF,
1040  NULL,
1041  PartialResourceList,
1042  Size,
1043  &ControllerKey);
1044  TRACE("Created key: KeyboardController\\0\n");
1045 
1046  DetectKeyboardPeripheral(ControllerKey);
1047 }
1048 
1049 static
1050 VOID
1052 {
1053  ULONG Timeout;
1054  UCHAR Status;
1055 
1056  for (Timeout = 0; Timeout < CONTROLLER_TIMEOUT; Timeout++)
1057  {
1060  return;
1061 
1062  /* Sleep for one millisecond */
1064  }
1065 }
1066 
1067 static
1068 BOOLEAN
1070 {
1071 #if 1
1072  /* Current detection is too unreliable. Just do as if
1073  * the PS/2 aux port is always present
1074  */
1075  return TRUE;
1076 #else
1077  ULONG Loops;
1078  UCHAR Status;
1079 
1080  /* Put the value 0x5A in the output buffer using the
1081  * "WriteAuxiliary Device Output Buffer" command (0xD3).
1082  * Poll the Status Register for a while to see if the value really turns up
1083  * in the Data Register. If the KEYBOARD_STATUS_MOUSE_OBF bit is also set
1084  * to 1 in the Status Register, we assume this controller has an
1085  * Auxiliary Port (a.k.a. Mouse Port).
1086  */
1091 
1092  /* 0x5A is a random dummy value */
1094  0x5A);
1095 
1096  for (Loops = 0; Loops < 10; Loops++)
1097  {
1098  StallExecutionProcessor(10000);
1101  break;
1102  }
1103 
1105 
1107 #endif
1108 }
1109 
1110 static
1111 BOOLEAN
1113 {
1114  UCHAR Scancode;
1115  UCHAR Status;
1116  ULONG Loops;
1117  BOOLEAN Result = TRUE;
1118 
1123 
1124  /* Identify device */
1126 
1127  /* Wait for reply */
1128  for (Loops = 0; Loops < 100; Loops++)
1129  {
1130  StallExecutionProcessor(10000);
1133  break;
1134  }
1135 
1138  Result = FALSE;
1139 
1141  if (Scancode != 0xFA)
1142  Result = FALSE;
1143 
1144  StallExecutionProcessor(10000);
1145 
1148  Result = FALSE;
1149 
1151  if (Scancode != 0x00)
1152  Result = FALSE;
1153 
1154  return Result;
1155 }
1156 
1157 // FIXME: Missing: DetectPS2Peripheral!! (for corresponding 'PointerPeripheral')
1158 
1159 static
1160 VOID
1162 {
1163  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1164  PCONFIGURATION_COMPONENT_DATA ControllerKey;
1165  PCONFIGURATION_COMPONENT_DATA PeripheralKey;
1166  ULONG Size;
1167 
1168  if (DetectPS2AuxPort())
1169  {
1170  TRACE("Detected PS2 port\n");
1171 
1172  PartialResourceList = FrLdrHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST), TAG_HW_RESOURCE_LIST);
1173  if (PartialResourceList == NULL)
1174  {
1175  ERR("Failed to allocate resource descriptor\n");
1176  return;
1177  }
1178 
1179  /* Initialize resource descriptor */
1180  RtlZeroMemory(PartialResourceList, sizeof(CM_PARTIAL_RESOURCE_LIST));
1181  PartialResourceList->Version = 1;
1182  PartialResourceList->Revision = 1;
1183  PartialResourceList->Count = 1;
1184 
1185  /* Set Interrupt */
1186  PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeInterrupt;
1188  PartialResourceList->PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED;
1189  PartialResourceList->PartialDescriptors[0].u.Interrupt.Level = 12;
1190  PartialResourceList->PartialDescriptors[0].u.Interrupt.Vector = 12;
1191  PartialResourceList->PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
1192 
1193  /* Create controller key */
1194  FldrCreateComponentKey(BusKey,
1196  PointerController,
1197  Input,
1198  0x0,
1199  0xFFFFFFFF,
1200  NULL,
1201  PartialResourceList,
1202  sizeof(CM_PARTIAL_RESOURCE_LIST),
1203  &ControllerKey);
1204  TRACE("Created key: PointerController\\0\n");
1205 
1206  if (DetectPS2AuxDevice())
1207  {
1208  TRACE("Detected PS2 mouse\n");
1209 
1210  /* Initialize resource descriptor */
1211  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
1213  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1214  if (PartialResourceList == NULL)
1215  {
1216  ERR("Failed to allocate resource descriptor\n");
1217  return;
1218  }
1219 
1220  RtlZeroMemory(PartialResourceList, Size);
1221  PartialResourceList->Version = 1;
1222  PartialResourceList->Revision = 1;
1223  PartialResourceList->Count = 0;
1224 
1225  /* Create peripheral key */
1226  FldrCreateComponentKey(ControllerKey,
1228  PointerPeripheral,
1229  Input,
1230  0x0,
1231  0xFFFFFFFF,
1232  "MICROSOFT PS2 MOUSE",
1233  PartialResourceList,
1234  Size,
1235  &PeripheralKey);
1236  TRACE("Created key: PointerPeripheral\\0\n");
1237  }
1238  }
1239 }
1240 
1241 
1242 // Implemented in pcvesa.c, returns the VESA version
1246 
1247 static VOID
1249 {
1250  CHAR Buffer[80];
1251  PCONFIGURATION_COMPONENT_DATA ControllerKey;
1252  USHORT VesaVersion;
1253 
1254  /* FIXME: Set 'ComponentInformation' value */
1255 
1256  VesaVersion = BiosIsVesaSupported();
1257  if (VesaVersion != 0)
1258  {
1259  TRACE("VESA version %c.%c\n",
1260  (VesaVersion >> 8) + '0',
1261  (VesaVersion & 0xFF) + '0');
1262  }
1263  else
1264  {
1265  TRACE("VESA not supported\n");
1266  }
1267 
1268  if (VesaVersion >= 0x0200)
1269  {
1270  strcpy(Buffer, "VBE Display");
1271  }
1272  else
1273  {
1274  strcpy(Buffer, "VGA Display");
1275  }
1276 
1277  FldrCreateComponentKey(BusKey,
1279  DisplayController,
1280  0x0,
1281  0x0,
1282  0xFFFFFFFF,
1283  Buffer,
1284  NULL,
1285  0,
1286  &ControllerKey);
1287  TRACE("Created key: DisplayController\\0\n");
1288 
1289  /* FIXME: Add display peripheral (monitor) data */
1290  if (VesaVersion != 0)
1291  {
1292  if (BiosIsVesaDdcSupported())
1293  {
1294  TRACE("VESA/DDC supported!\n");
1295  if (BiosVesaReadEdid())
1296  {
1297  TRACE("EDID data read successfully!\n");
1298 
1299  }
1300  }
1301  }
1302 }
1303 
1304 static
1305 VOID
1307 {
1308  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1310  ULONG Size;
1311 
1312  /* Set 'Configuration Data' value */
1313  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
1315  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1316  if (PartialResourceList == NULL)
1317  {
1318  ERR("Failed to allocate resource descriptor\n");
1319  return;
1320  }
1321 
1322  /* Initialize resource descriptor */
1323  RtlZeroMemory(PartialResourceList, Size);
1324  PartialResourceList->Version = 1;
1325  PartialResourceList->Revision = 1;
1326  PartialResourceList->Count = 0;
1327 
1328  /* Create new bus key */
1329  FldrCreateComponentKey(SystemKey,
1330  AdapterClass,
1331  MultiFunctionAdapter,
1332  0x0,
1333  0x0,
1334  0xFFFFFFFF,
1335  "ISA",
1336  PartialResourceList,
1337  Size,
1338  &BusKey);
1339 
1340  /* Increment bus number */
1341  (*BusNumber)++;
1342 
1343  /* Detect ISA/BIOS devices */
1344  DetectBiosDisks(SystemKey, BusKey);
1346  DetectParallelPorts(BusKey);
1347  DetectKeyboardController(BusKey);
1348  DetectPS2Mouse(BusKey);
1349  DetectDisplayController(BusKey);
1350 
1351  /* FIXME: Detect more ISA devices */
1352 }
1353 
1354 /* FIXME: Abstract things better so we don't need to place define here */
1355 #if !defined(SARCH_XBOX)
1356 static
1357 UCHAR
1359 {
1360  UCHAR Data;
1361 
1362  WRITE_PORT_UCHAR((PUCHAR)0x70, 0x10);
1363  Data = READ_PORT_UCHAR((PUCHAR)0x71);
1364 
1365  return ((Data & 0xF0) ? 1 : 0) + ((Data & 0x0F) ? 1 : 0);
1366 }
1367 #endif
1368 
1371 {
1373  ULONG BusNumber = 0;
1374 
1375  TRACE("DetectHardware()\n");
1376 
1377  /* Create the 'System' key */
1378  FldrCreateSystemKey(&SystemKey);
1379  // TODO: Discover and set the other machine types
1380  FldrSetIdentifier(SystemKey, "AT/AT COMPATIBLE");
1381 
1384 
1385  /* Detect buses */
1386  DetectPciBios(SystemKey, &BusNumber);
1387  DetectApmBios(SystemKey, &BusNumber);
1388  DetectPnpBios(SystemKey, &BusNumber);
1389  DetectIsaBios(SystemKey, &BusNumber); // TODO: Detect first EISA or MCA, before ISA
1390  DetectAcpiBios(SystemKey, &BusNumber);
1391 
1392  // TODO: Collect the ROM blocks from 0xC0000 to 0xF0000 and append their
1393  // CM_ROM_BLOCK data into the 'System' key's configuration data.
1394 
1395  TRACE("DetectHardware() Done\n");
1396  return SystemKey;
1397 }
1398 
1399 VOID
1401 {
1402  REGS Regs;
1403 
1404  /* Select APM 1.0+ function */
1405  Regs.b.ah = 0x53;
1406 
1407  /* Function 05h: CPU idle */
1408  Regs.b.al = 0x05;
1409 
1410  /* Call INT 15h */
1411  Int386(0x15, &Regs, &Regs);
1412 
1413  /* Check if successfull (CF set on error) */
1414  if (INT386_SUCCESS(Regs))
1415  return;
1416 
1417  /*
1418  * No futher processing here.
1419  * Optionally implement HLT instruction handling.
1420  */
1421 }
1422 
1424  IN UCHAR BootDrive OPTIONAL,
1425  IN ULONG BootPartition OPTIONAL)
1426 {
1427  REGS Regs;
1428 
1429  RtlZeroMemory(&Regs, sizeof(Regs));
1430 
1431  /* Set the boot drive and the boot partition */
1432  Regs.b.dl = (UCHAR)(BootDrive ? BootDrive : FrldrBootDrive);
1433  Regs.b.dh = (UCHAR)(BootPartition ? BootPartition : FrldrBootPartition);
1434 
1435  /*
1436  * Don't stop the floppy drive motor when we are just booting a bootsector,
1437  * a drive, or a partition. If we were to stop the floppy motor, the BIOS
1438  * wouldn't be informed and if the next read is to a floppy then the BIOS
1439  * will still think the motor is on and this will result in a read error.
1440  */
1441  // DiskStopFloppyMotor();
1442 
1443  Relocator16Boot(&Regs,
1444  /* Stack segment:pointer */
1445  0x0000, 0x7C00,
1446  /* Code segment:pointer */
1447  0x0000, 0x7C00);
1448 }
1449 
1450 /******************************************************************************/
1451 
1452 /* FIXME: Abstract things better so we don't need to place define here */
1453 #if !defined(SARCH_XBOX)
1454 VOID
1455 MachInit(const char *CmdLine)
1456 {
1457  /* Setup vtbl */
1458  RtlZeroMemory(&MachVtbl, sizeof(MachVtbl));
1475  MachVtbl.Beep = PcBeep;
1487 
1489 }
1490 
1491 VOID
1493 {
1494  /* On PC, prepare video and turn off the floppy motor */
1497 }
1498 #endif
1499 
1500 /* EOF */
VOID NTAPI FldrSetIdentifier(IN PCONFIGURATION_COMPONENT_DATA ComponentData, IN PCHAR IdentifierString)
Definition: archwsup.c:56
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
CPPORT Port[4]
Definition: headless.c:35
VOID DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: pchw.c:345
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
#define ExtendedBIOSDataSize
Definition: winldr.c:421
#define IN
Definition: typedefs.h:39
#define CONTROLLER_STATUS_INPUT_BUFFER_FULL
Definition: machpc.c:65
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID PcVideoGetFontsFromFirmware(PULONG RomFontPointers)
Definition: pcvideo.c:976
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
Definition: mm.h:181
#define MAX_LPT_PORTS
Definition: machpc.c:28
GLint x0
Definition: linetemp.h:95
#define __cdecl
Definition: accygwin.h:79
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
VOID PcVideoSync(VOID)
Definition: pcvideo.c:1138
ULONG(* GET_SERIAL_PORT)(ULONG Index, PULONG Irq)
Definition: hardware.h:69
#define TRUE
Definition: types.h:120
VOID(* GetExtendedBIOSData)(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machine.h:64
#define CONTROLLER_TIMEOUT
Definition: machpc.c:76
ULONG Cylinders
Definition: disk.h:26
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
#define DiskReadBuffer
Definition: hardware.h:33
unsigned char * PUCHAR
Definition: retypes.h:3
struct _CM_PNP_BIOS_INSTALLATION_CHECK * PCM_PNP_BIOS_INSTALLATION_CHECK
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
Definition: arc.h:82
char CHAR
Definition: xmlstorage.h:175
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
#define WARN(fmt,...)
Definition: debug.h:112
unsigned long eax
Definition: pcbios.h:85
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
struct _CM_SERIAL_DEVICE_DATA CM_SERIAL_DEVICE_DATA
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2413
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
unsigned short es
Definition: pcbios.h:115
Definition: arc.h:84
unsigned char ah
Definition: pcbios.h:126
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@387 DeviceSpecificData
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
static ULONG GetSerialMousePnpId(PUCHAR Port, char *Buffer)
Definition: machpc.c:423
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define CONTROLLER_STATUS_OUTPUT_BUFFER_FULL
Definition: machpc.c:64
struct _CM_PNP_BIOS_DEVICE_NODE * PCM_PNP_BIOS_DEVICE_NODE
static VOID DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, PUCHAR Base)
Definition: machpc.c:483
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378 u
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
BOOLEAN Rs232PortInUse(PUCHAR Base)
Definition: rs232.c:140
UCHAR(* GetFloppyCount)(VOID)
Definition: machine.h:66
#define CmResourceTypePort
Definition: hwresource.cpp:123
unsigned char dh
Definition: pcbios.h:135
uint32_t ULONG_PTR
Definition: typedefs.h:65
_Out_ PUSHORT NodeNumber
Definition: iofuncs.h:2574
int __cdecl Int386(int ivec, REGS *in, REGS *out)
VOID DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count)
Definition: machpc.c:660
#define sprintf(buf, format,...)
Definition: sprintf.c:55
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
Definition: cport.c:224
ULONG __cdecl PnpBiosGetDeviceNode(UCHAR *NodeId, UCHAR *NodeBuffer)
ULONG PcDiskGetCacheableBlockCount(UCHAR DriveNumber)
Definition: pcdisk.c:827
static const WCHAR CmdLine[]
Definition: install.c:48
static BOOLEAN DetectPS2AuxDevice(VOID)
Definition: machpc.c:1112
#define L(x)
Definition: ntvdm.h:50
unsigned char dl
Definition: pcbios.h:134
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
#define FALSE
Definition: types.h:117
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@380 Port
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:470
VOID PcVideoHideShowTextCursor(BOOLEAN Show)
Definition: pcvideo.c:1035
ULONG FrldrBootPartition
BOOLEAN BiosIsVesaDdcSupported(VOID)
Definition: pcvesa.c:242
#define INT386_SUCCESS(regs)
Definition: pcbios.h:173
VOID PcVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
Definition: pcvideo.c:1010
VOID PcGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machpc.c:80
static VOID DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:983
static BOOLEAN DetectPS2AuxPort(VOID)
Definition: machpc.c:1069
VOID(* VideoGetFontsFromFirmware)(PULONG RomFontPointers)
Definition: machine.h:49
#define MOUSE_TYPE_MICROSOFT
Definition: machpc.c:33
VOID PcVideoClearScreen(UCHAR Attr)
Definition: pcvideo.c:1089
static ULONG DetectSerialMouse(PUCHAR Port)
Definition: machpc.c:330
static PCM_PARTIAL_RESOURCE_LIST PcGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
Definition: machpc.c:104
unsigned char BOOLEAN
BOOLEAN PcDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
Definition: pcdisk.c:798
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
PFREELDR_MEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize)
Definition: pcmem.c:599
Definition: bufpool.h:45
#define MOUSE_TYPE_NONE
Definition: machpc.c:31
ULONG __cdecl PnpBiosGetDeviceNodeCount(ULONG *NodeSize, ULONG *NodeCount)
VOID __cdecl ChainLoadBiosBootSectorCode(IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
Definition: machpc.c:1423
void * PVOID
Definition: retypes.h:9
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pchw.c:45
static VOID DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:756
struct _CM_PNP_BIOS_INSTALLATION_CHECK CM_PNP_BIOS_INSTALLATION_CHECK
BOOLEAN BiosVesaReadEdid(VOID)
Definition: pcvesa.c:272
#define UlongToPtr(u)
Definition: config.h:106
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
BOOLEAN PcDiskReadLogicalSectors(IN UCHAR DriveNumber, IN ULONGLONG SectorNumber, IN ULONG SectorCount, OUT PVOID Buffer)
Definition: pcdisk.c:758
Status
Definition: gdiplustypes.h:24
int Count
Definition: noreturn.cpp:7
ULONG Sectors
Definition: disk.h:28
#define ExtendedBIOSDataArea
Definition: winldr.c:420
#define TRACE(s)
Definition: solgame.cpp:4
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:174
static VOID DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: machpc.c:182
#define MOUSE_TYPE_WHEELZ
Definition: machpc.c:37
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayModeName, BOOLEAN Init)
Definition: pcvideo.c:888
BOOLEAN PcConsKbHit(VOID)
Definition: pccons.c:69
BOOLEAN PcVideoIsPaletteFixed(VOID)
Definition: pcvideo.c:1114
__wchar_t WCHAR
Definition: xmlstorage.h:180
VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pcvideo.c:1120
VOID __cdecl DiskStopFloppyMotor(VOID)
Definition: pc98hw.c:1245
_In_ WDFCOLLECTION _In_ ULONG Index
static VOID DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:1161
#define CONTROLLER_COMMAND_WRITE_MOUSE
Definition: machpc.c:61
VOID MachInit(const char *CmdLine)
Definition: machpc.c:1455
static VOID PS2ControllerWait(VOID)
Definition: machpc.c:1051
#define CONTROLLER_REGISTER_DATA
Definition: machpc.c:47
const GLubyte * c
Definition: glext.h:8905
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID)
Definition: machpc.c:1370
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwpci.c:176
static VOID InitializeSerialPort(PUCHAR Port, UCHAR LineControl)
Definition: machpc.c:316
VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwacpi.c:54
#define CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL
Definition: machpc.c:69
Definition: Node.h:9
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _CM_SERIAL_DEVICE_DATA * PCM_SERIAL_DEVICE_DATA
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
DBG_DEFAULT_CHANNEL(HWDETECT)
BYTEREGS b
Definition: pcbios.h:157
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
Definition: arc.h:85
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define MAX_COM_PORTS
Definition: machpc.c:27
VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pcvideo.c:1105
UCHAR FrldrBootDrive
unsigned char al
Definition: pcbios.h:125
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
DWORDREGS d
Definition: pcbios.h:155
VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: pcvideo.c:946
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
VOID NTAPI FldrCreateComponentKey(IN PCONFIGURATION_COMPONENT_DATA SystemNode, IN CONFIGURATION_CLASS Class, IN CONFIGURATION_TYPE Type, IN IDENTIFIER_FLAG Flags, IN ULONG Key, IN ULONG Affinity, IN PCHAR IdentifierString, IN PCM_PARTIAL_RESOURCE_LIST ResourceList, IN ULONG Size, OUT PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:147
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
int(* ConsGetCh)(VOID)
Definition: machine.h:43
#define ERR(fmt,...)
Definition: debug.h:110
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
MACHVTBL MachVtbl
Definition: arcemul.c:21
ULONG BytesPerSector
Definition: disk.h:29
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@381 Interrupt
static ULONG Timeout
Definition: ping.c:61
static VOID DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: machpc.c:1306
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
ULONG PcGetSerialPort(ULONG Index, PULONG Irq)
Definition: machpc.c:643
VOID PcBeep(VOID)
Definition: pcbeep.c:34
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
Definition: arc.h:83
unsigned short USHORT
Definition: pedump.c:61
static BOOLEAN DiskGetExtendedDriveParameters(IN UCHAR DriveNumber, IN PPC_DISK_DRIVE DiskDrive, OUT PVOID Buffer, IN USHORT BufferSize)
Definition: pcdisk.c:294
VOID(* HwIdle)(VOID)
Definition: machine.h:78
BOOLEAN PcFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:80
struct _CM_KEYBOARD_DEVICE_DATA CM_KEYBOARD_DEVICE_DATA
VOID __cdecl Relocator16Boot(IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
BOOLEAN DetectKeyboardDevice(VOID)
Definition: machpc.c:848
Definition: disk.h:24
VOID HalpCalibrateStallExecution(VOID)
Definition: pchw.c:105
ULONG_PTR __cdecl PnpBiosSupported(VOID)
unsigned int * PULONG
Definition: retypes.h:1
VOID PcHwIdle(VOID)
Definition: machpc.c:1400
static UCHAR PcGetFloppyCount(VOID)
Definition: machpc.c:1358
VOID PcVideoPrepareForReactOS(VOID)
Definition: pcvideo.c:1161
#define NULL
Definition: types.h:112
struct _EXTENDED_GEOMETRY EXTENDED_GEOMETRY
static VOID DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:1248
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define MOUSE_TYPE_LOGITECH
Definition: machpc.c:35
VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: pcvideo.c:1048
#define CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER
Definition: machpc.c:60
VOID(* VideoSync)(VOID)
Definition: machine.h:57
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
static VOID DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
Definition: machpc.c:917
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define c
Definition: ke_i.h:80
VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: pcvideo.c:1129
unsigned int ULONG
Definition: retypes.h:1
Definition: pcbios.h:152
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
VOID NTAPI FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
Definition: archwsup.c:89
#define CONTROLLER_REGISTER_STATUS
Definition: machpc.c:45
struct _CM_KEYBOARD_DEVICE_DATA * PCM_KEYBOARD_DEVICE_DATA
#define CONTROLLER_REGISTER_CONTROL
Definition: machpc.c:46
TIMEINFO * PcGetTime(VOID)
Definition: pcrtc.c:24
VOID(* Beep)(VOID)
Definition: machine.h:58
int k
Definition: mpi.c:3369
ULONG PcVideoGetBufferSize(VOID)
Definition: pcvideo.c:970
int PcConsGetCh(void)
Definition: pccons.c:90
unsigned short * PUSHORT
Definition: retypes.h:2
VOID PcPrepareForReactOS(VOID)
Definition: machpc.c:1492
VOID PcConsPutChar(int Ch)
Definition: pccons.c:28
struct _CM_DISK_GEOMETRY_DEVICE_DATA CM_DISK_GEOMETRY_DEVICE_DATA
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:23
WORDREGS w
Definition: pcbios.h:156
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51
USHORT BiosIsVesaSupported(VOID)
Definition: pcvesa.c:160
ULONG Heads
Definition: disk.h:27
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwapm.c:46