projects
/
reactos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f75759
)
[FREELDR] Add PCI BIOS emulation and PCI bus enumeration for Xbox (#1830)
author
Stanislav Motylkov
<x86corez@gmail.com>
Fri, 16 Aug 2019 17:14:10 +0000
(20:14 +0300)
committer
Hermès BÉLUSCA - MAÏTO
<hermes.belusca-maito@reactos.org>
Fri, 16 Aug 2019 17:14:10 +0000
(19:14 +0200)
CORE-16216 CORE-16308
boot/freeldr/freeldr/arch/i386/hwpci.c
patch
|
blob
|
history
boot/freeldr/freeldr/arch/i386/machpc.c
patch
|
blob
|
history
boot/freeldr/freeldr/arch/i386/machxbox.c
patch
|
blob
|
history
boot/freeldr/freeldr/include/arch/pc/hardware.h
patch
|
blob
|
history
boot/freeldr/freeldr/include/arch/pc/machpc.h
patch
|
blob
|
history
diff --git
a/boot/freeldr/freeldr/arch/i386/hwpci.c
b/boot/freeldr/freeldr/arch/i386/hwpci.c
index
8e6062d
..
c5aa14a
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/hwpci.c
+++ b/
boot/freeldr/freeldr/arch/i386/hwpci.c
@@
-24,6
+24,8
@@
DBG_DEFAULT_CHANNEL(HWDETECT);
DBG_DEFAULT_CHANNEL(HWDETECT);
+FIND_PCI_BIOS FindPciBios = NULL;
+
static
PPCI_IRQ_ROUTING_TABLE
GetPciIrqRoutingTable(VOID)
static
PPCI_IRQ_ROUTING_TABLE
GetPciIrqRoutingTable(VOID)
@@
-75,8
+77,8
@@
GetPciIrqRoutingTable(VOID)
}
}
-
static
BOOLEAN
-FindPciBios(PPCI_REGISTRY_INFO BusData)
+BOOLEAN
+
Pc
FindPciBios(PPCI_REGISTRY_INFO BusData)
{
REGS RegsIn;
REGS RegsOut;
{
REGS RegsIn;
REGS RegsOut;
diff --git
a/boot/freeldr/freeldr/arch/i386/machpc.c
b/boot/freeldr/freeldr/arch/i386/machpc.c
index
0d17add
..
ede5441
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/machpc.c
+++ b/
boot/freeldr/freeldr/arch/i386/machpc.c
@@
-1353,6
+1353,7
@@
PcHwDetect(VOID)
// TODO: Discover and set the machine type as the Component->Identifier
GetHarddiskConfigurationData = PcGetHarddiskConfigurationData;
// TODO: Discover and set the machine type as the Component->Identifier
GetHarddiskConfigurationData = PcGetHarddiskConfigurationData;
+ FindPciBios = PcFindPciBios;
/* Detect buses */
DetectPciBios(SystemKey, &BusNumber);
/* Detect buses */
DetectPciBios(SystemKey, &BusNumber);
diff --git
a/boot/freeldr/freeldr/arch/i386/machxbox.c
b/boot/freeldr/freeldr/arch/i386/machxbox.c
index
139f571
..
4b96228
100644
(file)
--- a/
boot/freeldr/freeldr/arch/i386/machxbox.c
+++ b/
boot/freeldr/freeldr/arch/i386/machxbox.c
@@
-23,6
+23,18
@@
DBG_DEFAULT_CHANNEL(HWDETECT);
DBG_DEFAULT_CHANNEL(HWDETECT);
+BOOLEAN
+XboxFindPciBios(PPCI_REGISTRY_INFO BusData)
+{
+ /* We emulate PCI BIOS here, there are 2 known working PCI buses on an original Xbox */
+
+ BusData->NoBuses = 2;
+ BusData->MajorRevision = 1;
+ BusData->MinorRevision = 0;
+ BusData->HardwareMechanism = 1;
+ return TRUE;
+}
+
VOID
XboxGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
{
VOID
XboxGetExtendedBIOSData(PULONG ExtendedBIOSDataArea, PULONG ExtendedBIOSDataSize)
{
@@
-175,8
+187,10
@@
XboxHwDetect(VOID)
FldrCreateSystemKey(&SystemKey);
GetHarddiskConfigurationData = XboxGetHarddiskConfigurationData;
FldrCreateSystemKey(&SystemKey);
GetHarddiskConfigurationData = XboxGetHarddiskConfigurationData;
+ FindPciBios = XboxFindPciBios;
/* TODO: Build actual xbox's hardware configuration tree */
/* TODO: Build actual xbox's hardware configuration tree */
+ DetectPciBios(SystemKey, &BusNumber);
DetectIsaBios(SystemKey, &BusNumber);
TRACE("DetectHardware() Done\n");
DetectIsaBios(SystemKey, &BusNumber);
TRACE("DetectHardware() Done\n");
diff --git
a/boot/freeldr/freeldr/include/arch/pc/hardware.h
b/boot/freeldr/freeldr/include/arch/pc/hardware.h
index
76a9bb5
..
bc6aad1
100644
(file)
--- a/
boot/freeldr/freeldr/include/arch/pc/hardware.h
+++ b/
boot/freeldr/freeldr/include/arch/pc/hardware.h
@@
-38,6
+38,12
@@
PCM_PARTIAL_RESOURCE_LIST
extern GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData;
extern GET_HARDDISK_CONFIG_DATA GetHarddiskConfigurationData;
+typedef
+BOOLEAN
+(*FIND_PCI_BIOS)(PPCI_REGISTRY_INFO BusData);
+
+extern FIND_PCI_BIOS FindPciBios;
+
VOID
DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
PCONFIGURATION_COMPONENT_DATA BusKey);
VOID
DetectBiosDisks(PCONFIGURATION_COMPONENT_DATA SystemKey,
PCONFIGURATION_COMPONENT_DATA BusKey);
diff --git
a/boot/freeldr/freeldr/include/arch/pc/machpc.h
b/boot/freeldr/freeldr/include/arch/pc/machpc.h
index
fb8284f
..
e07eab2
100644
(file)
--- a/
boot/freeldr/freeldr/include/arch/pc/machpc.h
+++ b/
boot/freeldr/freeldr/include/arch/pc/machpc.h
@@
-49,6
+49,7
@@
VOID PcVideoPrepareForReactOS(VOID);
VOID PcPrepareForReactOS(VOID);
PFREELDR_MEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize);
VOID PcPrepareForReactOS(VOID);
PFREELDR_MEMORY_DESCRIPTOR PcMemGetMemoryMap(ULONG *MemoryMapSize);
+BOOLEAN PcFindPciBios(PPCI_REGISTRY_INFO BusData);
BOOLEAN DiskResetController(UCHAR DriveNumber);
BOOLEAN DiskGetExtendedDriveParameters(UCHAR DriveNumber, PVOID Buffer, USHORT BufferSize);
BOOLEAN DiskResetController(UCHAR DriveNumber);
BOOLEAN DiskGetExtendedDriveParameters(UCHAR DriveNumber, PVOID Buffer, USHORT BufferSize);