ReactOS  0.4.14-dev-49-gfb4591c
machxbox.c File Reference
#include <freeldr.h>
#include <debug.h>
Include dependency graph for machxbox.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (HWDETECT)
 
BOOLEAN XboxFindPciBios (PPCI_REGISTRY_INFO BusData)
 
VOID DetectSerialPointerPeripheral (PCONFIGURATION_COMPONENT_DATA ControllerKey, PUCHAR Base)
 
static ULONG XboxGetSerialPort (ULONG Index, PULONG Irq)
 
VOID DetectSerialPorts (PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count)
 
VOID XboxGetExtendedBIOSData (PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
 
static PCM_PARTIAL_RESOURCE_LIST XboxGetHarddiskConfigurationData (UCHAR DriveNumber, ULONG *pSize)
 
static VOID DetectIsaBios (PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
 
static UCHAR XboxGetFloppyCount (VOID)
 
PCONFIGURATION_COMPONENT_DATA XboxHwDetect (VOID)
 
VOID XboxHwIdle (VOID)
 
VOID XboxMachInit (const char *CmdLine)
 
VOID XboxPrepareForReactOS (VOID)
 

Function Documentation

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( HWDETECT  )

◆ DetectIsaBios()

static VOID DetectIsaBios ( PCONFIGURATION_COMPONENT_DATA  SystemKey,
ULONG BusNumber 
)
static

Definition at line 165 of file machxbox.c.

166 {
167  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
169  ULONG Size;
170 
171  /* Set 'Configuration Data' value */
172  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) -
174  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
175  if (PartialResourceList == NULL)
176  {
177  TRACE("Failed to allocate resource descriptor\n");
178  return;
179  }
180 
181  /* Initialize resource descriptor */
182  memset(PartialResourceList, 0, Size);
183  PartialResourceList->Version = 1;
184  PartialResourceList->Revision = 1;
185  PartialResourceList->Count = 0;
186 
187  /* Create new bus key */
188  FldrCreateComponentKey(SystemKey,
189  AdapterClass,
190  MultiFunctionAdapter,
191  0x0,
192  0x0,
193  0xFFFFFFFF,
194  "ISA",
195  PartialResourceList,
196  Size,
197  &BusKey);
198 
199  /* Increment bus number */
200  (*BusNumber)++;
201 
202  /* Detect ISA/BIOS devices */
203  DetectBiosDisks(SystemKey, BusKey);
205 
206  /* FIXME: Detect more ISA devices */
207 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
VOID DetectSerialPorts(PCONFIGURATION_COMPONENT_DATA BusKey, GET_SERIAL_PORT MachGetSerialPort, ULONG Count)
Definition: machpc.c:656
GLint x0
Definition: linetemp.h:95
#define MAX_XBOX_COM_PORTS
Definition: machxbox.h:25
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
VOID DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey, PCONFIGURATION_COMPONENT_DATA BusKey)
Definition: hardware.c:339
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
static ULONG XboxGetSerialPort(ULONG Index, PULONG Irq)
Definition: machxbox.c:43
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
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26

Referenced by XboxHwDetect().

◆ DetectSerialPointerPeripheral()

VOID DetectSerialPointerPeripheral ( PCONFIGURATION_COMPONENT_DATA  ControllerKey,
PUCHAR  Base 
)

◆ DetectSerialPorts()

VOID DetectSerialPorts ( PCONFIGURATION_COMPONENT_DATA  BusKey,
GET_SERIAL_PORT  MachGetSerialPort,
ULONG  Count 
)

Definition at line 656 of file machpc.c.

657 {
658  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
659  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
660  PCM_SERIAL_DEVICE_DATA SerialDeviceData;
661  ULONG Irq;
662  ULONG Base;
663  CHAR Buffer[80];
664  ULONG ControllerNumber = 0;
665  PCONFIGURATION_COMPONENT_DATA ControllerKey;
666  ULONG i;
667  ULONG Size;
668 
669  TRACE("DetectSerialPorts()\n");
670 
671  for (i = 0; i < Count; i++)
672  {
673  Base = MachGetSerialPort(i, &Irq);
674  if ((Base == 0) || !CpDoesPortExist(UlongToPtr(Base)))
675  continue;
676 
677  TRACE("Found COM%u port at 0x%x\n", i + 1, Base);
678 
679  /* Set 'Identifier' value */
680  sprintf(Buffer, "COM%ld", i + 1);
681 
682  /* Build full device descriptor */
683  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
684  2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
685  sizeof(CM_SERIAL_DEVICE_DATA);
686  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
687  if (PartialResourceList == NULL)
688  {
689  ERR("Failed to allocate resource descriptor\n");
690  continue;
691  }
692  memset(PartialResourceList, 0, Size);
693 
694  /* Initialize resource descriptor */
695  PartialResourceList->Version = 1;
696  PartialResourceList->Revision = 1;
697  PartialResourceList->Count = 3;
698 
699  /* Set IO Port */
700  PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
701  PartialDescriptor->Type = CmResourceTypePort;
703  PartialDescriptor->Flags = CM_RESOURCE_PORT_IO;
704  PartialDescriptor->u.Port.Start.LowPart = Base;
705  PartialDescriptor->u.Port.Start.HighPart = 0x0;
706  PartialDescriptor->u.Port.Length = 7;
707 
708  /* Set Interrupt */
709  PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
710  PartialDescriptor->Type = CmResourceTypeInterrupt;
711  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
712  PartialDescriptor->Flags = CM_RESOURCE_INTERRUPT_LATCHED;
713  PartialDescriptor->u.Interrupt.Level = Irq;
714  PartialDescriptor->u.Interrupt.Vector = Irq;
715  PartialDescriptor->u.Interrupt.Affinity = 0xFFFFFFFF;
716 
717  /* Set serial data (device specific) */
718  PartialDescriptor = &PartialResourceList->PartialDescriptors[2];
719  PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
720  PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
721  PartialDescriptor->Flags = 0;
722  PartialDescriptor->u.DeviceSpecificData.DataSize = sizeof(CM_SERIAL_DEVICE_DATA);
723 
724  SerialDeviceData =
725  (PCM_SERIAL_DEVICE_DATA)&PartialResourceList->PartialDescriptors[3];
726  SerialDeviceData->BaudClock = 1843200; /* UART Clock frequency (Hertz) */
727 
728  /* Create controller key */
729  FldrCreateComponentKey(BusKey,
731  SerialController,
733  ControllerNumber,
734  0xFFFFFFFF,
735  Buffer,
736  PartialResourceList,
737  Size,
738  &ControllerKey);
739 
741  {
742  /* Detect serial mouse */
744  }
745 
746  ControllerNumber++;
747  }
748 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
Definition: arc.h:82
char CHAR
Definition: xmlstorage.h:175
struct _CM_SERIAL_DEVICE_DATA CM_SERIAL_DEVICE_DATA
_In_opt_ ULONG Base
Definition: rtlfuncs.h:2343
Definition: arc.h:84
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@374 Interrupt
static VOID DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey, PUCHAR Base)
Definition: machpc.c:480
BOOLEAN Rs232PortInUse(PUCHAR Base)
Definition: rs232.c:132
#define CmResourceTypePort
Definition: hwresource.cpp:123
#define sprintf(buf, format,...)
Definition: sprintf.c:55
BOOLEAN NTAPI CpDoesPortExist(IN PUCHAR Address)
Definition: cport.c:227
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
smooth NULL
Definition: ftsmooth.c:416
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@373 Port
Definition: bufpool.h:45
#define UlongToPtr(u)
Definition: config.h:106
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
#define TRACE(s)
Definition: solgame.cpp:4
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@380 DeviceSpecificData
struct _CM_SERIAL_DEVICE_DATA * PCM_SERIAL_DEVICE_DATA
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
Definition: arc.h:85
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
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
#define ERR(fmt,...)
Definition: debug.h:109
#define CM_RESOURCE_PORT_IO
Definition: cmtypes.h:109
Definition: arc.h:83
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26

Referenced by DetectIsaBios().

◆ XboxFindPciBios()

BOOLEAN XboxFindPciBios ( PPCI_REGISTRY_INFO  BusData)

Definition at line 26 of file machxbox.c.

27 {
28  /* We emulate PCI BIOS here, there are 2 known working PCI buses on an original Xbox */
29 
30  BusData->NoBuses = 2;
31  BusData->MajorRevision = 1;
32  BusData->MinorRevision = 0;
33  BusData->HardwareMechanism = 1;
34  return TRUE;
35 }
#define TRUE
Definition: types.h:120
UCHAR HardwareMechanism
Definition: pci.h:110
UCHAR MinorRevision
Definition: pci.h:108
UCHAR MajorRevision
Definition: pci.h:107
UCHAR NoBuses
Definition: pci.h:109

Referenced by XboxHwDetect().

◆ XboxGetExtendedBIOSData()

VOID XboxGetExtendedBIOSData ( PULONG  ExtendedBIOSDataArea,
PULONG  ExtendedBIOSDataSize 
)

Definition at line 85 of file machxbox.c.

86 {
87  TRACE("XboxGetExtendedBIOSData(): UNIMPLEMENTED\n");
90 }
#define ExtendedBIOSDataSize
Definition: winldr.c:421
#define ExtendedBIOSDataArea
Definition: winldr.c:420
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by XboxMachInit().

◆ XboxGetFloppyCount()

static UCHAR XboxGetFloppyCount ( VOID  )
static

Definition at line 211 of file machxbox.c.

212 {
213  /* On a PC we use CMOS/RTC I/O ports 0x70 and 0x71 to detect floppies.
214  * However an Xbox CMOS memory range [0x10, 0x70) and [0x80, 0x100)
215  * is filled with 0x55 0xAA 0x55 0xAA ... byte pattern which is used
216  * to validate the date/time settings by Xbox OS.
217  *
218  * Technically it's possible to connect a floppy drive to Xbox, but
219  * CMOS detection method should not be used here. */
220 
221  WARN("XboxGetFloppyCount() is UNIMPLEMENTED, returning 0\n");
222  return 0;
223 }
#define WARN(fmt,...)
Definition: debug.h:111

Referenced by XboxMachInit().

◆ XboxGetHarddiskConfigurationData()

static PCM_PARTIAL_RESOURCE_LIST XboxGetHarddiskConfigurationData ( UCHAR  DriveNumber,
ULONG pSize 
)
static

Definition at line 96 of file machxbox.c.

97 {
98  PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
99  PCM_DISK_GEOMETRY_DEVICE_DATA DiskGeometry;
100  //EXTENDED_GEOMETRY ExtGeometry;
101  GEOMETRY Geometry;
102  ULONG Size;
103 
104  //
105  // Initialize returned size
106  //
107  *pSize = 0;
108 
109  /* Set 'Configuration Data' value */
110  Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
112  PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
113  if (PartialResourceList == NULL)
114  {
115  ERR("Failed to allocate a full resource descriptor\n");
116  return NULL;
117  }
118 
119  memset(PartialResourceList, 0, Size);
120  PartialResourceList->Version = 1;
121  PartialResourceList->Revision = 1;
122  PartialResourceList->Count = 1;
123  PartialResourceList->PartialDescriptors[0].Type =
125 // PartialResourceList->PartialDescriptors[0].ShareDisposition =
126 // PartialResourceList->PartialDescriptors[0].Flags =
127  PartialResourceList->PartialDescriptors[0].u.DeviceSpecificData.DataSize =
129 
130  /* Get pointer to geometry data */
131  DiskGeometry = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
132 
133  /* Get the disk geometry */
134  //ExtGeometry.Size = sizeof(EXTENDED_GEOMETRY);
135 
136  if (XboxDiskGetDriveGeometry(DriveNumber, &Geometry))
137  {
138  DiskGeometry->BytesPerSector = Geometry.BytesPerSector;
139  DiskGeometry->NumberOfCylinders = Geometry.Cylinders;
140  DiskGeometry->SectorsPerTrack = Geometry.Sectors;
141  DiskGeometry->NumberOfHeads = Geometry.Heads;
142  }
143  else
144  {
145  ERR("Reading disk geometry failed\n");
146  FrLdrHeapFree(PartialResourceList, TAG_HW_RESOURCE_LIST);
147  return NULL;
148  }
149  TRACE("Disk %x: %u Cylinders %u Heads %u Sectors %u Bytes\n",
150  DriveNumber,
151  DiskGeometry->NumberOfCylinders,
152  DiskGeometry->NumberOfHeads,
153  DiskGeometry->SectorsPerTrack,
154  DiskGeometry->BytesPerSector);
155 
156  //
157  // Return configuration data
158  //
159  *pSize = Size;
160  return PartialResourceList;
161 }
struct _CM_PARTIAL_RESOURCE_LIST CM_PARTIAL_RESOURCE_LIST
#define CmResourceTypeDeviceSpecific
Definition: hwresource.cpp:127
FORCEINLINE VOID FrLdrHeapFree(PVOID MemoryPointer, ULONG Tag)
Definition: mm.h:170
ULONG Cylinders
Definition: disk.h:26
uint32_t ULONG_PTR
Definition: typedefs.h:63
smooth NULL
Definition: ftsmooth.c:416
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371 u
void * PVOID
Definition: retypes.h:9
ULONG Sectors
Definition: disk.h:28
#define TRACE(s)
Definition: solgame.cpp:4
FORCEINLINE PVOID FrLdrHeapAlloc(SIZE_T MemorySize, ULONG Tag)
Definition: mm.h:163
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@371::@380 DeviceSpecificData
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define ERR(fmt,...)
Definition: debug.h:109
BOOLEAN XboxDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
Definition: xboxdisk.c:456
ULONG BytesPerSector
Definition: disk.h:29
Definition: disk.h:24
unsigned int ULONG
Definition: retypes.h:1
#define memset(x, y, z)
Definition: compat.h:39
struct _CM_DISK_GEOMETRY_DEVICE_DATA CM_DISK_GEOMETRY_DEVICE_DATA
#define TAG_HW_RESOURCE_LIST
Definition: hardware.h:26
ULONG Heads
Definition: disk.h:27

Referenced by XboxHwDetect().

◆ XboxGetSerialPort()

static ULONG XboxGetSerialPort ( ULONG  Index,
PULONG  Irq 
)
static

Definition at line 43 of file machxbox.c.

44 {
45  /*
46  * Xbox may have maximum two Serial COM ports
47  * if the Super I/O chip is connected via LPC
48  */
50  ULONG ComBase = 0;
51 
52  // Enter Configuration
54 
55  // Select serial device
58 
59  // Check if selected device is active
61  if (READ_PORT_UCHAR(LPC_IO_BASE + 1) == 1)
62  {
63  // Read LSB
65  ComBase = READ_PORT_UCHAR(LPC_IO_BASE + 1);
66  // Read MSB
68  ComBase |= (READ_PORT_UCHAR(LPC_IO_BASE + 1) << 8);
69  // Read IRQ
71  *Irq = READ_PORT_UCHAR(LPC_IO_BASE + 1);
72  }
73 
74  // Exit Configuration
76 
77  return ComBase;
78 }
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
#define LPC_CONFIG_DEVICE_BASE_ADDRESS_LOW
Definition: machxbox.h:37
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
#define MAX_XBOX_COM_PORTS
Definition: machxbox.h:25
#define LPC_CONFIG_DEVICE_NUMBER
Definition: machxbox.h:34
#define LPC_IO_BASE
Definition: machxbox.h:27
#define LPC_ENTER_CONFIG_KEY
Definition: machxbox.h:28
static const UCHAR Index[8]
Definition: usbohci.c:18
#define LPC_CONFIG_DEVICE_ACTIVATE
Definition: machxbox.h:35
unsigned char UCHAR
Definition: xmlstorage.h:181
#define LPC_DEVICE_SERIAL_PORT_1
Definition: machxbox.h:31
#define LPC_EXIT_CONFIG_KEY
Definition: machxbox.h:29
#define LPC_DEVICE_SERIAL_PORT_2
Definition: machxbox.h:32
#define LPC_CONFIG_DEVICE_BASE_ADDRESS_HIGH
Definition: machxbox.h:36
unsigned int ULONG
Definition: retypes.h:1
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define LPC_CONFIG_DEVICE_INTERRUPT
Definition: machxbox.h:38

Referenced by DetectIsaBios().

◆ XboxHwDetect()

PCONFIGURATION_COMPONENT_DATA XboxHwDetect ( VOID  )

Definition at line 226 of file machxbox.c.

227 {
229  ULONG BusNumber = 0;
230 
231  TRACE("DetectHardware()\n");
232 
233  /* Create the 'System' key */
234  FldrCreateSystemKey(&SystemKey);
235 
238 
239  /* TODO: Build actual xbox's hardware configuration tree */
240  DetectPciBios(SystemKey, &BusNumber);
241  DetectIsaBios(SystemKey, &BusNumber);
242 
243  TRACE("DetectHardware() Done\n");
244  return SystemKey;
245 }
BOOLEAN XboxFindPciBios(PPCI_REGISTRY_INFO BusData)
Definition: machxbox.c:26
GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData
Definition: hardware.c:40
FIND_PCI_BIOS FindPciBios
Definition: hwpci.c:26
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define TRACE(s)
Definition: solgame.cpp:4
VOID DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: hwpci.c:176
unsigned int ULONG
Definition: retypes.h:1
VOID NTAPI FldrCreateSystemKey(OUT PCONFIGURATION_COMPONENT_DATA *SystemNode)
Definition: archwsup.c:89
static VOID DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
Definition: machxbox.c:165
static PCM_PARTIAL_RESOURCE_LIST XboxGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG *pSize)
Definition: machxbox.c:96

Referenced by XboxMachInit().

◆ XboxHwIdle()

VOID XboxHwIdle ( VOID  )

Definition at line 247 of file machxbox.c.

248 {
249  /* UNIMPLEMENTED */
250 }

Referenced by XboxMachInit().

◆ XboxMachInit()

VOID XboxMachInit ( const char CmdLine)

Definition at line 256 of file machxbox.c.

257 {
258  /* Set LEDs to red before anything is initialized */
259  XboxSetLED("rrrr");
260 
261  /* Initialize our stuff */
262  XboxMemInit();
263  XboxVideoInit();
264 
265  /* Setup vtbl */
282  MachVtbl.Beep = PcBeep;
294 
295  /* Set LEDs to orange after init */
296  XboxSetLED("oooo");
297 }
BOOLEAN XboxConsKbHit(VOID)
Definition: xboxcons.c:59
PCONFIGURATION_COMPONENT_DATA XboxHwDetect(VOID)
Definition: machxbox.c:226
PFREELDR_MEMORY_DESCRIPTOR(* GetMemoryMap)(PULONG MaxMemoryMapSize)
Definition: machine.h:63
VOID(* GetExtendedBIOSData)(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machine.h:64
VOID(* VideoClearScreen)(UCHAR Attr)
Definition: machine.h:45
PCONFIGURATION_COMPONENT_DATA(* HwDetect)(VOID)
Definition: machine.h:77
VOID(* VideoGetDisplaySize)(PULONG Width, PULONG Height, PULONG Depth)
Definition: machine.h:47
static UCHAR XboxGetFloppyCount(VOID)
Definition: machxbox.c:211
VOID XboxVideoCopyOffScreenBufferToVRAM(PVOID Buffer)
Definition: xboxvideo.c:205
VOID XboxVideoClearScreen(UCHAR Attr)
Definition: xboxvideo.c:104
VOID XboxConsPutChar(int c)
Definition: xboxcons.c:26
BOOLEAN(* VideoIsPaletteFixed)(VOID)
Definition: machine.h:54
UCHAR(* GetFloppyCount)(VOID)
Definition: machine.h:66
VOID XboxMemInit(VOID)
Definition: xboxmem.c:56
VOID XboxVideoSetTextCursorPosition(UCHAR X, UCHAR Y)
Definition: xboxvideo.c:193
BOOLEAN PcInitializeBootDevices(VOID)
Definition: hwdisk.c:468
VOID(* VideoGetFontsFromFirmware)(PULONG RomFontPointers)
Definition: machine.h:49
int XboxConsGetCh(void)
Definition: xboxcons.c:66
BOOLEAN(* DiskGetDriveGeometry)(UCHAR DriveNumber, PGEOMETRY DriveGeometry)
Definition: machine.h:68
VOID(* VideoSetTextCursorPosition)(UCHAR X, UCHAR Y)
Definition: machine.h:50
ULONG XboxVideoGetBufferSize(VOID)
Definition: xboxvideo.c:181
TIMEINFO *(* GetTime)(VOID)
Definition: machine.h:72
VOID XboxVideoGetFontsFromFirmware(PULONG RomFontPointers)
Definition: xboxvideo.c:187
BOOLEAN(* InitializeBootDevices)(VOID)
Definition: machine.h:76
BOOLEAN XboxDiskReadLogicalSectors(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: xboxdisk.c:413
VOID(* VideoGetPaletteColor)(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: machine.h:56
BOOLEAN XboxVideoIsPaletteFixed(VOID)
Definition: xboxvideo.c:221
PFREELDR_MEMORY_DESCRIPTOR XboxMemGetMemoryMap(ULONG *MemoryMapSize)
Definition: xboxmem.c:104
VOID XboxVideoGetDisplaySize(PULONG Width, PULONG Height, PULONG Depth)
Definition: xboxvideo.c:173
VOID XboxPrepareForReactOS(VOID)
Definition: machxbox.c:300
VOID XboxHwIdle(VOID)
Definition: machxbox.c:247
BOOLEAN(* DiskReadLogicalSectors)(UCHAR DriveNumber, ULONGLONG SectorNumber, ULONG SectorCount, PVOID Buffer)
Definition: machine.h:67
BOOLEAN(* ConsKbHit)(VOID)
Definition: machine.h:42
VOID XboxVideoSync(VOID)
Definition: xboxvideo.c:239
VOID(* VideoPutChar)(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: machine.h:52
VOID XboxVideoInit(VOID)
Definition: xboxvideo.c:131
void XboxSetLED(PCSTR pattern)
Definition: xboxi2c.c:198
VOID XboxVideoPutChar(int Ch, UCHAR Attr, unsigned X, unsigned Y)
Definition: xboxvideo.c:114
VOID(* VideoSetPaletteColor)(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: machine.h:55
VOID PcBeep(VOID)
Definition: i386rtl.c:25
VOID XboxVideoHideShowTextCursor(BOOLEAN Show)
Definition: xboxvideo.c:199
VOID(* PrepareForReactOS)(VOID)
Definition: machine.h:59
ULONG(* VideoGetBufferSize)(VOID)
Definition: machine.h:48
int(* ConsGetCh)(VOID)
Definition: machine.h:43
ULONG(* DiskGetCacheableBlockCount)(UCHAR DriveNumber)
Definition: machine.h:69
VOID(* ConsPutChar)(int Ch)
Definition: machine.h:41
BOOLEAN XboxDiskGetDriveGeometry(UCHAR DriveNumber, PGEOMETRY Geometry)
Definition: xboxdisk.c:456
MACHVTBL MachVtbl
Definition: arcemul.c:21
VOID(* HwIdle)(VOID)
Definition: machine.h:78
VOID(* VideoSync)(VOID)
Definition: machine.h:57
VOID XboxVideoSetPaletteColor(UCHAR Color, UCHAR Red, UCHAR Green, UCHAR Blue)
Definition: xboxvideo.c:227
VOID XboxVideoGetPaletteColor(UCHAR Color, UCHAR *Red, UCHAR *Green, UCHAR *Blue)
Definition: xboxvideo.c:233
VOID(* VideoCopyOffScreenBufferToVRAM)(PVOID Buffer)
Definition: machine.h:53
VIDEODISPLAYMODE(* VideoSetDisplayMode)(char *DisplayMode, BOOLEAN Init)
Definition: machine.h:46
VOID XboxGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
Definition: machxbox.c:85
VIDEODISPLAYMODE XboxVideoSetDisplayMode(char *DisplayMode, BOOLEAN Init)
Definition: xboxvideo.c:166
VOID(* Beep)(VOID)
Definition: machine.h:58
TIMEINFO * XboxGetTime(VOID)
Definition: xboxrtc.c:40
ULONG XboxDiskGetCacheableBlockCount(UCHAR DriveNumber)
Definition: xboxdisk.c:516
VOID(* VideoHideShowTextCursor)(BOOLEAN Show)
Definition: machine.h:51

Referenced by MachInit().

◆ XboxPrepareForReactOS()

VOID XboxPrepareForReactOS ( VOID  )

Definition at line 300 of file machxbox.c.

301 {
302  /* On XBOX, prepare video and turn off the floppy motor */
304  DiskStopFloppyMotor();
305 }
VOID XboxVideoPrepareForReactOS(VOID)
Definition: xboxvideo.c:252

Referenced by XboxMachInit().