ReactOS 0.4.15-dev-6657-ged9973f
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>
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#define INPORT_REGISTER_CONTROL 0x00
42#define INPORT_REGISTER_DATA 0x01
43#define INPORT_REGISTER_SIGNATURE 0x02
44
45#define INPORT_REG_MODE 0x07
46#define INPORT_RESET 0x80
47#define INPORT_MODE_BASE 0x10
48#define INPORT_TEST_IRQ 0x16
49#define INPORT_SIGNATURE 0xDE
50
51#define PIC1_CONTROL_PORT 0x20
52#define PIC1_DATA_PORT 0x21
53#define PIC2_CONTROL_PORT 0xA0
54#define PIC2_DATA_PORT 0xA1
55
56/* PS2 stuff */
57
58/* Controller registers. */
59#define CONTROLLER_REGISTER_STATUS 0x64
60#define CONTROLLER_REGISTER_CONTROL 0x64
61#define CONTROLLER_REGISTER_DATA 0x60
62
63/* Controller commands. */
64#define CONTROLLER_COMMAND_READ_MODE 0x20
65#define CONTROLLER_COMMAND_WRITE_MODE 0x60
66#define CONTROLLER_COMMAND_GET_VERSION 0xA1
67#define CONTROLLER_COMMAND_MOUSE_DISABLE 0xA7
68#define CONTROLLER_COMMAND_MOUSE_ENABLE 0xA8
69#define CONTROLLER_COMMAND_TEST_MOUSE 0xA9
70#define CONTROLLER_COMMAND_SELF_TEST 0xAA
71#define CONTROLLER_COMMAND_KEYBOARD_TEST 0xAB
72#define CONTROLLER_COMMAND_KEYBOARD_DISABLE 0xAD
73#define CONTROLLER_COMMAND_KEYBOARD_ENABLE 0xAE
74#define CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER 0xD3
75#define CONTROLLER_COMMAND_WRITE_MOUSE 0xD4
76
77/* Controller status */
78#define CONTROLLER_STATUS_OUTPUT_BUFFER_FULL 0x01
79#define CONTROLLER_STATUS_INPUT_BUFFER_FULL 0x02
80#define CONTROLLER_STATUS_SELF_TEST 0x04
81#define CONTROLLER_STATUS_COMMAND 0x08
82#define CONTROLLER_STATUS_UNLOCKED 0x10
83#define CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL 0x20
84#define CONTROLLER_STATUS_GENERAL_TIMEOUT 0x40
85#define CONTROLLER_STATUS_PARITY_ERROR 0x80
86#define AUX_STATUS_OUTPUT_BUFFER_FULL (CONTROLLER_STATUS_OUTPUT_BUFFER_FULL | \
87 CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL)
88
89/* Timeout in ms for sending to keyboard controller. */
90#define CONTROLLER_TIMEOUT 250
91
92
93VOID
95{
96 REGS BiosRegs;
97
98 /* Get address and size of the extended BIOS data area */
99 BiosRegs.d.eax = 0xC100;
100 Int386(0x15, &BiosRegs, &BiosRegs);
101 if (INT386_SUCCESS(BiosRegs))
102 {
103 *ExtendedBIOSDataArea = BiosRegs.w.es << 4;
104 *ExtendedBIOSDataSize = 1024;
105 }
106 else
107 {
108 WARN("Int 15h AH=C1h call failed\n");
111 }
112}
113
114// NOTE: Similar to machxbox.c!XboxGetHarddiskConfigurationData(),
115// but with extended geometry support.
116static
119{
120 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
122 // EXTENDED_GEOMETRY ExtGeometry;
123 GEOMETRY Geometry;
124 ULONG Size;
125
126 //
127 // Initialize returned size
128 //
129 *pSize = 0;
130
131 /* Set 'Configuration Data' value */
134 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
135 if (PartialResourceList == NULL)
136 {
137 ERR("Failed to allocate resource descriptor\n");
138 return NULL;
139 }
140
141 RtlZeroMemory(PartialResourceList, Size);
142 PartialResourceList->Version = 1;
143 PartialResourceList->Revision = 1;
144 PartialResourceList->Count = 1;
145 PartialResourceList->PartialDescriptors[0].Type =
147// PartialResourceList->PartialDescriptors[0].ShareDisposition =
148// PartialResourceList->PartialDescriptors[0].Flags =
149 PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
151
152 /* Get pointer to geometry data */
153 DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
154
155 /* Get the disk geometry */
156#if 0 // This is somehow replaced by what PcDiskGetDriveGeometry() does internally.
157 ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
158 if (DiskGetExtendedDriveParameters(DriveNumber, &ExtGeometry, ExtGeometry.Size))
159 {
160 DiskGeometry->BytesPerSector = ExtGeometry.BytesPerSector;
161 DiskGeometry->NumberOfCylinders = ExtGeometry.Cylinders;
162 DiskGeometry->SectorsPerTrack = ExtGeometry.SectorsPerTrack;
163 DiskGeometry->NumberOfHeads = ExtGeometry.Heads;
164 }
165 else
166#endif
167 if (PcDiskGetDriveGeometry(DriveNumber, &Geometry))
168 {
169 DiskGeometry->BytesPerSector = Geometry.BytesPerSector;
170 DiskGeometry->NumberOfCylinders = Geometry.Cylinders;
171 DiskGeometry->SectorsPerTrack = Geometry.Sectors;
172 DiskGeometry->NumberOfHeads = Geometry.Heads;
173 }
174 else
175 {
176 TRACE("Reading disk geometry failed\n");
177 FrLdrHeapFree(PartialResourceList, TAG_HW_RESOURCE_LIST);
178 return NULL;
179 }
180 TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
181 DriveNumber,
182 DiskGeometry->NumberOfCylinders,
183 DiskGeometry->NumberOfHeads,
184 DiskGeometry->SectorsPerTrack,
185 DiskGeometry->BytesPerSector);
186
187 //
188 // Return configuration data
189 //
190 *pSize = Size;
191 return PartialResourceList;
192}
193
194static
195VOID
198{
199 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
200 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
201 PCONFIGURATION_COMPONENT_DATA PeripheralKey;
202 PDOCKING_STATE_INFORMATION DockingState;
204
206
207 /* Build full device descriptor */
210 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
211 if (PartialResourceList == NULL)
212 {
213 ERR("Failed to allocate resource descriptor\n");
214 return;
215 }
216
217 /* Initialize resource descriptor */
218 RtlZeroMemory(PartialResourceList, Size);
219 PartialResourceList->Version = 0;
220 PartialResourceList->Revision = 0;
221 PartialResourceList->Count = 1;
222
223 /* Set device specific data */
224 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
225 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
227 PartialDescriptor->Flags = 0;
228 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(DOCKING_STATE_INFORMATION);
229
230 DockingState = (PDOCKING_STATE_INFORMATION)&PartialResourceList->PartialDescriptors[1];
231 DockingState->ReturnCode = Result;
232 if (Result == 0)
233 {
234 /* FIXME: Add more device specific data */
235 ERR("FIXME: System docked\n");
236 }
237
238 /* Create controller key */
242 0,
243 0,
244 0xFFFFFFFF,
245 "Docking State Information",
246 PartialResourceList,
247 Size,
248 &PeripheralKey);
249}
250
251static
252VOID
254{
255 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
259 ULONG x;
260 ULONG NodeSize = 0;
261 ULONG NodeCount = 0;
263 ULONG FoundNodeCount;
264 int i;
265 ULONG PnpBufferSize;
266 ULONG PnpBufferSizeLimit;
267 ULONG Size;
268 char *Ptr;
269
271 if (InstData == NULL || strncmp((CHAR*)InstData->Signature, "$PnP", 4))
272 {
273 TRACE("PnP-BIOS not supported\n");
274 return;
275 }
276
277 TRACE("PnP-BIOS supported\n");
278 TRACE("Signature '%c%c%c%c'\n",
279 InstData->Signature[0], InstData->Signature[1],
280 InstData->Signature[2], InstData->Signature[3]);
281
282 x = PnpBiosGetDeviceNodeCount(&NodeSize, &NodeCount);
283 if (x == 0x82)
284 {
285 TRACE("PnP-BIOS function 'Get Number of System Device Nodes' not supported\n");
286 return;
287 }
288
289 NodeCount &= 0xFF; // needed since some fscked up BIOSes return
290 // wrong info (e.g. Mac Virtual PC)
291 // e.g. look: http://my.execpc.com/~geezer/osd/pnp/pnp16.c
292 if (x != 0 || NodeSize == 0 || NodeCount == 0)
293 {
294 ERR("PnP-BIOS failed to enumerate device nodes\n");
295 return;
296 }
297 TRACE("MaxNodeSize %u NodeCount %u\n", NodeSize, NodeCount);
298 TRACE("Estimated buffer size %u\n", NodeSize * NodeCount);
299
300 /* Set 'Configuration Data' value */
301 PnpBufferSizeLimit = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK)
302 + (NodeSize * NodeCount);
303 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSizeLimit;
304 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
305 if (PartialResourceList == NULL)
306 {
307 ERR("Failed to allocate resource descriptor\n");
308 return;
309 }
310
311 /* Initialize resource descriptor */
312 RtlZeroMemory(PartialResourceList, Size);
313 PartialResourceList->Version = 1;
314 PartialResourceList->Revision = 1;
315 PartialResourceList->Count = 1;
316 PartialResourceList->PartialDescriptors[0].Type =
318 PartialResourceList->PartialDescriptors[0].ShareDisposition =
320
321 /* The buffer starts after PartialResourceList->PartialDescriptors[0] */
322 Ptr = (char *)(PartialResourceList + 1);
323
324 /* Set installation check data */
325 memcpy (Ptr, InstData, sizeof(CM_PNP_BIOS_INSTALLATION_CHECK));
327 PnpBufferSize = sizeof(CM_PNP_BIOS_INSTALLATION_CHECK);
328
329 /* Copy device nodes */
330 FoundNodeCount = 0;
331 for (i = 0; i < 0xFF; i++)
332 {
333 NodeNumber = (UCHAR)i;
334
336 if (x == 0)
337 {
339
340 TRACE("Node: %u Size %u (0x%x)\n",
341 DeviceNode->Node,
342 DeviceNode->Size,
343 DeviceNode->Size);
344
345 if (PnpBufferSize + DeviceNode->Size > PnpBufferSizeLimit)
346 {
347 ERR("Buffer too small! Ignoring remaining device nodes. (i = %d)\n", i);
348 break;
349 }
350
352
353 Ptr += DeviceNode->Size;
354 PnpBufferSize += DeviceNode->Size;
355
356 FoundNodeCount++;
357 if (FoundNodeCount >= NodeCount)
358 break;
359 }
360 }
361
362 /* Set real data size */
363 PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
364 PnpBufferSize;
365 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) + PnpBufferSize;
366
367 TRACE("Real buffer size: %u\n", PnpBufferSize);
368 TRACE("Resource size: %u\n", Size);
369
370 /* Create component key */
371 FldrCreateComponentKey(SystemKey,
374 0,
375 0,
376 0xFFFFFFFF,
377 "PNP BIOS",
378 PartialResourceList,
379 Size,
380 &BusKey);
381
382 DetectDockingStation(BusKey);
383
384 (*BusNumber)++;
385}
386
387static
388VOID
390 UCHAR LineControl)
391{
392 WRITE_PORT_UCHAR(Port + 3, 0x80); /* set DLAB on */
393 WRITE_PORT_UCHAR(Port, 0x60); /* speed LO byte */
394 WRITE_PORT_UCHAR(Port + 1, 0); /* speed HI byte */
395 WRITE_PORT_UCHAR(Port + 3, LineControl);
396 WRITE_PORT_UCHAR(Port + 1, 0); /* set comm and DLAB to 0 */
397 WRITE_PORT_UCHAR(Port + 4, 0x09); /* DR int enable */
398 READ_PORT_UCHAR(Port + 5); /* clear error bits */
399}
400
401static
402ULONG
404{
405 CHAR Buffer[4];
406 ULONG i;
407 ULONG TimeOut;
408 UCHAR LineControl;
409
410 /* Shutdown mouse or something like that */
411 LineControl = READ_PORT_UCHAR(Port + 4);
412 WRITE_PORT_UCHAR(Port + 4, (LineControl & ~0x02) | 0x01);
414
415 /*
416 * Clear buffer
417 * Maybe there is no serial port although BIOS reported one (this
418 * is the case on Apple hardware), or the serial port is misbehaving,
419 * therefore we must give up after some time.
420 */
421 TimeOut = 200;
422 while (READ_PORT_UCHAR(Port + 5) & 0x01)
423 {
424 if (--TimeOut == 0)
425 return MOUSE_TYPE_NONE;
427 }
428
429 /*
430 * Send modem control with 'Data Terminal Ready', 'Request To Send' and
431 * 'Output Line 2' message. This enables mouse to identify.
432 */
433 WRITE_PORT_UCHAR(Port + 4, 0x0b);
434
435 /* Wait 10 milliseconds for the mouse getting ready */
437
438 /* Read first four bytes, which contains Microsoft Mouse signs */
439 TimeOut = 20;
440 for (i = 0; i < 4; i++)
441 {
442 while ((READ_PORT_UCHAR(Port + 5) & 1) == 0)
443 {
445 --TimeOut;
446 if (TimeOut == 0)
447 return MOUSE_TYPE_NONE;
448 }
450 }
451
452 TRACE("Mouse data: %x %x %x %x\n",
453 Buffer[0], Buffer[1], Buffer[2], Buffer[3]);
454
455 /* Check that four bytes for signs */
456 for (i = 0; i < 4; ++i)
457 {
458 if (Buffer[i] == 'B')
459 {
460 /* Sign for Microsoft Ballpoint */
461// DbgPrint("Microsoft Ballpoint device detected\n");
462// DbgPrint("THIS DEVICE IS NOT SUPPORTED, YET\n");
463 return MOUSE_TYPE_NONE;
464 }
465 else if (Buffer[i] == 'M')
466 {
467 /* Sign for Microsoft Mouse protocol followed by button specifier */
468 if (i == 3)
469 {
470 /* Overflow Error */
471 return MOUSE_TYPE_NONE;
472 }
473
474 switch (Buffer[i + 1])
475 {
476 case '3':
477 TRACE("Microsoft Mouse with 3-buttons detected\n");
478 return MOUSE_TYPE_LOGITECH;
479
480 case 'Z':
481 TRACE("Microsoft Wheel Mouse detected\n");
482 return MOUSE_TYPE_WHEELZ;
483
484 /* case '2': */
485 default:
486 TRACE("Microsoft Mouse with 2-buttons detected\n");
488 }
489 }
490 }
491
492 return MOUSE_TYPE_NONE;
493}
494
495static ULONG
497{
498 ULONG TimeOut;
499 ULONG i = 0;
500 char c;
501 char x;
502
503 WRITE_PORT_UCHAR(Port + 4, 0x09);
504
505 /* Wait 10 milliseconds for the mouse getting ready */
507
508 WRITE_PORT_UCHAR(Port + 4, 0x0b);
509
511
512 for (;;)
513 {
514 TimeOut = 200;
515 while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
516 {
518 --TimeOut;
519 if (TimeOut == 0)
520 {
521 return 0;
522 }
523 }
524
526 if (c == 0x08 || c == 0x28)
527 break;
528 }
529
530 Buffer[i++] = c;
531 x = c + 1;
532
533 for (;;)
534 {
535 TimeOut = 200;
536 while (((READ_PORT_UCHAR(Port + 5) & 1) == 0) && (TimeOut > 0))
537 {
539 --TimeOut;
540 if (TimeOut == 0)
541 return 0;
542 }
544 Buffer[i++] = c;
545 if (c == x)
546 break;
547 if (i >= 256)
548 break;
549 }
550
551 return i;
552}
553
554static
555VOID
557 PUCHAR Base)
558{
559 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
560 char Buffer[256];
561 CHAR Identifier[256];
562 PCONFIGURATION_COMPONENT_DATA PeripheralKey;
563 ULONG MouseType;
565 ULONG i;
566 ULONG j;
567 ULONG k;
568
569 TRACE("DetectSerialPointerPeripheral()\n");
570
571 Identifier[0] = 0;
572
574 MouseType = DetectSerialMouse(Base);
575
576 if (MouseType != MOUSE_TYPE_NONE)
577 {
579 TRACE( "PnP ID length: %u\n", Length);
580
581 if (Length != 0)
582 {
583 /* Convert PnP sting to ASCII */
584 if (Buffer[0] == 0x08)
585 {
586 for (i = 0; i < Length; i++)
587 Buffer[i] += 0x20;
588 }
589 Buffer[Length] = 0;
590
591 TRACE("PnP ID string: %s\n", Buffer);
592
593 /* Copy PnpId string */
594 for (i = 0; i < 7; i++)
595 {
596 Identifier[i] = Buffer[3 + i];
597 }
598 memcpy(&Identifier[7],
599 L" - ",
600 3 * sizeof(WCHAR));
601
602 /* Skip device serial number */
603 i = 10;
604 if (Buffer[i] == '\\')
605 {
606 for (j = ++i; i < Length; ++i)
607 {
608 if (Buffer[i] == '\\')
609 break;
610 }
611 if (i >= Length)
612 i -= 3;
613 }
614
615 /* Skip PnP class */
616 if (Buffer[i] == '\\')
617 {
618 for (j = ++i; i < Length; ++i)
619 {
620 if (Buffer[i] == '\\')
621 break;
622 }
623
624 if (i >= Length)
625 i -= 3;
626 }
627
628 /* Skip compatible PnP Id */
629 if (Buffer[i] == '\\')
630 {
631 for (j = ++i; i < Length; ++i)
632 {
633 if (Buffer[i] == '\\')
634 break;
635 }
636 if (Buffer[j] == '*')
637 ++j;
638 if (i >= Length)
639 i -= 3;
640 }
641
642 /* Get product description */
643 if (Buffer[i] == '\\')
644 {
645 for (j = ++i; i < Length; ++i)
646 {
647 if (Buffer[i] == ';')
648 break;
649 }
650 if (i >= Length)
651 i -= 3;
652 if (i > j + 1)
653 {
654 for (k = 0; k < i - j; k++)
655 {
656 Identifier[k + 10] = Buffer[k + j];
657 }
658 Identifier[10 + (i - j)] = 0;
659 }
660 }
661
662 TRACE("Identifier string: %s\n", Identifier);
663 }
664
665 if (Length == 0 || strlen(Identifier) < 11)
666 {
667 switch (MouseType)
668 {
670 strcpy(Identifier, "LOGITECH SERIAL MOUSE");
671 break;
672
674 strcpy(Identifier, "MICROSOFT SERIAL MOUSE WITH WHEEL");
675 break;
676
678 default:
679 strcpy(Identifier, "MICROSOFT SERIAL MOUSE");
680 break;
681 }
682 }
683
684 /* Set 'Configuration Data' value */
687 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
688 if (PartialResourceList == NULL)
689 {
690 ERR("Failed to allocate resource descriptor\n");
691 return;
692 }
693
694 RtlZeroMemory(PartialResourceList, Size);
695 PartialResourceList->Version = 1;
696 PartialResourceList->Revision = 1;
697 PartialResourceList->Count = 0;
698
699 /* Create 'PointerPeripheral' key */
700 FldrCreateComponentKey(ControllerKey,
703 Input,
704 0,
705 0xFFFFFFFF,
707 PartialResourceList,
708 Size,
709 &PeripheralKey);
710 }
711}
712
713ULONG
715{
716 static const ULONG PcIrq[MAX_COM_PORTS] = {4, 3, 4, 3};
717 PUSHORT BasePtr;
718
719 /*
720 * The BIOS data area 0x400 holds the address of the first valid COM port.
721 * Each COM port address is stored in a 2-byte field.
722 * Infos at: http://www.bioscentral.com/misc/bda.htm
723 */
724 BasePtr = (PUSHORT)0x400;
725 *Irq = PcIrq[Index];
726
727 return (ULONG) *(BasePtr + Index);
728}
729
730VOID
732{
733 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
734 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
735 PCM_SERIAL_DEVICE_DATA SerialDeviceData;
736 ULONG Irq;
737 ULONG Base;
738 CHAR Identifier[80];
739 ULONG ControllerNumber = 0;
740 PCONFIGURATION_COMPONENT_DATA ControllerKey;
741 ULONG i;
742 ULONG Size;
743
744 TRACE("DetectSerialPorts()\n");
745
746 for (i = 0; i < Count; i++)
747 {
748 Base = MachGetSerialPort(i, &Irq);
749 if ((Base == 0) || !CpDoesPortExist(UlongToPtr(Base)))
750 continue;
751
752 TRACE("Found COM%u port at 0x%x\n", i + 1, Base);
753
754 /* Set 'Identifier' value */
755 RtlStringCbPrintfA(Identifier, sizeof(Identifier), "COM%ld", i + 1);
756
757 /* Build full device descriptor */
760 sizeof(CM_SERIAL_DEVICE_DATA);
761 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
762 if (PartialResourceList == NULL)
763 {
764 ERR("Failed to allocate resource descriptor! Ignoring remaining serial ports. (i = %lu, Count = %lu)\n",
765 i, Count);
766 break;
767 }
768
769 /* Initialize resource descriptor */
770 RtlZeroMemory(PartialResourceList, Size);
771 PartialResourceList->Version = 1;
772 PartialResourceList->Revision = 1;
773 PartialResourceList->Count = 3;
774
775 /* Set IO Port */
776 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
777 PartialDescriptor->Type = CmResourceTypePort;
779 PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
780 PartialDescriptor->u.Port.Start.LowPart = Base;
781 PartialDescriptor->u.Port.Start.HighPart = 0x0;
782 PartialDescriptor->u.Port.Length = 8;
783
784 /* Set Interrupt */
785 PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
786 PartialDescriptor->Type = CmResourceTypeInterrupt;
788 PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
789 PartialDescriptor->u.Interrupt.Level = Irq;
790 PartialDescriptor->u.Interrupt.Vector = Irq;
791 PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
792
793 /* Set serial data (device specific) */
794 PartialDescriptor = &PartialResourceList->PartialDescriptors[2];
795 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
797 PartialDescriptor->Flags = 0;
798 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_SERIAL_DEVICE_DATA);
799
800 SerialDeviceData =
801 (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3];
802 SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
803
804 /* Create controller key */
809 ControllerNumber,
810 0xFFFFFFFF,
812 PartialResourceList,
813 Size,
814 &ControllerKey);
815
817 {
818 /* Detect serial mouse */
820 }
821
822 ControllerNumber++;
823 }
824}
825
826static VOID
828{
829 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
830 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
831 ULONG Irq[MAX_LPT_PORTS] = {7, 5, (ULONG) - 1};
832 CHAR Identifier[80];
833 PCONFIGURATION_COMPONENT_DATA ControllerKey;
834 PUSHORT BasePtr;
835 ULONG Base;
836 ULONG ControllerNumber = 0;
837 ULONG i;
838 ULONG Size;
839
840 TRACE("DetectParallelPorts() called\n");
841
842 /*
843 * The BIOS data area 0x408 holds the address of the first valid LPT port.
844 * Each LPT port address is stored in a 2-byte field.
845 * Infos at: http://www.bioscentral.com/misc/bda.htm
846 */
847 BasePtr = (PUSHORT)0x408;
848
849 for (i = 0; i < MAX_LPT_PORTS; i++, BasePtr++)
850 {
851 Base = (ULONG) * BasePtr;
852 if (Base == 0)
853 continue;
854
855 TRACE("Parallel port %u: %x\n", ControllerNumber, Base);
856
857 /* Set 'Identifier' value */
858 RtlStringCbPrintfA(Identifier, sizeof(Identifier), "PARALLEL%ld", i + 1);
859
860 /* Build full device descriptor */
862 if (Irq[i] != (ULONG) - 1)
864
865 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
866 if (PartialResourceList == NULL)
867 {
868 ERR("Failed to allocate resource descriptor! Ignoring remaining parallel ports. (i = %lu)\n", i);
869 break;
870 }
871
872 /* Initialize resource descriptor */
873 RtlZeroMemory(PartialResourceList, Size);
874 PartialResourceList->Version = 1;
875 PartialResourceList->Revision = 1;
876 PartialResourceList->Count = (Irq[i] != (ULONG) - 1) ? 2 : 1;
877
878 /* Set IO Port */
879 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
880 PartialDescriptor->Type = CmResourceTypePort;
882 PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
883 PartialDescriptor->u.Port.Start.LowPart = Base;
884 PartialDescriptor->u.Port.Start.HighPart = 0x0;
885 PartialDescriptor->u.Port.Length = 3;
886
887 /* Set Interrupt */
888 if (Irq[i] != (ULONG) - 1)
889 {
890 PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
891 PartialDescriptor->Type = CmResourceTypeInterrupt;
893 PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
894 PartialDescriptor->u.Interrupt.Level = Irq[i];
895 PartialDescriptor->u.Interrupt.Vector = Irq[i];
896 PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
897 }
898
899 /* Create controller key */
903 Output,
904 ControllerNumber,
905 0xFFFFFFFF,
907 PartialResourceList,
908 Size,
909 &ControllerKey);
910
911 ControllerNumber++;
912 }
913
914 TRACE("DetectParallelPorts() done\n");
915}
916
917// static
920{
922 UCHAR Scancode;
923 ULONG Loops;
925
926 /* Identify device */
928
929 /* Wait for reply */
930 for (Loops = 0; Loops < 100; Loops++)
931 {
935 break;
936 }
937
939 {
940 /* PC/XT keyboard or no keyboard */
941 Result = FALSE;
942 }
943
945 if (Scancode != 0xFA)
946 {
947 /* No ACK received */
948 Result = FALSE;
949 }
950
952
955 {
956 /* Found AT keyboard */
957 return Result;
958 }
959
961 if (Scancode != 0xAB)
962 {
963 /* No 0xAB received */
964 Result = FALSE;
965 }
966
968
971 {
972 /* No byte in buffer */
973 Result = FALSE;
974 }
975
977 if (Scancode != 0x41)
978 {
979 /* No 0x41 received */
980 Result = FALSE;
981 }
982
983 /* Found MF-II keyboard */
984 return Result;
985}
986
987static VOID
989{
990 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
991 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
992 PCM_KEYBOARD_DEVICE_DATA KeyboardData;
993 PCONFIGURATION_COMPONENT_DATA PeripheralKey;
994 ULONG Size;
995 REGS Regs;
996
997 /* HACK: don't call DetectKeyboardDevice() as it fails in Qemu 0.8.2
998 if (DetectKeyboardDevice()) */
999 {
1000 /* Set 'Configuration Data' value */
1001 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
1003 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1004 if (PartialResourceList == NULL)
1005 {
1006 ERR("Failed to allocate resource descriptor\n");
1007 return;
1008 }
1009
1010 /* Initialize resource descriptor */
1011 RtlZeroMemory(PartialResourceList, Size);
1012 PartialResourceList->Version = 1;
1013 PartialResourceList->Revision = 1;
1014 PartialResourceList->Count = 1;
1015
1016 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1017 PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
1018 PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1019 PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_KEYBOARD_DEVICE_DATA);
1020
1021 /* Int 16h AH=02h
1022 * KEYBOARD - GET SHIFT FLAGS
1023 *
1024 * Return:
1025 * AL - shift flags
1026 */
1027 Regs.b.ah = 0x02;
1028 Int386(0x16, &Regs, &Regs);
1029
1030 KeyboardData = (PCM_KEYBOARD_DEVICE_DATA)(PartialDescriptor + 1);
1031 KeyboardData->Version = 1;
1032 KeyboardData->Revision = 1;
1033 KeyboardData->Type = 4;
1034 KeyboardData->Subtype = 0;
1035 KeyboardData->KeyboardFlags = Regs.b.al;
1036
1037 /* Create controller key */
1038 FldrCreateComponentKey(ControllerKey,
1041 Input | ConsoleIn,
1042 0,
1043 0xFFFFFFFF,
1044 "PCAT_ENHANCED",
1045 PartialResourceList,
1046 Size,
1047 &PeripheralKey);
1048 }
1049}
1050
1051static
1052VOID
1054{
1055 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1056 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
1057 PCONFIGURATION_COMPONENT_DATA ControllerKey;
1058 ULONG Size;
1059
1060 /* Set 'Configuration Data' value */
1061 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
1063 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1064 if (PartialResourceList == NULL)
1065 {
1066 ERR("Failed to allocate resource descriptor\n");
1067 return;
1068 }
1069
1070 /* Initialize resource descriptor */
1071 RtlZeroMemory(PartialResourceList, Size);
1072 PartialResourceList->Version = 1;
1073 PartialResourceList->Revision = 1;
1074 PartialResourceList->Count = 3;
1075
1076 /* Set Interrupt */
1077 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1078 PartialDescriptor->Type = CmResourceTypeInterrupt;
1079 PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1080 PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
1081 PartialDescriptor->u.Interrupt.Level = 1;
1082 PartialDescriptor->u.Interrupt.Vector = 1;
1083 PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
1084
1085 /* Set IO Port 0x60 */
1086 PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
1087 PartialDescriptor->Type = CmResourceTypePort;
1089 PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
1090 PartialDescriptor->u.Port.Start.LowPart = 0x60;
1091 PartialDescriptor->u.Port.Start.HighPart = 0x0;
1092 PartialDescriptor->u.Port.Length = 1;
1093
1094 /* Set IO Port 0x64 */
1095 PartialDescriptor = &PartialResourceList->PartialDescriptors[2];
1096 PartialDescriptor->Type = CmResourceTypePort;
1098 PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
1099 PartialDescriptor->u.Port.Start.LowPart = 0x64;
1100 PartialDescriptor->u.Port.Start.HighPart = 0x0;
1101 PartialDescriptor->u.Port.Length = 1;
1102
1103 /* Create controller key */
1107 Input | ConsoleIn,
1108 0,
1109 0xFFFFFFFF,
1110 NULL,
1111 PartialResourceList,
1112 Size,
1113 &ControllerKey);
1114
1115 DetectKeyboardPeripheral(ControllerKey);
1116}
1117
1118static
1119VOID
1121{
1122 ULONG Timeout;
1123 UCHAR Status;
1124
1126 {
1129 return;
1130
1131 /* Sleep for one millisecond */
1133 }
1134}
1135
1136static
1137BOOLEAN
1139{
1140#if 1
1141 /* Current detection is too unreliable. Just do as if
1142 * the PS/2 aux port is always present
1143 */
1144 return TRUE;
1145#else
1146 ULONG Loops;
1147 UCHAR Status;
1148
1149 /* Put the value 0x5A in the output buffer using the
1150 * "WriteAuxiliary Device Output Buffer" command (0xD3).
1151 * Poll the Status Register for a while to see if the value really turns up
1152 * in the Data Register. If the KEYBOARD_STATUS_MOUSE_OBF bit is also set
1153 * to 1 in the Status Register, we assume this controller has an
1154 * Auxiliary Port (a.k.a. Mouse Port).
1155 */
1160
1161 /* 0x5A is a random dummy value */
1163 0x5A);
1164
1165 for (Loops = 0; Loops < 10; Loops++)
1166 {
1170 break;
1171 }
1172
1174
1176#endif
1177}
1178
1179static
1180BOOLEAN
1182{
1183 UCHAR Scancode;
1184 UCHAR Status;
1185 ULONG Loops;
1187
1192
1193 /* Identify device */
1195
1196 /* Wait for reply */
1197 for (Loops = 0; Loops < 100; Loops++)
1198 {
1202 break;
1203 }
1204
1207 Result = FALSE;
1208
1210 if (Scancode != 0xFA)
1211 Result = FALSE;
1212
1214
1217 Result = FALSE;
1218
1220 if (Scancode != 0x00)
1221 Result = FALSE;
1222
1223 return Result;
1224}
1225
1226// FIXME: Missing: DetectPS2Peripheral!! (for corresponding 'PointerPeripheral')
1227
1228static
1229VOID
1231{
1232 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1233 PCONFIGURATION_COMPONENT_DATA ControllerKey;
1234 PCONFIGURATION_COMPONENT_DATA PeripheralKey;
1235 ULONG Size;
1236
1237 if (DetectPS2AuxPort())
1238 {
1239 TRACE("Detected PS2 port\n");
1240
1241 PartialResourceList = FrLdrHeapAlloc(sizeof(CM_PARTIAL_RESOURCE_LIST), TAG_HW_RESOURCE_LIST);
1242 if (PartialResourceList == NULL)
1243 {
1244 ERR("Failed to allocate resource descriptor\n");
1245 return;
1246 }
1247
1248 /* Initialize resource descriptor */
1249 RtlZeroMemory(PartialResourceList, sizeof(CM_PARTIAL_RESOURCE_LIST));
1250 PartialResourceList->Version = 1;
1251 PartialResourceList->Revision = 1;
1252 PartialResourceList->Count = 1;
1253
1254 /* Set Interrupt */
1255 PartialResourceList->PartialDescriptors[0].Type = CmResourceTypeInterrupt;
1257 PartialResourceList->PartialDescriptors[0].Flags = CM_RESOURCE_INTERRUPT_LATCHED;
1258 PartialResourceList->PartialDescriptors[0].u.Interrupt.Level = 12;
1259 PartialResourceList->PartialDescriptors[0].u.Interrupt.Vector = 12;
1260 PartialResourceList->PartialDescriptors[0].u.Interrupt.Affinity = 0xFFFFFFFF;
1261
1262 /* Create controller key */
1266 Input,
1267 0,
1268 0xFFFFFFFF,
1269 NULL,
1270 PartialResourceList,
1272 &ControllerKey);
1273
1274 if (DetectPS2AuxDevice())
1275 {
1276 TRACE("Detected PS2 mouse\n");
1277
1278 /* Initialize resource descriptor */
1279 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
1281 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1282 if (PartialResourceList == NULL)
1283 {
1284 ERR("Failed to allocate resource descriptor\n");
1285 return;
1286 }
1287
1288 RtlZeroMemory(PartialResourceList, Size);
1289 PartialResourceList->Version = 1;
1290 PartialResourceList->Revision = 1;
1291 PartialResourceList->Count = 0;
1292
1293 /* Create peripheral key */
1294 FldrCreateComponentKey(ControllerKey,
1297 Input,
1298 0,
1299 0xFFFFFFFF,
1300 "MICROSOFT PS2 MOUSE",
1301 PartialResourceList,
1302 Size,
1303 &PeripheralKey);
1304 }
1305 }
1306}
1307
1308#if defined(_M_IX86)
1309static VOID
1310CreateBusMousePeripheralKey(
1312 _In_ ULONG IoBase,
1313 _In_ ULONG Irq)
1314{
1315 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1316 PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
1317 PCONFIGURATION_COMPONENT_DATA ControllerKey;
1318 PCONFIGURATION_COMPONENT_DATA PeripheralKey;
1319 ULONG Size;
1320
1321 /* Set 'Configuration Data' value */
1322 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors[2]);
1323 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1324 if (PartialResourceList == NULL)
1325 {
1326 ERR("Failed to allocate resource descriptor\n");
1327 return;
1328 }
1329
1330 /* Initialize resource descriptor */
1331 RtlZeroMemory(PartialResourceList, Size);
1332 PartialResourceList->Version = 1;
1333 PartialResourceList->Revision = 1;
1334 PartialResourceList->Count = 2;
1335
1336 /* Set IO Port */
1337 PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1338 PartialDescriptor->Type = CmResourceTypePort;
1340 PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
1341 PartialDescriptor->u.Port.Start.LowPart = IoBase;
1342 PartialDescriptor->u.Port.Start.HighPart = 0;
1343 PartialDescriptor->u.Port.Length = 4;
1344
1345 /* Set Interrupt */
1346 PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
1347 PartialDescriptor->Type = CmResourceTypeInterrupt;
1348 PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1349 PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
1350 PartialDescriptor->u.Interrupt.Level = Irq;
1351 PartialDescriptor->u.Interrupt.Vector = Irq;
1352 PartialDescriptor->u.Interrupt.Affinity = (KAFFINITY)-1;
1353
1354 /* Create controller key */
1358 Input,
1359 0,
1360 0xFFFFFFFF,
1361 NULL,
1362 PartialResourceList,
1363 Size,
1364 &ControllerKey);
1365
1366 /* Set 'Configuration Data' value */
1367 Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors);
1368 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1369 if (PartialResourceList == NULL)
1370 {
1371 ERR("Failed to allocate resource descriptor\n");
1372 return;
1373 }
1374
1375 /* Initialize resource descriptor */
1376 RtlZeroMemory(PartialResourceList, Size);
1377 PartialResourceList->Version = 1;
1378 PartialResourceList->Revision = 1;
1379 PartialResourceList->Count = 0;
1380
1381 /* Create peripheral key */
1382 FldrCreateComponentKey(ControllerKey,
1385 Input,
1386 0,
1387 0xFFFFFFFF,
1388 "MICROSOFT INPORT MOUSE",
1389 PartialResourceList,
1390 Size,
1391 &PeripheralKey);
1392}
1393
1394extern KIDTENTRY DECLSPEC_ALIGN(4) i386Idt[32];
1395VOID __cdecl HwIrqHandler(VOID);
1396extern volatile ULONG HwIrqCount;
1397
1398static ULONG
1399DetectBusMouseTestIrq(
1400 _In_ ULONG IoBase,
1401 _In_ ULONG Irq)
1402{
1403 USHORT OldOffset, OldExtendedOffset;
1404 ULONG Vector, i;
1405
1406 HwIrqCount = 0;
1407
1408 /* Reset the device */
1411
1412 Vector = Irq + 8;
1413
1414 /* Save the old interrupt vector and replace it by ours */
1415 OldOffset = i386Idt[Vector].Offset;
1416 OldExtendedOffset = i386Idt[Vector].ExtendedOffset;
1417
1418 i386Idt[Vector].Offset = (ULONG)HwIrqHandler & 0xFFFF;
1419 i386Idt[Vector].ExtendedOffset = (ULONG)HwIrqHandler >> 16;
1420
1421 /* Enable the requested IRQ on the master PIC */
1422 WRITE_PORT_UCHAR((PUCHAR)PIC1_DATA_PORT, ~(1 << Irq));
1423
1424 _enable();
1425
1426 /* Configure the device to generate interrupts */
1427 for (i = 0; i < 15; i++)
1428 {
1431 }
1432
1433 /* Disable the device */
1435
1436 _disable();
1437
1438 i386Idt[Vector].Offset = OldOffset;
1439 i386Idt[Vector].ExtendedOffset = OldExtendedOffset;
1440
1441 return (HwIrqCount != 0) ? Irq : 0;
1442}
1443
1444static ULONG
1445DetectBusMouseIrq(
1446 _In_ ULONG IoBase)
1447{
1448 UCHAR Mask1, Mask2;
1449 ULONG Irq, Result;
1450
1451 /* Save the current interrupt mask */
1454
1455 /* Mask the interrupts on the slave PIC */
1457
1458 /* Process IRQ detection: IRQ 5, 4, 3 */
1459 for (Irq = 5; Irq >= 3; Irq--)
1460 {
1461 Result = DetectBusMouseTestIrq(IoBase, Irq);
1462 if (Result != 0)
1463 break;
1464 }
1465
1466 /* Restore the mask */
1469
1470 return Result;
1471}
1472
1473static VOID
1474DetectBusMouse(
1476{
1477 ULONG IoBase, Irq, Signature1, Signature2, Signature3;
1478
1479 /*
1480 * The bus mouse lives at one of these addresses: 0x230, 0x234, 0x238, 0x23C.
1481 * The 0x23C port is the most common I/O setting.
1482 */
1483 for (IoBase = 0x23C; IoBase >= 0x230; IoBase -= 4)
1484 {
1485 Signature1 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE);
1486 Signature2 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE);
1487 if (Signature1 == Signature2)
1488 continue;
1489 if (Signature1 != INPORT_SIGNATURE && Signature2 != INPORT_SIGNATURE)
1490 continue;
1491
1492 Signature3 = READ_PORT_UCHAR((PUCHAR)IoBase + INPORT_REGISTER_SIGNATURE);
1493 if (Signature1 != Signature3)
1494 continue;
1495
1496 Irq = DetectBusMouseIrq(IoBase);
1497 if (Irq == 0)
1498 continue;
1499
1500 CreateBusMousePeripheralKey(BusKey, IoBase, Irq);
1501 break;
1502 }
1503}
1504#endif /* _M_IX86 */
1505
1506// Implemented in pcvesa.c, returns the VESA version
1510
1511static VOID
1513{
1515 PCONFIGURATION_COMPONENT_DATA ControllerKey;
1516 USHORT VesaVersion;
1517
1518 /* FIXME: Set 'ComponentInformation' value */
1519
1520 VesaVersion = BiosIsVesaSupported();
1521 if (VesaVersion != 0)
1522 {
1523 TRACE("VESA version %c.%c\n",
1524 (VesaVersion >> 8) + '0',
1525 (VesaVersion & 0xFF) + '0');
1526 }
1527 else
1528 {
1529 TRACE("VESA not supported\n");
1530 }
1531
1532 if (VesaVersion >= 0x0200)
1533 Identifier = "VBE Display";
1534 else
1535 Identifier = "VGA Display";
1536
1541 0,
1542 0xFFFFFFFF,
1543 Identifier,
1544 NULL,
1545 0,
1546 &ControllerKey);
1547
1548 /* FIXME: Add display peripheral (monitor) data */
1549 if (VesaVersion != 0)
1550 {
1552 {
1553 TRACE("VESA/DDC supported!\n");
1554 if (BiosVesaReadEdid())
1555 {
1556 TRACE("EDID data read successfully!\n");
1557 }
1558 }
1559 }
1560}
1561
1562static
1563VOID
1565{
1566 PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1568 ULONG Size;
1569
1570 /* Set 'Configuration Data' value */
1571 Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
1573 PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1574 if (PartialResourceList == NULL)
1575 {
1576 ERR("Failed to allocate resource descriptor\n");
1577 return;
1578 }
1579
1580 /* Initialize resource descriptor */
1581 RtlZeroMemory(PartialResourceList, Size);
1582 PartialResourceList->Version = 1;
1583 PartialResourceList->Revision = 1;
1584 PartialResourceList->Count = 0;
1585
1586 /* Create new bus key */
1587 FldrCreateComponentKey(SystemKey,
1590 0,
1591 0,
1592 0xFFFFFFFF,
1593 "ISA",
1594 PartialResourceList,
1595 Size,
1596 &BusKey);
1597
1598 /* Increment bus number */
1599 (*BusNumber)++;
1600
1601 /* Detect ISA/BIOS devices */
1602 DetectBiosDisks(SystemKey, BusKey);
1604 DetectParallelPorts(BusKey);
1606 DetectPS2Mouse(BusKey);
1607#if defined(_M_IX86)
1608 DetectBusMouse(BusKey);
1609#endif
1611
1612 /* FIXME: Detect more ISA devices */
1613}
1614
1615/* FIXME: Abstract things better so we don't need to place define here */
1616#if !defined(SARCH_XBOX)
1617static
1618UCHAR
1620{
1621 UCHAR Data;
1622
1623 WRITE_PORT_UCHAR((PUCHAR)0x70, 0x10);
1624 Data = READ_PORT_UCHAR((PUCHAR)0x71);
1625
1626 return ((Data & 0xF0) ? 1 : 0) + ((Data & 0x0F) ? 1 : 0);
1627}
1628#endif
1629
1632{
1634 ULONG BusNumber = 0;
1635
1636 TRACE("DetectHardware()\n");
1637
1638 /* Create the 'System' key */
1639 // TODO: Discover and set the other machine types
1640 FldrCreateSystemKey(&SystemKey, "AT/AT COMPATIBLE");
1641
1644
1645 /* Detect buses */
1646 DetectPciBios(SystemKey, &BusNumber);
1647 DetectApmBios(SystemKey, &BusNumber);
1648 DetectPnpBios(SystemKey, &BusNumber);
1649 DetectIsaBios(SystemKey, &BusNumber); // TODO: Detect first EISA or MCA, before ISA
1650 DetectAcpiBios(SystemKey, &BusNumber);
1651
1652 // TODO: Collect the ROM blocks from 0xC0000 to 0xF0000 and append their
1653 // CM_ROM_BLOCK data into the 'System' key's configuration data.
1654
1655 TRACE("DetectHardware() Done\n");
1656 return SystemKey;
1657}
1658
1659VOID
1661{
1662 REGS Regs;
1663
1664 /* Select APM 1.0+ function */
1665 Regs.b.ah = 0x53;
1666
1667 /* Function 05h: CPU idle */
1668 Regs.b.al = 0x05;
1669
1670 /* Call INT 15h */
1671 Int386(0x15, &Regs, &Regs);
1672
1673 /* Check if successfull (CF set on error) */
1674 if (INT386_SUCCESS(Regs))
1675 return;
1676
1677 /*
1678 * No futher processing here.
1679 * Optionally implement HLT instruction handling.
1680 */
1681}
1682
1684 IN UCHAR BootDrive OPTIONAL,
1685 IN ULONG BootPartition OPTIONAL)
1686{
1687 REGS Regs;
1688
1689 RtlZeroMemory(&Regs, sizeof(Regs));
1690
1691 /* Set the boot drive and the boot partition */
1692 Regs.b.dl = (UCHAR)(BootDrive ? BootDrive : FrldrBootDrive);
1693 Regs.b.dh = (UCHAR)(BootPartition ? BootPartition : FrldrBootPartition);
1694
1695 /*
1696 * Don't stop the floppy drive motor when we are just booting a bootsector,
1697 * a drive, or a partition. If we were to stop the floppy motor, the BIOS
1698 * wouldn't be informed and if the next read is to a floppy then the BIOS
1699 * will still think the motor is on and this will result in a read error.
1700 */
1701 // DiskStopFloppyMotor();
1702
1703 Relocator16Boot(&Regs,
1704 /* Stack segment:pointer */
1705 0x0000, 0x7C00,
1706 /* Code segment:pointer */
1707 0x0000, 0x7C00);
1708}
1709
1710/******************************************************************************/
1711
1712/* FIXME: Abstract things better so we don't need to place define here */
1713#if !defined(SARCH_XBOX)
1714VOID
1715MachInit(const char *CmdLine)
1716{
1717 /* Setup vtbl */
1718 RtlZeroMemory(&MachVtbl, sizeof(MachVtbl));
1747
1749}
1750
1751VOID
1753{
1754 /* On PC, prepare video and turn off the floppy motor */
1757}
1758#endif
1759
1760/* EOF */
@ DeviceNode
Definition: Node.h:9
unsigned char BOOLEAN
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define __cdecl
Definition: accygwin.h:79
MACHVTBL MachVtbl
Definition: arcemul.c:21
#define ExtendedBIOSDataArea
Definition: winldr.c:420
#define ExtendedBIOSDataSize
Definition: winldr.c:421
VOID FldrCreateSystemKey(_Out_ PCONFIGURATION_COMPONENT_DATA *SystemNode, _In_ PCSTR IdentifierString)
Definition: archwsup.c:135
VOID 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_ PCSTR IdentifierString, _In_ PCM_PARTIAL_RESOURCE_LIST ResourceList, _In_ ULONG Size, _Out_ PCONFIGURATION_COMPONENT_DATA *ComponentKey)
Definition: archwsup.c:198
@ Identifier
Definition: asmpp.cpp:95
VOID DetectAcpiBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwacpi.c:54
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwpci.c:176
BOOLEAN PcFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: hwpci.c:80
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
#define DiskReadBuffer
Definition: hardware.h:33
ULONG __cdecl PnpBiosGetDeviceNode(UCHAR *NodeId, UCHAR *NodeBuffer)
ULONG __cdecl PnpBiosGetDeviceNodeCount(ULONG *NodeSize, ULONG *NodeCount)
ULONG_PTR __cdecl PnpBiosSupported(VOID)
ULONG(* GET_SERIAL_PORT)(ULONG Index, PULONG Irq)
Definition: hardware.h:69
ULONG __cdecl PnpBiosGetDockStationInformation(UCHAR *DockingStationInfo)
#define WARN(fmt,...)
Definition: debug.h:112
#define ERR(fmt,...)
Definition: debug.h:110
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:103
struct _EXTENDED_GEOMETRY EXTENDED_GEOMETRY
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
Definition: mm.h:181
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:174
Definition: bufpool.h:45
BOOLEAN Rs232PortInUse(PUCHAR Base)
Definition: rs232.c:140
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
Definition: cport.c:224
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
ULONG_PTR KAFFINITY
Definition: compat.h:85
static const WCHAR CmdLine[]
Definition: install.c:48
#define UlongToPtr(u)
Definition: config.h:106
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Definition: fsrtlfuncs.h:898
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLubyte * c
Definition: glext.h:8905
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
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
CPPORT Port[4]
Definition: headless.c:35
VOID DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwapm.c:46
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:470
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
void __cdecl _disable(void)
Definition: intrin_arm.h:365
void __cdecl _enable(void)
Definition: intrin_arm.h:373
#define c
Definition: ke_i.h:80
if(dx< 0)
Definition: linetemp.h:194
#define CONTROLLER_COMMAND_WRITE_MOUSE
Definition: machpc.c:75
VOID PcGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machpc.c:94
#define PIC1_DATA_PORT
Definition: machpc.c:52
ULONG PcGetSerialPort(ULONG Index, PULONG Irq)
Definition: machpc.c:714
static VOID DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: machpc.c:253
#define MOUSE_TYPE_MICROSOFT
Definition: machpc.c:33
static VOID DetectDockingStation(_Inout_ PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:196
#define MAX_LPT_PORTS
Definition: machpc.c:28
BOOLEAN BiosVesaReadEdid(VOID)
Definition: pcvesa.c:272
static VOID PS2ControllerWait(VOID)
Definition: machpc.c:1120
#define INPORT_REGISTER_DATA
Definition: machpc.c:42
#define INPORT_REGISTER_CONTROL
Definition: machpc.c:41
#define INPORT_MODE_BASE
Definition: machpc.c:47
static ULONG GetSerialMousePnpId(PUCHAR Port, char *Buffer)
Definition: machpc.c:496
static ULONG DetectSerialMouse(PUCHAR Port)
Definition: machpc.c:403
VOID MachInit(const char *CmdLine)
Definition: machpc.c:1715
#define INPORT_TEST_IRQ
Definition: machpc.c:48
static BOOLEAN DetectPS2AuxDevice(VOID)
Definition: machpc.c:1181
#define CONTROLLER_REGISTER_STATUS
Definition: machpc.c:59
#define CONTROLLER_STATUS_INPUT_BUFFER_FULL
Definition: machpc.c:79
#define MOUSE_TYPE_LOGITECH
Definition: machpc.c:35
BOOLEAN DetectKeyboardDevice(VOID)
Definition: machpc.c:919
#define MAX_COM_PORTS
Definition: machpc.c:27
PCONFIGURATION_COMPONENT_DATA PcHwDetect(VOID)
Definition: machpc.c:1631
static UCHAR PcGetFloppyCount(VOID)
Definition: machpc.c:1619
static VOID DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:1053
#define PIC2_DATA_PORT
Definition: machpc.c:54
static VOID InitializeSerialPort(PUCHAR Port, UCHAR LineControl)
Definition: machpc.c:389
#define CONTROLLER_TIMEOUT
Definition: machpc.c:90
#define CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL
Definition: machpc.c:83
VOID PcHwIdle(VOID)
Definition: machpc.c:1660
VOID DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count)
Definition: machpc.c:731
#define MOUSE_TYPE_NONE
Definition: machpc.c:31
#define CONTROLLER_STATUS_OUTPUT_BUFFER_FULL
Definition: machpc.c:78
#define CONTROLLER_REGISTER_CONTROL
Definition: machpc.c:60
static VOID DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: machpc.c:1564
VOID PcPrepareForReactOS(VOID)
Definition: machpc.c:1752
#define MOUSE_TYPE_WHEELZ
Definition: machpc.c:37
VOID __cdecl ChainLoadBiosBootSectorCode(IN UCHAR BootDrive OPTIONAL, IN ULONG BootPartition OPTIONAL)
Definition: machpc.c:1683
#define INPORT_REG_MODE
Definition: machpc.c:45
static BOOLEAN DetectPS2AuxPort(VOID)
Definition: machpc.c:1138
static VOID DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:1230
static VOID DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
Definition: machpc.c:988
static VOID DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:827
#define INPORT_SIGNATURE
Definition: machpc.c:49
#define INPORT_REGISTER_SIGNATURE
Definition: machpc.c:43
static VOID DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: machpc.c:1512
#define CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER
Definition: machpc.c:74
#define INPORT_RESET
Definition: machpc.c:46
#define CONTROLLER_REGISTER_DATA
Definition: machpc.c:61
static PCM_PARTIAL_RESOURCE_LIST PcGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
Definition: machpc.c:118
static VOID DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, PUCHAR Base)
Definition: machpc.c:556
BOOLEAN BiosIsVesaDdcSupported(VOID)
Definition: pcvesa.c:242
USHORT BiosIsVesaSupported(VOID)
Definition: pcvesa.c:160
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
int k
Definition: mpi.c:3369
#define _Inout_
Definition: ms_sal.h:378
#define _In_
Definition: ms_sal.h:308
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2439
int Count
Definition: noreturn.cpp:7
#define DECLSPEC_ALIGN(x)
Definition: ntbasedef.h:251
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTRSAFEVAPI RtlStringCbPrintfA(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCSTR pszFormat,...)
Definition: ntstrsafe.h:1148
#define L(x)
Definition: ntvdm.h:50
VOID __cdecl DiskStopFloppyMotor(VOID)
Definition: pc98hw.c:1234
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
VOID PcBeep(VOID)
Definition: pcbeep.c:34
#define INT386_SUCCESS(regs)
Definition: pcbios.h:179
int __cdecl Int386(int ivec, REGS *in, REGS *out)
VOID __cdecl Relocator16Boot(IN REGS *In, IN USHORT StackSegment, IN USHORT StackPointer, IN USHORT CodeSegment, IN USHORT CodePointer)
struct _DOCKING_STATE_INFORMATION DOCKING_STATE_INFORMATION
struct _DOCKING_STATE_INFORMATION * PDOCKING_STATE_INFORMATION
VOID PcConsPutChar(int Ch)
Definition: pccons.c:28
BOOLEAN PcConsKbHit(VOID)
Definition: pccons.c:69
int PcConsGetCh(void)
Definition: pccons.c:90
BOOLEAN PcDiskReadLogicalSectors(IN UCHAR DriveNumber, IN ULONGLONG SectorNumber, IN ULONG SectorCount, OUT PVOID Buffer)
Definition: pcdisk.c:758
static BOOLEAN DiskGetExtendedDriveParameters(IN UCHAR DriveNumber, IN PPC_DISK_DRIVE DiskDrive, OUT PVOID Buffer, IN USHORT BufferSize)
Definition: pcdisk.c:294
ULONG PcDiskGetCacheableBlockCount(UCHAR DriveNumber)
Definition: pcdisk.c:827
BOOLEAN PcDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
Definition: pcdisk.c:798
VOID HalpCalibrateStallExecution(VOID)
Definition: pchw.c:105
VOID DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: pchw.c:344
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: pchw.c:45
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60
PFREELDR_MEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize)
Definition: pcmem.c:599
TIMEINFO * PcGetTime(VOID)
Definition: pcrtc.c:24
VOID PcVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
Definition: pcvideo.c:1010
VOID PcVideoPrepareForReactOS(VOID)
Definition: pcvideo.c:1161
BOOLEAN PcVideoIsPaletteFixed(VOID)
Definition: pcvideo.c:1114
VOID PcVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: pcvideo.c:1120
VOID PcVideoSync(VOID)
Definition: pcvideo.c:1138
VOID PcVideoGetFontsFromFirmware(PULONG RomFontPointers)
Definition: pcvideo.c:976
VOID PcVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: pcvideo.c:946
VOID PcVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: pcvideo.c:1129
VIDEODISPLAYMODE PcVideoSetDisplayMode(char *DisplayModeName, BOOLEAN Init)
Definition: pcvideo.c:888
ULONG PcVideoGetBufferSize(VOID)
Definition: pcvideo.c:970
VOID PcVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: pcvideo.c:1105
VOID PcVideoClearScreen(UCHAR Attr)
Definition: pcvideo.c:1089
VOID PcVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: pcvideo.c:1048
VOID PcVideoHideShowTextCursor(BOOLEAN Show)
Definition: pcvideo.c:1035
unsigned short USHORT
Definition: pedump.c:61
static ULONG Timeout
Definition: ping.c:61
struct _CM_PNP_BIOS_INSTALLATION_CHECK * PCM_PNP_BIOS_INSTALLATION_CHECK
struct _CM_PNP_BIOS_INSTALLATION_CHECK CM_PNP_BIOS_INSTALLATION_CHECK
struct _CM_PNP_BIOS_DEVICE_NODE * PCM_PNP_BIOS_DEVICE_NODE
#define volatile
Definition: prototyp.h:117
@ ControllerClass
Definition: arc.h:94
@ AdapterClass
Definition: arc.h:93
@ PeripheralClass
Definition: arc.h:95
@ PointerController
Definition: arc.h:125
@ MultiFunctionAdapter
Definition: arc.h:116
@ SerialController
Definition: arc.h:121
@ ParallelController
Definition: arc.h:124
@ KeyboardPeripheral
Definition: arc.h:136
@ KeyboardController
Definition: arc.h:126
@ DockingInformation
Definition: arc.h:142
@ PointerPeripheral
Definition: arc.h:135
@ DisplayController
Definition: arc.h:123
@ ConsoleOut
Definition: arc.h:83
@ ConsoleIn
Definition: arc.h:82
@ Input
Definition: arc.h:84
@ Output
Definition: arc.h:85
#define TRACE(s)
Definition: solgame.cpp:4
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
unsigned char dl
Definition: pcbios.h:140
unsigned char al
Definition: pcbios.h:131
unsigned char ah
Definition: pcbios.h:132
unsigned char dh
Definition: pcbios.h:141
unsigned long eax
Definition: pcbios.h:91
unsigned short es
Definition: pcbios.h:121
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@391 DeviceSpecificData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@384 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@385 Interrupt
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
Definition: disk.h:25
ULONG BytesPerSector
Definition: disk.h:29
ULONG Sectors
Definition: disk.h:28
ULONG Cylinders
Definition: disk.h:26
ULONG Heads
Definition: disk.h:27
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
VOID(* GetExtendedBIOSData)(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machine.h:64
int(* ConsGetCh)(VOID)
Definition: machine.h:43
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
UCHAR(* GetFloppyCount)(VOID)
Definition: machine.h:66
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
VOID(* VideoGetFontsFromFirmware)(PULONG RomFontPointers)
Definition: machine.h:49
VOID(* Beep)(VOID)
Definition: machine.h:58
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
VOID(* HwIdle)(VOID)
Definition: machine.h:78
VOID(* VideoSync)(VOID)
Definition: machine.h:57
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
uint32_t * PULONG
Definition: typedefs.h:59
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
void * PVOID
Definition: typedefs.h:50
uint16_t * PUSHORT
Definition: typedefs.h:56
const char * PCSTR
Definition: typedefs.h:52
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
#define TAG_HW_RESOURCE_LIST
Definition: uefidisk.c:15
UCHAR FrldrBootDrive
Definition: uefidisk.c:47
ULONG FrldrBootPartition
Definition: uefidisk.c:48
Definition: pcbios.h:159
DWORDREGS d
Definition: pcbios.h:161
BYTEREGS b
Definition: pcbios.h:163
WORDREGS w
Definition: pcbios.h:162
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
_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:409
struct _CM_SERIAL_DEVICE_DATA * PCM_SERIAL_DEVICE_DATA
struct _CM_DISK_GEOMETRY_DEVICE_DATA CM_DISK_GEOMETRY_DEVICE_DATA
struct _CM_KEYBOARD_DEVICE_DATA * PCM_KEYBOARD_DEVICE_DATA
struct _CM_KEYBOARD_DEVICE_DATA CM_KEYBOARD_DEVICE_DATA
struct _CM_SERIAL_DEVICE_DATA CM_SERIAL_DEVICE_DATA
@ CmResourceShareDeviceExclusive
Definition: cmtypes.h:241
@ CmResourceShareUndetermined
Definition: cmtypes.h:240
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_Out_ PUSHORT NodeNumber
Definition: iofuncs.h:2574
unsigned char UCHAR
Definition: xmlstorage.h:181
__wchar_t WCHAR
Definition: xmlstorage.h:180
char CHAR
Definition: xmlstorage.h:175