废话不多说 直接code
#include <Uefi.h>
#include <Library/UefiLib.h>
//#include <Library/ShellCEntryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
#include <Protocol/UsbIo.h>
#include <Protocol/AmiUsbController.h>
#include <AmiLib.h>
#include <AmiDxeLib.h>
#include <AmiDxeLib.h>
#include <Protocol/Smbios.h>
#include "EfiKey.h"
#include <Uefi.h>
#include <Library/UefiLib.h>
#include <IndustryStandard/SmBios.h>
//#include <Library/UefiShellDebug1CommandsLib.h>
//#include <Library/LibSmbiosView.h>
extern EFI_BOOT_SERVICES *gBS;
extern EFI_HANDLE gImageHandle;
#if 1
//*************************************************************************
//<AMI_PHDR_START>
//
// Name: Sprintf
//
// Description:
// UINTN Sprintf(OUT CHAR8 *Buffer, IN CHAR8 *Format, IN ...) produces a
// null-terminated ASCII string in the output Buffer. The ASCII string is
// produced by parsing the format string specified by Format. Arguments are
// pulled from the variable argument list based on the contents of the format
// string. The number of ASCII characters in the produced output buffer is
// returned, not including the null-terminator. See notes for format string
// information.
//
// Input:
// OUT CHAR8 *Buffer
// Pointer to a null-terminated output ASCII string buffer. User is
// responsible for allocating the necessary memory resources!
//
// IN CHAR8 *Format
// Pointer to a null-terminated format ASCII string.
//
// IN ...
// Variable argument list which provides the data/variables used within the
// format string.
//
// Output:
// UINTN number of ASCII characters in the produced output buffer, not
// including the null-terminator.
//
// Modified:
//
// Referrals:
// va_start
// Sprintf_va_list
// va_end
//
// Notes:
// Objects inside the format string have the following syntax.
// %[flags][width]type
//
// *** [flags] ***
//
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// . Flag . Description
// . .
// . - . The field is left justified. If flag is not specified, then
// . . the field is right justified.
// . .
// . space . Prefix a space character to a number. Only valid for types X,
// . . x, and d.
// . .
// . + . Prefix a plus character to a number. Only valid for types X,
// . . x, and d. If both space and `+' are specified, then space is
// . . ignored.
// . .
// . 0 . Pad with `0' characters to the left of a number. Only valid
// . . for types X, x, and d.
// . .
// . L, l . The number being printed is a UINT64. Only valid for types X,
// . . x, and d. If this flag is not specified, then the number being
// . . printed is an int.
// . .
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
//
// NOTE
// All invalid [flags] are ignored.
//
// *** [width] ***
//
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
// . Width . Description
// . .
// . * . The width of the field is specifi

本文深入探讨了UEFI环境中SMBIOS信息的获取与解析过程,详细介绍了如何使用EFI_BOOT_SERVICES和EFI_SYSTEM_TABLE来定位并读取SMBIOS表。通过具体的代码示例,展示了SMBIOS字符串的获取方法及SMBIOS结构的遍历技巧。
最低0.47元/天 解锁文章
1193

被折叠的 条评论
为什么被折叠?



