Skip to content

RRUZ/tsmbios

Repository files navigation

tsmbios

Features

  • Supports SMBIOS Version 2.1 to 3.9.
  • Compatible with Delphi 5 through Delphi 13 Florence.
  • Fully documented (XMLDoc), compatible with the Help Insight feature, available since Delphi 2005.
  • Works with FPC 2.4.0 or later.
  • Supports Windows and Linux.
  • Can read SMBIOS data from remote machines using WMI.
  • Exposes the SMBIOS 3.x fixed-layout fields added to the supported table types, including BIOS ROM size, processor core/thread counts, cache sizes, system slot bus data, and memory device technology, firmware, persistent memory, speed, PMIC, and RCD data.

SMBIOS Tables supported

SMBIOS Table
BIOS Information (Type 0) Delphi FPC C++ Builder
System Information (Type 1) Delphi FPC C++ Builder
Baseboard (or Module) Information (Type 2) Delphi FPC C++ Builder
System Enclosure or Chassis (Type 3) Delphi FPC C++ Builder
Processor Information (Type 4) Delphi FPC C++ Builder
Memory Controller Information (Type 5) Delphi FPC C++ Builder
Memory Module Information (Type 6) Delphi FPC C++ Builder
Cache Information (Type 7) Delphi FPC C++ Builder
Port Connector Information (Type 8) Delphi FPC C++ Builder
System Slots (Type 9) Delphi FPC C++ Builder
On Board Devices Information (Type 10) Delphi FPC C++ Builder
OEM Strings (Type 11) Delphi FPC C++ Builder
System Configuration Options (Type 12) Delphi FPC C++ Builder
BIOS Language Information (Type 13) Delphi FPC C++ Builder
Group Associations (Type 14) Delphi FPC C++ Builder
System Event Log (Type 15) Delphi FPC C++ Builder
Physical Memory Array (Type 16) Delphi FPC C++ Builder
Memory Device (Type 17) Delphi FPC C++ Builder
32-Bit Memory Error Information (Type 18) Delphi FPC C++ Builder
Memory Array Mapped Address (Type 19) Delphi FPC C++ Builder
Memory Device Mapped Address (Type 20) Delphi FPC C++ Builder
Built-in Pointing Device (Type 21) Delphi FPC C++ Builder
Portable Battery (Type 22) Delphi FPC C++ Builder
System Reset (Type 23) Delphi FPC C++ Builder
Hardware Security (Type 24) Delphi FPC C++ Builder
System Power Controls (Type 25) Delphi FPC C++ Builder
Voltage Probe (Type 26) Delphi FPC C++ Builder
Cooling Device (Type 27) Delphi FPC C++ Builder
Temperature Probe (Type 28) Delphi FPC C++ Builder
Electrical Current Probe (Type 29) Delphi FPC C++ Builder
Out-of-Band Remote Access (Type 30) Delphi FPC C++ Builder
Boot Integrity Services Entry Point (Type 31) Delphi FPC C++ Builder
System Boot Information (Type 32) Delphi FPC C++ Builder
64-Bit Memory Error Information (Type 33) Delphi FPC C++ Builder
Management Device (Type 34) Delphi FPC C++ Builder
Management Device Component (Type 35) Delphi FPC C++ Builder
Management Device Threshold Data (Type 36) Delphi FPC C++ Builder
Memory Channel (Type 37) Delphi FPC C++ Builder
IPMI Device Information (Type 38) Delphi FPC C++ Builder
System Power Supply (Type 39) Delphi FPC C++ Builder
Additional Information (Type 40) Delphi FPC C++ Builder
Onboard Devices Extended Information (Type 41) Delphi FPC C++ Builder
Management Controller Host Interface (Type 42) Delphi FPC C++ Builder
TPM Device (Type 43) Delphi FPC C++ Builder
Processor Additional Information (Type 44) Delphi FPC C++ Builder
Firmware Inventory Information (Type 45) Delphi FPC C++ Builder
String Property (Type 46) Delphi FPC C++ Builder

Sample source code

This code demonstrates how to retrieve information related to the memory devices installed on the system.

{$APPTYPE CONSOLE}

{$R *.res}

uses
  Classes,
  SysUtils,
  uSMBIOS in '..\..\source\uSMBIOS.pas';

procedure GetMemoryDeviceInfo;
Var
  SMBios: TSMBios;
  LMemoryDevice: TMemoryDeviceInformation;
begin
  SMBios := TSMBios.Create;
  try
      WriteLn('Memory Device Information');
      WriteLn('-------------------------');

      if SMBios.HasMemoryDeviceInfo then
      for LMemoryDevice in SMBios.MemoryDeviceInfo do
      begin
        WriteLn(Format('Total Width    %d bits',[LMemoryDevice.RAWMemoryDeviceInfo.TotalWidth]));
        WriteLn(Format('Data Width     %d bits',[LMemoryDevice.RAWMemoryDeviceInfo.DataWidth]));
        WriteLn(Format('Size           %d Mbytes',[LMemoryDevice.GetSize]));
        WriteLn(Format('Form Factor    %s',[LMemoryDevice.GetFormFactor]));
        WriteLn(Format('Device Locator %s',[LMemoryDevice.GetDeviceLocatorStr]));
        WriteLn(Format('Bank Locator   %s',[LMemoryDevice.GetBankLocatorStr]));
        WriteLn(Format('Memory Type    %s',[LMemoryDevice.GetMemoryTypeStr]));
        WriteLn(Format('Speed          %d MT/s',[LMemoryDevice.GetSpeed]));
        if SMBiosAtLeast(SMBios, 2, 7) and LMemoryDevice.HasConfiguredMemorySpeed then
          WriteLn(Format('Configured Speed %d MT/s',[LMemoryDevice.GetConfiguredMemorySpeed]));
        if SMBiosAtLeast(SMBios, 3, 2) then
        begin
          if LMemoryDevice.HasMemoryTechnology then
            WriteLn(Format('Technology     %s',[LMemoryDevice.GetMemoryTechnologyStr]));
          if LMemoryDevice.HasFirmwareVersion then
            WriteLn(Format('Firmware       %s',[LMemoryDevice.FirmwareVersionStr]));
          if LMemoryDevice.HasNonVolatileSize then
            WriteLn(Format('Non-Volatile   %d bytes',[LMemoryDevice.GetNonVolatileSize]));
          if LMemoryDevice.HasVolatileSize then
            WriteLn(Format('Volatile       %d bytes',[LMemoryDevice.GetVolatileSize]));
          if LMemoryDevice.HasCacheSize then
            WriteLn(Format('Cache          %d bytes',[LMemoryDevice.GetCacheSize]));
          if LMemoryDevice.HasLogicalSize then
            WriteLn(Format('Logical        %d bytes',[LMemoryDevice.GetLogicalSize]));
        end;
        if SMBiosAtLeast(SMBios, 3, 7) and LMemoryDevice.HasPMIC0 then
        begin
          WriteLn(Format('PMIC0 Manufacturer ID %.4x',[LMemoryDevice.GetPMIC0ManufacturerID]));
          WriteLn(Format('PMIC0 Revision Number %.4x',[LMemoryDevice.GetPMIC0RevisionNumber]));
        end;
        if SMBiosAtLeast(SMBios, 3, 7) and LMemoryDevice.HasRCD then
        begin
          WriteLn(Format('RCD Manufacturer ID   %.4x',[LMemoryDevice.GetRCDManufacturerID]));
          WriteLn(Format('RCD Revision Number   %.4x',[LMemoryDevice.GetRCDRevisionNumber]));
        end;
        WriteLn(Format('Manufacturer   %s',[LMemoryDevice.ManufacturerStr]));
        WriteLn(Format('Serial Number  %s',[LMemoryDevice.SerialNumberStr]));
        WriteLn(Format('Asset Tag      %s',[LMemoryDevice.AssetTagStr]));
        WriteLn(Format('Part Number    %s',[LMemoryDevice.PartNumberStr]));

        WriteLn;

        if Assigned(LMemoryDevice.PhysicalMemoryArray) then
        begin
          WriteLn('  Physical Memory Array');
          WriteLn('  ---------------------');
          WriteLn('  Location         '+LMemoryDevice.PhysicalMemoryArray.GetLocationStr);
          WriteLn('  Use              '+LMemoryDevice.PhysicalMemoryArray.GetUseStr);
          WriteLn('  Error Correction '+LMemoryDevice.PhysicalMemoryArray.GetErrorCorrectionStr);
          if LMemoryDevice.PhysicalMemoryArray.RAWPhysicalMemoryArrayInformation.MaximumCapacity<>$80000000 then
            WriteLn(Format('  Maximum Capacity %d Kb',[LMemoryDevice.PhysicalMemoryArray.RAWPhysicalMemoryArrayInformation.MaximumCapacity]))
          else if LMemoryDevice.PhysicalMemoryArray.HasExtendedMaximumCapacity then
            WriteLn(Format('  Maximum Capacity %d bytes',[LMemoryDevice.PhysicalMemoryArray.GetExtendedMaximumCapacity]))
          else
            WriteLn('  Maximum Capacity Unknown');

          WriteLn(Format('  Memory devices   %d',[LMemoryDevice.PhysicalMemoryArray.RAWPhysicalMemoryArrayInformation.NumberofMemoryDevices]));
        end;
        WriteLn;
      end
      else
      Writeln('No Memory Device Info was found');
  finally
   SMBios.Free;
  end;
end;


begin
 try
    GetMemoryDeviceInfo;
 except
    on E:Exception do
        Writeln(E.Classname, ':', E.Message);
 end;
 Writeln('Press Enter to exit');
 Readln;
end.

About

Library to access the SMBIOS using Object Pascal (Delphi, FPC).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors