Documentation
¶
Overview ¶
Package smbios provides detection and access to System Management BIOS (SMBIOS) and Desktop Management Interface (DMI) data and structures.
Index ¶
- type BIOSInfo
- type BIOSInfoRead
- type BaseboardInfo
- type Decoder
- type EntryPoint
- type EntryPoint32Bit
- type EntryPoint64Bit
- type Extract
- type Header
- type MemoryInfoRead
- type PhysicalMemory
- type Processor
- type SMBIOSBaseboardInfo
- type SMBIOSMemoryInfo
- type SMBIOSProcessorInfo
- type SMBIOSProcessorType
- type SMBIOSSystemInfo
- type SMBIOSVersion
- type Structure
- type SystemEnclosure
- type SystemInfo
- type SystemInfoRead
- type WindowsEntryPoint
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BIOSInfoRead ¶
type BaseboardInfo ¶
type Decoder ¶
type Decoder struct {
Version SMBIOSVersion
// contains filtered or unexported fields
}
A Decoder decodes Structures from a stream.
func NewDecoder ¶
NewDecoder creates a Decoder which decodes Structures from the input stream.
type EntryPoint ¶
type EntryPoint interface {
// Table returns the memory address and maximum size of the SMBIOS table.
Table() (address, size int)
// Version returns the system's SMBIOS version.
Version() (major, minor, revision int)
}
An EntryPoint is an SMBIOS entry point. EntryPoints contain various properties about SMBIOS.
Use a type assertion to access detailed EntryPoint information.
func ParseEntryPoint ¶
func ParseEntryPoint(r io.Reader) (EntryPoint, error)
ParseEntryPoint parses an EntryPoint from the input stream.
func Stream ¶
func Stream() (io.ReadCloser, EntryPoint, error)
Stream locates and opens a stream of SMBIOS data and the SMBIOS entry point from an operating system-specific location. The stream must be closed after decoding to free its resources.
If no suitable location is found, an error is returned.
type EntryPoint32Bit ¶
type EntryPoint32Bit struct {
Anchor string
Checksum uint8
Length uint8
Major uint8
Minor uint8
MaxStructureSize uint16
EntryPointRevision uint8
FormattedArea [5]byte
IntermediateAnchor string
IntermediateChecksum uint8
StructureTableLength uint16
StructureTableAddress uint32
NumberStructures uint16
BCDRevision uint8
}
EntryPoint32Bit is the SMBIOS 32-bit Entry Point structure, used starting in SMBIOS 2.1.
func (*EntryPoint32Bit) Table ¶
func (e *EntryPoint32Bit) Table() (address, size int)
Table implements EntryPoint.
func (*EntryPoint32Bit) Version ¶
func (e *EntryPoint32Bit) Version() (major, minor, revision int)
Version implements EntryPoint.
type EntryPoint64Bit ¶
type EntryPoint64Bit struct {
Anchor string
Checksum uint8
Length uint8
Major uint8
Minor uint8
Revision uint8
EntryPointRevision uint8
Reserved uint8
StructureTableMaxSize uint32
StructureTableAddress uint64
}
EntryPoint64Bit is the SMBIOS 64-bit Entry Point structure, used starting in SMBIOS 3.0.
func (*EntryPoint64Bit) Table ¶
func (e *EntryPoint64Bit) Table() (address, size int)
Table implements EntryPoint.
func (*EntryPoint64Bit) Version ¶
func (e *EntryPoint64Bit) Version() (major, minor, revision int)
Version implements EntryPoint.
type MemoryInfoRead ¶
type MemoryInfoRead struct {
MemArrayHandle uint16
MemErrorInfoHandle uint16
TotalWidth uint16
DataWidth uint16
Size uint16
FormFactor byte
DeviceSet byte
DeviceLocator byte
BankLocator byte
MemType byte
TypeDetail uint16
Speed uint16
Manufacturer byte
SerialNumber byte
AssetTag byte
PartNumber byte
Attribute byte
ExtendedSize uint32
ConfiguredMemClockSpeed uint16
MinVoltage uint16
MaxVoltage uint16
ConfiguredVoltage uint16
}
type PhysicalMemory ¶
type SMBIOSBaseboardInfo ¶
type SMBIOSMemoryInfo ¶
type SMBIOSMemoryInfo struct {
MemArrayHandle uint16
MemErrorInfoHandle uint16
TotalWidth uint16
DataWidth uint16
Size uint16
FormFactor byte
DeviceSet byte
DeviceLocator byte
BankLocator byte
MemType byte
TypeDetail uint16
Speed uint16
SerialNumber byte
Manufacturer byte
AssetTag byte
PartNumber byte
Attribute byte
ExtendedSize uint32
ConfiguredMemClockSpeed uint16
MinVoltage uint16
MaxVoltage uint16
ConfiguredVoltage uint16
}
FIXME and use review
type SMBIOSProcessorInfo ¶
type SMBIOSProcessorType ¶
type SMBIOSProcessorType struct {
SocketDesignation byte
ProcessorType byte
ProcessorFamily byte
ProcessorManufacturer byte
ProcessorID [4]uint16
ProcessorVersion byte
Voltage byte
ExternalClock uint16
MaxSpeed uint16
CurrentSpeed uint16
Status byte
ProcessorUpgrade byte
L1CacheHandle uint16
L2CacheHandle uint16
L3CacheHandle uint16
SerialNumber byte
AssetTag byte
PartNumber byte
CoreCount byte
CoreEnabled byte
ThreadCount byte
ProcessorCharacteristics uint16
ProcessorFamily2 uint16
CoreCount2 uint16
COreEnabled2 uint16
ThreadCount2 uint16
}
type SMBIOSSystemInfo ¶
type SMBIOSVersion ¶
type SMBIOSVersion struct {
Major, Minor, Revision int
}
type Structure ¶
type Structure struct {
Header Header
Formatted []byte
Strings []string
SystemInfo SystemInfo
}
A Structure is an SMBIOS structure.
type SystemEnclosure ¶
type SystemInfo ¶
type SystemInfo struct {
SystemManufacturerRef, SystemProductName, BiosSerial, VirtualMachineUUID,
MotherboardAdapter, Memory, ProcessorType, ProcessorID string
BiosInfo *BIOSInfo
BaseboardInfo *BaseboardInfo
Processors []*Processor
PhyMemory []*PhysicalMemory
SystemEnclosure *SystemEnclosure
}
type SystemInfoRead ¶
type WindowsEntryPoint ¶
WindowsEntryPoint contains SMBIOS Table entry point data returned from GetSystemFirmwareTable. As raw access to the underlying memory is not given, the full breadth of information is not available.
func (*WindowsEntryPoint) Table ¶
func (e *WindowsEntryPoint) Table() (address, size int)
Table implements EntryPoint. The returned address will always be 0, as it is not returned by GetSystemFirmwareTable.
func (*WindowsEntryPoint) Version ¶
func (e *WindowsEntryPoint) Version() (major, minor, revision int)
Version implements EntryPoint.