Struct SMBiosEntryPoint32

Source
pub struct SMBiosEntryPoint32 { /* private fields */ }
Expand description

§SMBIOS 2.1 (32 bit) Entry Point structure

On non-UEFI systems, the 32-bit SMBIOS Entry Point structure, can be located by application software by searching for the anchor-string on paragraph (16-byte) boundaries within the physical memory address range 000F0000h to 000FFFFFh. This entry point encapsulates an intermediate anchor string that is used by some existing DMI browsers.

On UEFI-based systems, the SMBIOS Entry Point structure can be located by looking in the EFI Configuration Table for the SMBIOS GUID (SMBIOS_TABLE_GUID, {EB9D2D31-2D88-11D3-9A16- 0090273FC14D}) and using the associated pointer. See section 4.6 of the UEFI Specification for details. See section 2.3 of the UEFI Specification for how to report the containing memory type.

Implementations§

Source§

impl<'a> SMBiosEntryPoint32

Source

pub const MINIMUM_SIZE: usize = 31usize

Minimum acceptable size of this structure

TODO: Review DMTF SMBIOS document history and see if structure sizes smaller than 0x1F existed. If so then change this structure design to return Option<> values and adjust this size accordingly.

Source

pub const SM_ANCHOR: [u8; 4]

Anchor String “SM” (offset 0)

Source

pub const DMI_ANCHOR: [u8; 5]

Anchor String “DMI” (offset 0x10)

Source

pub const ENTRY_POINT_STRUCTURE_CHECKSUM_OFFSET: usize = 4usize

Entry Point Structure Checksum Offset

Source

pub const ENTRY_POINT_LENGTH_OFFSET: usize = 5usize

Entry Point Length Offset

Source

pub const MAJOR_VERSION_OFFSET: usize = 6usize

SMBIOS Major Version Offset

Source

pub const MINOR_VERSION_OFFSET: usize = 7usize

SMBIOS Minor Version Offset

Source

pub const MAXIMUM_STRUCTURE_SIZE_OFFSET: usize = 8usize

Maximum Structure Size Offset

Source

pub const ENTRY_POINT_REVISION_OFFSET: usize = 10usize

Entry Point Revision Offset

Source

pub const FORMATTED_AREA_OFFSET: usize = 11usize

Formatted Area Offset

Source

pub const INTERMEDIATE_ANCHOR_OFFSET: usize = 16usize

Intermediate Anchor String Offset

NOTE: This field is paragraph-aligned, to allow legacy DMI browsers to find this entry point within the SMBIOS Entry Point Structure.

Source

pub const INTERMEDIATE_CHECKSUM_OFFSET: usize = 21usize

Intermediate Checksum Offset

Source

pub const STRUCTURE_TABLE_LENGTH_OFFSET: usize = 22usize

Structure Table Length Offset

Source

pub const STRUCTURE_TABLE_ADDRESS_OFFSET: usize = 24usize

Structure Table Address Offset

Source

pub const NUMBER_OF_SMBIOS_STRUCTURES_OFFSET: usize = 28usize

Number of SMBIOS Structures Offset

Source

pub const BCD_REVISION_OFFSET: usize = 30usize

SMBIOS BCD Revision Offset

Source

pub fn entry_point_structure_checksum(&self) -> u8

Entry Point Structure Checksum

Checksum of the Entry Point Structure (EPS)

This value, when added to all other bytes in the EPS, results in the value 00h (using 8-bit addition calculations). Values in the EPS are summed starting at offset 00h, for entry_point_length bytes.

Source

pub fn entry_point_length(&self) -> u8

Entry Point Length

Length of the Entry Point Structure, starting with the Anchor String field, in bytes, currently 1Fh

NOTE: This value was incorrectly stated in version 2.1 of this specification as 1Eh. Because of this, there might be version 2.1 implementations that use either the 1Eh or the 1Fh value, but version 2.2 or later implementations must use the 1Fh value.

Source

pub fn major_version(&self) -> u8

SMBIOS Major Version

Major version of this specification implemented in the table structures (for example, the value is 0Ah (10) for revision 10.22 and 02h for revision 2.1)

Source

pub fn minor_version(&self) -> u8

SMBIOS Minor Version

Minor version of this specification implemented in the table structures (for example, the value is 16h (22) for revision 10.22 and 01h for revision 2.1)

Source

pub fn maximum_structure_size(&self) -> u16

Maximum Structure Size

Size of the largest SMBIOS structure, in bytes, and encompasses the structure’s formatted area and text strings

Source

pub fn entry_point_revision(&self) -> u8

Entry Point Revision

EPS revision implemented in this structure and identifies the formatting of offsets 0Bh to 0Fh as follows:

  • 00h Entry Point is based on SMBIOS 2.1 definition; formatted area is reserved and set to all 00h.
  • 01h-FFh Reserved for assignment by this specification
Source

pub fn formatted_area(&self) -> [u8; 5]

Formatted Area

Value present in the entry_point_revision field defines the interpretation to be placed upon these 5 bytes

Source

pub fn intermediate_anchor(&self) -> [u8; 5]

Intermediate Anchor String

DMI, specified as five ASCII characters (5F 44 4D 49 5F).

Source

pub fn intermediate_checksum(&self) -> u8

Intermediate Checksum

Checksum of Intermediate Entry Point Structure (IEPS).

This value, when added to all other bytes in the IEPS, results in the value 00h (using 8-bit addition calculations). Values in the IEPS are summed starting at offset 10h, for 0Fh bytes.

Source

pub fn structure_table_length(&self) -> u16

Structure Table Length

Total length of SMBIOS Structure Table, pointed to by the structure_table_address, in bytes

Source

pub fn structure_table_address(&self) -> u32

Structure Table Address

32-bit physical starting address of the read-only SMBIOS Structure Table, which can start at any 32-bit address This area contains all of the SMBIOS structures fully packed together. These structures can then be parsed to produce exactly the same format as that returned from a Get SMBIOS Structure function call.

Source

pub fn number_of_smbios_structures(&self) -> u16

Number of SMBIOS Structures

Total number of structures present in the SMBIOS Structure Table This is the value returned as NumStructures from the Get SMBIOS Information function.

Source

pub fn bcd_revision(&self) -> u8

SMBIOS BCD Revision

Indicates compliance with a revision of this specification It is a BCD value where the upper nibble indicates the major version and the lower nibble the minor version. For revision 2.1, the returned value is 21h. If the value is 00h, only the Major and Minor Versions in offsets 6 and 7 of the Entry Point Structure provide the version information.

Source

pub fn try_load_from_file(filename: &Path) -> Result<Self, Error>

Load this structure from a file

Source

pub fn try_scan_from_file<T>(file: &mut File, range: T) -> Result<Self, Error>
where T: RangeBounds<u64> + Iterator<Item = u64>,

Load this structure by scanning a file within the given offsets, looking for the SMBiosEntryPoint32::SM_ANCHOR string.

Trait Implementations§

Source§

impl Debug for SMBiosEntryPoint32

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Serialize for SMBiosEntryPoint32

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> TryFrom<Vec<u8>> for SMBiosEntryPoint32

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(raw: Vec<u8>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.