wel.. I'm trying to parse the ACPI tables to identify the CPUs.. wel.. It's been a while since i coded in C n I'm kinda rusted... It would be great if some1 could help me correct this code.. it tries to look for the RSDP structure... i know it's somethin wrong wit my usage of pointers or my jus my ignorance.. your help will be appreciated..
Code: Select all
struct RSDPDescriptor {
char Signature[8];
char Checksum;
char OEMID[6];
char Revision;
unsigned int RsdtAddress;
unsigned int Length;
double XsdtAddress;
char ExtendedChecksum;
char reserved[3];
};
k_main() // like main in a normal C program
{
int i =0;
char *address = (char *)0x0000040E;
struct RSDPDescriptor *rsdp;
for(i=0;i<1024;i+=16)
{
rsdp = (struct RSDPDescriptor *)(address + i);
if(mystrcmp((*rsdp).Signature,"RSD PTR ") == 0)
{
k_printf("Found RSDP1",8);
}
}
char *address2 = (char *)0x0E0000;
while(address2<=0x0FFFFF)
{
rsdp = (struct RSDPDescriptor *)address2;
if((*rsdp).Signature == "RSD PTR ")
{
k_printf("Found RSDP2",9);
}
address2 += 16;
}
k_printf("Not Found",10);
}