Friday, May 6, 2016

dump SMBIOS data with EfiPy

Sample code:
https://sourceforge.net/u/efipy/svn/HEAD/tree/Trunk/smbios.py

Description:
This sample uses EFI_SMBIOS_PROTOCOL, defined from EfiPy.MdePkg.Protocol.Smbios.

It requires EfiPy_r0.1.1(20289) due to
1. This version fixed error for SMBIOS Industry standard in EfiPy.MdePkg.IndustryStandard.SmBios
2. This version also changed data structure SMBIOS_TABLE_STRING to class.

Using EFI_SMBIOS_PROTOCOL protocol member function GetNext(). it has the same algorithm as EDK II driver/application. infinite while loop until return error in GetNext().


In this sample, it uses getattr() function to get SMBIOS type class defined in EfiPy.MdePkg.IndustryStandard.SmBios.

This sample also leverages the power of Python/ctypes (sample in the function StructDump()).
In this function, it does not need to know SMBIOS structure defined, it uses Python getattr() to get SMBIOS structure member name and its value.


No comments:

Post a Comment