Hi,
Just curious, but how big is an "unsigned short" for your compiler (are you sure the value 0xf0fffL will fit)?
In any case, you might want to try something like:
Code: Select all
void search_for_smbios(void) {
void *temp;
for(temp=(void *)SEARCH_START;temp<=(void *)(SEARCH_START+SEARCH_LEN);temp += 16) {
smbios=(_smbios *)temp;
if(smbios->Anchor[3]=="_SM_") {
kprintf("SMBIOS ANCHOR Found.\n");
if(smbios->_DMI_[4]=="_DMI_")
kprintf("_DMI_ Signature present.");
return;
}
}
}
I'm not sure if the compiler will actually accept this though - getting typecasts right is a little tricky when you're an assembly programmer, and I'm not sure if pointer arithmetic works on all C compilers...
KieranFoot wrote:if im right you start searching from 0xf0000L to 0xf0000L + 0xFFFL and if you fing the signature "_SM_" youve foind it...
You might want to double check this too - my copy of the specification says that the SMBIOS Structure Entry Point is on a 16 byte boundary within the area from 0x000F0000 to 0x000FFFFF (not from 0x000F0000 to 0x000F0FFF).
kataklinger wrote:These two compare addresses of strings. You need something like this
:
if( !strcmp( smbios->Anchor[3], "_SM_" ) )
and
if( !strcmp( smbios->_DMI_[4], "_DMI_" ) )
This makes my eyes bleed ::). Is there a way to do something like
cmp [esi+offset], '_SM_' in C?
Cheers,
Brendan