O n Tue, 2014-03-25 at 12:21 -0300, Rafael Machado wrote: > Hi everyone. > > > I'm doing some tests here with the SMBios protocol, and everything > works correctly at SecMain.exe > But not on a real system. > Follow the function I'm developing > > > EFI_STATUS GetSmBiosTable(IN INT8 TableType, OUT VOID** SmBiosTable) > { > EFI_STATUS Status = EFI_SUCCESS; > EFI_GUID SMBIOSProtocolGuid = EFI_SMBIOS_PROTOCOL_GUID; > EFI_SMBIOS_PROTOCOL* SmbiosProtocol = NULL; > > > EFI_SMBIOS_HANDLE SmbiosHandle = (EFI_SMBIOS_HANDLE) 0xFFFE; > EFI_SMBIOS_TABLE_HEADER* SmbiosTableHeader = NULL; > EFI_SMBIOS_TYPE SearchTableType; > BOOLEAN TableDetected = FALSE; > SMBIOS_TABLE_TYPE13* table13 = NULL; > > > gST->ConOut->OutputString(gST->ConOut, L"GetSmBiosTable begin\r\n"); > > > SearchTableType = TableType; > > > Status = gBS->LocateProtocol(&SMBIOSProtocolGuid, > NULL, > (VOID**) &SmbiosProtocol); > if(!EFI_ERROR(Status)){ > do{ > if(SmbiosProtocol != NULL){
Try to add this. // // Point to the first entry // SmbiosHandle = SMBIOS_HANDLE_PI_RESERVED; > Status = SmbiosProtocol->GetNext(SmbiosProtocol, > &SmbiosHandle, > NULL, > &SmbiosTableHeader, > NULL); > if(EFI_ERROR(Status)){ > break; > } > > > if(SmbiosTableHeader->Type == (EFI_SMBIOS_TYPE)TableType){ > > TableDetected = TRUE; > table13 = (SMBIOS_TABLE_TYPE13 *) &SmbiosTableHeader->Type; > } > > > } > } while(!TableDetected); > } > return EFI_SUCCESS; > } > > > On the real system, I always get to the break; > Does any of you see any problem on the call to > SmbiosProtocol->GetNext ? > Also there is a question where do you want to access SmBios tables? I tried to solve some problem recently and revealed that this is implementation specific. If we look at OVMF as a reference the possible situation is: 1. MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf is a DXE driver produced gEfiSmbiosProtocolGuid is on a FFS 2. OvmfPkg/SmbiosPlatformDxe is a DXE driver consumed gEfiSmbiosProtocolGuid started after SmbiosDxe.inf loaded. Then SmbiosPlatformDxe actually adds SmBios data by calling AddTable(). So, if you are in between SmBiosDxe loaded and SmbiosPlatformDxe doesn't loaded, you are able to locate SMBIOSProtocolGuid, but SmBios data had not added yet. Looks like in case of emulator all SmBios data was already added. Hope it helps. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel