Skip to content

Commit 7b044e9

Browse files
revert all unnecessary changes from random branches
1 parent 4fb7bd5 commit 7b044e9

File tree

13 files changed

+142
-1059
lines changed

13 files changed

+142
-1059
lines changed

boot/freeldr/freeldr/arch/i386/hwapm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ DetectApmBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
6363
return;
6464
}
6565
RtlZeroMemory(PartialResourceList, Size);
66-
PartialResourceList->Version = ARC_VERSION;
67-
PartialResourceList->Revision = ARC_REVISION;
66+
PartialResourceList->Version = 0;
67+
PartialResourceList->Revision = 0;
6868
PartialResourceList->Count = 0;
6969

7070
/* FIXME: Add configuration data */

boot/freeldr/freeldr/arch/i386/hwpci.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ GetPciIrqRoutingTable(VOID)
7575
return NULL;
7676
}
7777

78+
7879
BOOLEAN
7980
PcFindPciBios(PPCI_REGISTRY_INFO BusData)
8081
{
@@ -110,6 +111,7 @@ PcFindPciBios(PPCI_REGISTRY_INFO BusData)
110111
return FALSE;
111112
}
112113

114+
113115
static
114116
VOID
115117
DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
@@ -125,7 +127,7 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
125127
{
126128
TRACE("Table size: %u\n", Table->TableSize);
127129

128-
// Set 'Configuration Data' value
130+
/* Set 'Configuration Data' value */
129131
Size = FIELD_OFFSET(CM_PARTIAL_RESOURCE_LIST, PartialDescriptors) +
130132
2 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) + Table->TableSize;
131133
PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
@@ -135,10 +137,10 @@ DetectPciIrqRoutingTable(PCONFIGURATION_COMPONENT_DATA BusKey)
135137
return;
136138
}
137139

138-
// Initialize resource descriptor
140+
/* Initialize resource descriptor */
139141
RtlZeroMemory(PartialResourceList, Size);
140-
PartialResourceList->Version = ARC_VERSION;
141-
PartialResourceList->Revision = ARC_REVISION;
142+
PartialResourceList->Version = 1;
143+
PartialResourceList->Revision = 1;
142144
PartialResourceList->Count = 2;
143145

144146
PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
@@ -210,6 +212,7 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
210212

211213
/* Increment bus number */
212214
(*BusNumber)++;
215+
213216
DetectPciIrqRoutingTable(BiosKey);
214217

215218
/* Report PCI buses */
@@ -265,8 +268,8 @@ DetectPciBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
265268
FldrCreateComponentKey(SystemKey,
266269
AdapterClass,
267270
MultiFunctionAdapter,
268-
0x0,
269-
0x0,
271+
0,
272+
0,
270273
0xFFFFFFFF,
271274
"PCI",
272275
PartialResourceList,

boot/freeldr/freeldr/arch/i386/pc/machpc.c

Lines changed: 24 additions & 191 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
#include <freeldr.h>
2020
#include <cportlib/cportlib.h>
21-
#include <drivers/bootvid/framebuf.h>
2221

2322
#include "../ntldr/ntldropts.h"
2423

@@ -150,10 +149,9 @@ PcGetHarddiskConfigurationData(UCHAR DriveNumber, ULONG* pSize)
150149
}
151150

152151
RtlZeroMemory(PartialResourceList, Size);
153-
PartialResourceList->Version = ARC_VERSION;
154-
PartialResourceList->Revision = ARC_REVISION;
152+
PartialResourceList->Version = 1;
153+
PartialResourceList->Revision = 1;
155154
PartialResourceList->Count = 1;
156-
157155
PartialResourceList->PartialDescriptors[0].Type =
158156
CmResourceTypeDeviceSpecific;
159157
// PartialResourceList->PartialDescriptors[0].ShareDisposition =
@@ -216,8 +214,8 @@ DetectDockingStation(
216214

217215
/* Initialize resource descriptor */
218216
RtlZeroMemory(PartialResourceList, Size);
219-
PartialResourceList->Version = ARC_VERSION;
220-
PartialResourceList->Revision = ARC_REVISION;
217+
PartialResourceList->Version = 0;
218+
PartialResourceList->Revision = 0;
221219
PartialResourceList->Count = 1;
222220

223221
/* Set device specific data */
@@ -316,10 +314,9 @@ DetectPnpBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
316314

317315
/* Initialize resource descriptor */
318316
RtlZeroMemory(PartialResourceList, Size);
319-
PartialResourceList->Version = ARC_VERSION;
320-
PartialResourceList->Revision = ARC_REVISION;
317+
PartialResourceList->Version = 1;
318+
PartialResourceList->Revision = 1;
321319
PartialResourceList->Count = 1;
322-
323320
PartialResourceList->PartialDescriptors[0].Type =
324321
CmResourceTypeDeviceSpecific;
325322
PartialResourceList->PartialDescriptors[0].ShareDisposition =
@@ -701,8 +698,8 @@ DetectSerialPointerPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey,
701698
}
702699

703700
RtlZeroMemory(PartialResourceList, Size);
704-
PartialResourceList->Version = ARC_VERSION;
705-
PartialResourceList->Revision = ARC_REVISION;
701+
PartialResourceList->Version = 1;
702+
PartialResourceList->Revision = 1;
706703
PartialResourceList->Count = 0;
707704

708705
/* Create 'PointerPeripheral' key */
@@ -836,8 +833,8 @@ DetectSerialPorts(
836833

837834
/* Initialize resource descriptor */
838835
RtlZeroMemory(PartialResourceList, Size);
839-
PartialResourceList->Version = ARC_VERSION;
840-
PartialResourceList->Revision = ARC_REVISION;
836+
PartialResourceList->Version = 1;
837+
PartialResourceList->Revision = 1;
841838
PartialResourceList->Count = 3;
842839

843840
/* Set IO Port */
@@ -942,8 +939,8 @@ DetectParallelPorts(PCONFIGURATION_COMPONENT_DATA BusKey)
942939

943940
/* Initialize resource descriptor */
944941
RtlZeroMemory(PartialResourceList, Size);
945-
PartialResourceList->Version = ARC_VERSION;
946-
PartialResourceList->Revision = ARC_REVISION;
942+
PartialResourceList->Version = 1;
943+
PartialResourceList->Revision = 1;
947944
PartialResourceList->Count = (Irq[i] != (ULONG) - 1) ? 2 : 1;
948945

949946
/* Set IO Port */
@@ -1080,8 +1077,8 @@ DetectKeyboardPeripheral(PCONFIGURATION_COMPONENT_DATA ControllerKey)
10801077

10811078
/* Initialize resource descriptor */
10821079
RtlZeroMemory(PartialResourceList, Size);
1083-
PartialResourceList->Version = ARC_VERSION;
1084-
PartialResourceList->Revision = ARC_REVISION;
1080+
PartialResourceList->Version = 1;
1081+
PartialResourceList->Revision = 1;
10851082
PartialResourceList->Count = 1;
10861083

10871084
PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
@@ -1140,8 +1137,8 @@ DetectKeyboardController(PCONFIGURATION_COMPONENT_DATA BusKey)
11401137

11411138
/* Initialize resource descriptor */
11421139
RtlZeroMemory(PartialResourceList, Size);
1143-
PartialResourceList->Version = ARC_VERSION;
1144-
PartialResourceList->Revision = ARC_REVISION;
1140+
PartialResourceList->Version = 1;
1141+
PartialResourceList->Revision = 1;
11451142
PartialResourceList->Count = 3;
11461143

11471144
/* Set Interrupt */
@@ -1318,8 +1315,8 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
13181315

13191316
/* Initialize resource descriptor */
13201317
RtlZeroMemory(PartialResourceList, sizeof(CM_PARTIAL_RESOURCE_LIST));
1321-
PartialResourceList->Version = ARC_VERSION;
1322-
PartialResourceList->Revision = ARC_REVISION;
1318+
PartialResourceList->Version = 1;
1319+
PartialResourceList->Revision = 1;
13231320
PartialResourceList->Count = 1;
13241321

13251322
/* Set Interrupt */
@@ -1357,8 +1354,8 @@ DetectPS2Mouse(PCONFIGURATION_COMPONENT_DATA BusKey)
13571354
}
13581355

13591356
RtlZeroMemory(PartialResourceList, Size);
1360-
PartialResourceList->Version = ARC_VERSION;
1361-
PartialResourceList->Revision = ARC_REVISION;
1357+
PartialResourceList->Version = 1;
1358+
PartialResourceList->Revision = 1;
13621359
PartialResourceList->Count = 0;
13631360

13641361
/* Create peripheral key */
@@ -1584,15 +1581,7 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
15841581
{
15851582
PCSTR Identifier;
15861583
PCONFIGURATION_COMPONENT_DATA ControllerKey;
1587-
PCONFIGURATION_COMPONENT_DATA PeripheralKey;
15881584
USHORT VesaVersion;
1589-
PCM_FRAMEBUF_DEVICE_DATA FramebufferData;
1590-
// PMONITOR_CONFIGURATION_DATA MonitorData;
1591-
PCM_MONITOR_DEVICE_DATA MonitorData;
1592-
1593-
PCM_PARTIAL_RESOURCE_LIST PartialResourceList;
1594-
PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
1595-
ULONG Size;
15961585

15971586
/* FIXME: Set 'ComponentInformation' value */
15981587

@@ -1613,68 +1602,15 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
16131602
else
16141603
Identifier = "VGA Display";
16151604

1616-
1617-
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
1618-
1 * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR) +
1619-
sizeof(CM_FRAMEBUF_DEVICE_DATA);
1620-
PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1621-
if (PartialResourceList == NULL)
1622-
{
1623-
ERR("Failed to allocate resource descriptor\n");
1624-
return;
1625-
}
1626-
1627-
/* Initialize resource descriptor */
1628-
RtlZeroMemory(PartialResourceList, Size);
1629-
PartialResourceList->Version = ARC_VERSION;
1630-
PartialResourceList->Revision = ARC_REVISION;
1631-
PartialResourceList->Count = 2;
1632-
1633-
/* Set Memory */
1634-
PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1635-
PartialDescriptor->Type = CmResourceTypeMemory;
1636-
PartialDescriptor->ShareDisposition = CmResourceShareDeviceExclusive;
1637-
PartialDescriptor->Flags = CM_RESOURCE_MEMORY_READ_WRITE;
1638-
PartialDescriptor->u.Memory.Start.LowPart = (ULONG_PTR)0xA0000;
1639-
PartialDescriptor->u.Memory.Length = 256*1024;
1640-
1641-
/* Set framebuffer-specific data */
1642-
PartialDescriptor = &PartialResourceList->PartialDescriptors[1];
1643-
PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
1644-
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1645-
PartialDescriptor->Flags = 0;
1646-
PartialDescriptor->u.DeviceSpecificData.DataSize =
1647-
sizeof(CM_FRAMEBUF_DEVICE_DATA);
1648-
1649-
/* Get pointer to framebuffer-specific data */
1650-
FramebufferData = (PVOID)(PartialDescriptor + 1);
1651-
RtlZeroMemory(FramebufferData, sizeof(*FramebufferData));
1652-
FramebufferData->Version = 2;
1653-
FramebufferData->Revision = 0;
1654-
1655-
FramebufferData->VideoClock = 0; // FIXME: Use EDID
1656-
1657-
/* Horizontal and Vertical resolution in pixels */
1658-
FramebufferData->ScreenWidth = 640;
1659-
FramebufferData->ScreenHeight = 480;
1660-
1661-
/* Number of pixel elements per video memory line */
1662-
FramebufferData->PixelsPerScanLine = 640;
1663-
1664-
/* Physical format of the pixel */
1665-
FramebufferData->BitsPerPixel = 16;
1666-
RtlZeroMemory(&FramebufferData->PixelInformation,
1667-
sizeof(FramebufferData->PixelInformation));
1668-
16691605
FldrCreateComponentKey(BusKey,
16701606
ControllerClass,
16711607
DisplayController,
16721608
Output | ConsoleOut,
16731609
0,
16741610
0xFFFFFFFF,
16751611
Identifier,
1676-
PartialResourceList,
1677-
Size,
1612+
NULL,
1613+
0,
16781614
&ControllerKey);
16791615

16801616
/* FIXME: Add display peripheral (monitor) data */
@@ -1689,109 +1625,6 @@ DetectDisplayController(PCONFIGURATION_COMPONENT_DATA BusKey)
16891625
}
16901626
}
16911627
}
1692-
1693-
#if 0 // Using "old" configuration data
1694-
1695-
Size = sizeof(MONITOR_CONFIGURATION_DATA);
1696-
MonitorData = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1697-
if (MonitorData == NULL)
1698-
{
1699-
ERR("Failed to allocate resource descriptor\n");
1700-
return;
1701-
}
1702-
1703-
RtlZeroMemory(MonitorData, sizeof(MonitorData));
1704-
MonitorData->HorizontalResolution = 1024;
1705-
MonitorData->HorizontalDisplayTime = 16000;
1706-
MonitorData->HorizontalBackPorch = 2000;
1707-
MonitorData->HorizontalFrontPorch = 1000;
1708-
MonitorData->HorizontalSync = 1500;
1709-
MonitorData->VerticalResolution = 768;
1710-
MonitorData->VerticalBackPorch = 39;
1711-
MonitorData->VerticalFrontPorch = 1;
1712-
MonitorData->VerticalSync = 1;
1713-
MonitorData->HorizontalScreenSize = 343;
1714-
MonitorData->VerticalScreenSize = 274;
1715-
1716-
FldrCreateComponentKey(ControllerKey,
1717-
PeripheralClass,
1718-
MonitorPeripheral,
1719-
Output | ConsoleOut,
1720-
0,
1721-
0xFFFFFFFF,
1722-
"1024x768",
1723-
(PCM_PARTIAL_RESOURCE_LIST)MonitorData, // Pointer to MONITOR_CONFIGURATION_DATA
1724-
Size,
1725-
&PeripheralKey);
1726-
1727-
#else // Using "new" configuration list
1728-
1729-
Size = sizeof(CM_PARTIAL_RESOURCE_LIST) +
1730-
sizeof(CM_MONITOR_DEVICE_DATA);
1731-
PartialResourceList = FrLdrHeapAlloc(Size, TAG_HW_RESOURCE_LIST);
1732-
if (PartialResourceList == NULL)
1733-
{
1734-
ERR("Failed to allocate resource descriptor\n");
1735-
return;
1736-
}
1737-
1738-
/* Initialize resource descriptor */
1739-
RtlZeroMemory(PartialResourceList, Size);
1740-
PartialResourceList->Version = 1;
1741-
PartialResourceList->Revision = 1;
1742-
PartialResourceList->Count = 1;
1743-
1744-
/* Set monitor-specific data */
1745-
PartialDescriptor = &PartialResourceList->PartialDescriptors[0];
1746-
PartialDescriptor->Type = CmResourceTypeDeviceSpecific;
1747-
PartialDescriptor->ShareDisposition = CmResourceShareUndetermined;
1748-
PartialDescriptor->Flags = 0;
1749-
PartialDescriptor->u.DeviceSpecificData.DataSize =
1750-
sizeof(CM_MONITOR_DEVICE_DATA);
1751-
1752-
1753-
/* Get pointer to geometry data */
1754-
MonitorData = (PVOID)(((ULONG_PTR)PartialResourceList) + sizeof(CM_PARTIAL_RESOURCE_LIST));
1755-
1756-
MonitorData->Version = 2;
1757-
MonitorData->Revision = 0;
1758-
MonitorData->HorizontalScreenSize = 343;
1759-
MonitorData->VerticalScreenSize = 274;
1760-
MonitorData->HorizontalResolution = 1024;
1761-
MonitorData->VerticalResolution = 768;
1762-
MonitorData->HorizontalDisplayTimeLow = 0;
1763-
MonitorData->HorizontalDisplayTime = 16000;
1764-
MonitorData->HorizontalDisplayTimeHigh = 0;
1765-
MonitorData->HorizontalBackPorchLow = 0;
1766-
MonitorData->HorizontalBackPorch = 2000;
1767-
MonitorData->HorizontalBackPorchHigh = 0;
1768-
MonitorData->HorizontalFrontPorchLow = 0;
1769-
MonitorData->HorizontalFrontPorch = 1000;
1770-
MonitorData->HorizontalFrontPorchHigh = 0;
1771-
MonitorData->HorizontalSyncLow = 0;
1772-
MonitorData->HorizontalSync = 1500;
1773-
MonitorData->HorizontalSyncHigh = 0;
1774-
MonitorData->VerticalBackPorchLow = 0;
1775-
MonitorData->VerticalBackPorch = 39;
1776-
MonitorData->VerticalBackPorchHigh = 0;
1777-
MonitorData->VerticalFrontPorchLow = 0;
1778-
MonitorData->VerticalFrontPorch = 1;
1779-
MonitorData->VerticalFrontPorchHigh = 0;
1780-
MonitorData->VerticalSyncLow = 0;
1781-
MonitorData->VerticalSync = 1;
1782-
MonitorData->VerticalSyncHigh = 0;
1783-
1784-
FldrCreateComponentKey(ControllerKey,
1785-
PeripheralClass,
1786-
MonitorPeripheral,
1787-
Output | ConsoleOut,
1788-
0,
1789-
0xFFFFFFFF,
1790-
"1024x768",
1791-
PartialResourceList,
1792-
Size,
1793-
&PeripheralKey);
1794-
#endif
17951628
}
17961629

17971630
static
@@ -1817,8 +1650,8 @@ DetectIsaBios(
18171650

18181651
/* Initialize resource descriptor */
18191652
RtlZeroMemory(PartialResourceList, Size);
1820-
PartialResourceList->Version = ARC_VERSION;
1821-
PartialResourceList->Revision = ARC_REVISION;
1653+
PartialResourceList->Version = 1;
1654+
PartialResourceList->Revision = 1;
18221655
PartialResourceList->Count = 0;
18231656

18241657
/* Create new bus key */

0 commit comments

Comments
 (0)