but first step, RSDP could not found.
Here is my implementation.
Code: Select all
struct SRootSystemDescriptionPointer
{
achar_t mSignature[8];
uint8_t mChecksum;
achar_t mOemId[6];
uint8_t mRevision;
uint32_t mRsdtAddress;
SRootSystemDescriptionTableHeader* GetRsdt() const
{
return reinterpret_cast<SRootSystemDescriptionTableHeader*>(mRsdtAddress);
}
bool IsValid() const
{
if (CMemory::Equals(mSignature, "RSD PTR ", 8))
{
const int8_t* lBytes = reinterpret_cast<const int8_t*>(this);
int32_t lCheck(0);
for (size_t i = 0; i < sizeof(SRootSystemDescriptionPointer); i++)
{
lCheck += lBytes[i];
}
if (0 == lCheck)
{
return true;
//return GetRsdt()->CheckSignature("RSDT");
}
}
return false;
}
};
static void Initialize()
{
if (nullptr == msRsdp)
{
for (uint32_t i = 0x000E0000; i < 0x000FFFFF; i += 16)
{
SRootSystemDescriptionPointer* lRsdp = reinterpret_cast<SRootSystemDescriptionPointer*>(i);
if (lRsdp->IsValid())
{
msRsdp = lRsdp;
break;
}
}
if (nullptr == msRsdp)
{
// word[0x40:0x0E]
uint32_t lEbda = *(reinterpret_cast<uint16_t*>(0x40E));
lEbda = (lEbda * 16) & 0x000FFFFF;
for (size_t i = 0; i < 4096; i += 16)
{
SRootSystemDescriptionPointer* lRsdp = reinterpret_cast<SRootSystemDescriptionPointer*>(lEbda + i);
if (lRsdp->IsValid())
{
msRsdp = lRsdp;
break;
}
}
}
}
}
I think, searching range is not correct.
or
My machine do not support ACPI.
My machine is VMware.
If it do not support, what do I use instead of that?
Thanks!