Skip to content

Commit

Permalink
aight
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkFire01 committed Oct 3, 2024
1 parent 2dbcc93 commit 608d7f4
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 13 deletions.
77 changes: 75 additions & 2 deletions boot/freeldr/freeldr/arch/uefi/uefihw.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,49 @@ DetectIsaBios(PCONFIGURATION_COMPONENT_DATA SystemKey, ULONG *BusNumber)
/* FIXME: Detect more ISA devices */
}

NTSTATUS
EfipGetSystemTable (
_In_ EFI_GUID *TableGuid,
_Out_ PPHYSICAL_ADDRESS TableAddress
)
{
ULONG i;
NTSTATUS Status;

/* Assume failure */
Status = STATUS_NOT_FOUND;

/* Loop through the configuration tables */
for (i = 0; i < GlobalSystemTable->NumberOfTableEntries; i++)
{
/* Check if this one matches the one we want */
if (RtlEqualMemory(&GlobalSystemTable->ConfigurationTable[i].VendorGuid,
TableGuid,
sizeof(*TableGuid)))
{
/* Return its address */
TableAddress->QuadPart = (ULONG_PTR)GlobalSystemTable->ConfigurationTable[i].VendorTable;
Status = STATUS_SUCCESS;
printf("success %X ", TableGuid[0]);
break;
}
}

printf("failed %X ", TableGuid[0]);
/* Return the search result */
return Status;
}

#define SMBIOS3_TABLE_GUID \
{ \
0xf2fd1544, 0x9794, 0x4a2c, {0x99, 0x2e, 0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94 } \
}

#define SMBIOS_TABLE_GUID \
{ \
0xeb9d2d31, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}

PLOADER_PARAMETER_BLOCK PubLoaderBlock;
static
PRSDP_DESCRIPTOR
Expand Down Expand Up @@ -825,9 +868,39 @@ FindAcpiBios(VOID)
/* Check if FreeLdr detected a ACPI table */
/* Set the pointer to something for compatibility */
Extension->AcpiTable = (PVOID)rsdp;
// FIXME: Extension->AcpiTableSize;



EFI_GUID TestGuidTwo = SMBIOS_TABLE_GUID;
EFI_GUID TestGuid = SMBIOS3_TABLE_GUID;
for (i = 0; i < GlobalSystemTable->NumberOfTableEntries; i++)
{
if (!memcmp(&GlobalSystemTable->ConfigurationTable[i].VendorGuid,
&TestGuid, sizeof(TestGuid)))
{
(PVOID)GlobalSystemTable->ConfigurationTable[i].VendorTable;
break;
}
}

if (GlobalSystemTable->ConfigurationTable[i].VendorTable == 0)

{
for (i = 0; i < GlobalSystemTable->NumberOfTableEntries; i++)
{
if (!memcmp(&GlobalSystemTable->ConfigurationTable[i].VendorGuid,
&TestGuidTwo, sizeof(TestGuidTwo)))
{
(PVOID)GlobalSystemTable->ConfigurationTable[i].VendorTable;
break;
}
}
}


// FIXME: Extension->AcpiTableSize;
Extension->SmBios = (PVOID) GlobalSystemTable->ConfigurationTable[i].VendorTable;

return rsdp;
}

Expand Down Expand Up @@ -1124,7 +1197,7 @@ UefiHwDetect(
DetectAcpiBios(SystemKey, &BusNumber);
DetectInternal(SystemKey, &BusNumber);

DetectPci(SystemKey, &BusNumber);
// DetectPci(SystemKey, &BusNumber);
DetectIsaBios(SystemKey, &BusNumber);
TRACE("DetectHardware() Done\n");
return SystemKey;
Expand Down
6 changes: 3 additions & 3 deletions boot/freeldr/freeldr/lib/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#if DBG

// #define DEBUG_ALL
// #define DEBUG_WARN
// #define DEBUG_ERR
#define DEBUG_WARN
#define DEBUG_ERR
// #define DEBUG_INIFILE
// #define DEBUG_REACTOS
// #define DEBUG_CUSTOM
Expand All @@ -40,7 +40,7 @@ static UCHAR DbgChannels[DBG_CHANNELS_COUNT];

#define BOCHS_OUTPUT_PORT 0xE9

ULONG DebugPort = RS232;
ULONG DebugPort = SCREEN;

/* Serial debug connection */
#if defined(SARCH_PC98)
Expand Down
1 change: 0 additions & 1 deletion hal/halx86/acpi/halacpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ extern PLOADER_PARAMETER_BLOCK LocLoaderBlock;
UINT64 NTAPI
HalpGetAcpiTables()
{
__debugbreak();
return (UINT64)LocLoaderBlock->Extension->AcpiTable;
}

Expand Down
12 changes: 6 additions & 6 deletions hal/halx86/apic/apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ ULONG
IOApicRead(UCHAR Register)
{
/* Select the register, then do the read */
ASSERT(Register <= 0x3F);
DPRINT1("Register <= 0x3F");
WRITE_REGISTER_ULONG((PULONG)(IOAPIC_BASE + IOAPIC_IOREGSEL), Register);
return READ_REGISTER_ULONG((PULONG)(IOAPIC_BASE + IOAPIC_IOWIN));
}
Expand All @@ -104,7 +104,7 @@ VOID
IOApicWrite(UCHAR Register, ULONG Value)
{
/* Select the register, then do the write */
ASSERT(Register <= 0x3F);
DPRINT1("Register <= 0x3F");
WRITE_REGISTER_ULONG((PULONG)(IOAPIC_BASE + IOAPIC_IOREGSEL), Register);
WRITE_REGISTER_ULONG((PULONG)(IOAPIC_BASE + IOAPIC_IOWIN), Value);
}
Expand All @@ -115,7 +115,7 @@ ApicWriteIORedirectionEntry(
UCHAR Index,
IOAPIC_REDIRECTION_REGISTER ReDirReg)
{
ASSERT(Index < APIC_MAX_IRQ);
DPRINT1("Index < APIC_MAX_IRQ");
IOApicWrite(IOAPIC_REDTBL + 2 * Index, ReDirReg.Long0);
IOApicWrite(IOAPIC_REDTBL + 2 * Index + 1, ReDirReg.Long1);
}
Expand All @@ -127,7 +127,7 @@ ApicReadIORedirectionEntry(
{
IOAPIC_REDIRECTION_REGISTER ReDirReg;

ASSERT(Index < APIC_MAX_IRQ);
DPRINT1("Index < APIC_MAX_IRQ");
ReDirReg.Long0 = IOApicRead(IOAPIC_REDTBL + 2 * Index);
ReDirReg.Long1 = IOApicRead(IOAPIC_REDTBL + 2 * Index + 1);

Expand Down Expand Up @@ -371,8 +371,8 @@ HalpAllocateSystemInterrupt(
{
IOAPIC_REDIRECTION_REGISTER ReDirReg;

ASSERT(Irq < APIC_MAX_IRQ);
ASSERT(HalpVectorToIndex[Vector] == APIC_FREE_VECTOR);
DPRINT1("Irq < APIC_MAX_IRQ");
DPRINT1("HalpVectorToIndex[Vector] == APIC_FREE_VECTOR");

/* Setup a redirection entry */
ReDirReg.Vector = Vector;
Expand Down
9 changes: 8 additions & 1 deletion ntoskrnl/wmi/smbios.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ WmipGetRawSMBiosTableData(
ULONG64 TableAddress = 0;

/* This is where the range for the entry point starts */
PhysicalAddress.QuadPart = 0xF0000;
if (KeLoaderBlock->Extension->SmBios == 0)
{
PhysicalAddress.QuadPart = 0xF0000;
}
else
{
PhysicalAddress.QuadPart = (LONGLONG)KeLoaderBlock->Extension->SmBios;
}

/* Map the range into the system address space */
EntryPointMapping = MmMapIoSpace(PhysicalAddress, SearchSize, MmCached);
Expand Down
1 change: 1 addition & 0 deletions sdk/include/reactos/arc/arc.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ typedef struct _LOADER_PARAMETER_EXTENSION
ULONG_PTR LoaderPagesSpanned; /* Not anymore present starting NT 6.2 */
PHEADLESS_LOADER_BLOCK HeadlessLoaderBlock;
PSMBIOS_TABLE_HEADER SMBiosEPSHeader;
PVOID SmBios;
PVOID DrvDBImage;
ULONG DrvDBSize;
PNETWORK_LOADER_BLOCK NetworkLoaderBlock;
Expand Down

0 comments on commit 608d7f4

Please sign in to comment.