Documentation ¶
Index ¶
- Constants
- Variables
- func ParseTypedTable(t *Table) (fmt.Stringer, error)
- type BIOSCharacteristics
- type BIOSCharacteristicsExt1
- type BIOSCharacteristicsExt2
- type BIOSInformation
- type Header
- type Info
- type SystemInformation
- type Table
- func (t *Table) GetByteAt(offset int) (uint8, error)
- func (t *Table) GetBytesAt(offset, length int) ([]byte, error)
- func (t *Table) GetDWordAt(offset int) (res uint32, err error)
- func (t *Table) GetQWordAt(offset int) (res uint64, err error)
- func (t *Table) GetStringAt(offset int) (string, error)
- func (t *Table) GetWordAt(offset int) (res uint16, err error)
- func (t *Table) Len() int
- func (t *Table) String() string
- type TableType
- type UUID
- type WakeupType
Constants ¶
const ( TableTypeBIOSInformation TableType = 0 TableTypeSystemInformation = 1 TableTypeInactive = 126 TableTypeEndOfTable = 127 )
Supported table types.
const ( BIOSCharacteristicsReserved BIOSCharacteristics = (1 << 0) // Reserved. BIOSCharacteristicsReserved2 = (1 << 1) // Reserved. BIOSCharacteristicsUnknown = (1 << 2) // Unknown. BIOSCharacteristicsBIOSCharacteristicsAreNotSupported = (1 << 3) // BIOS Characteristics are not supported. BIOSCharacteristicsISAIsSupported = (1 << 4) // ISA is supported. BIOSCharacteristicsMCAIsSupported = (1 << 5) // MCA is supported. BIOSCharacteristicsEISAIsSupported = (1 << 6) // EISA is supported. BIOSCharacteristicsPCIIsSupported = (1 << 7) // PCI is supported. BIOSCharacteristicsPCCardPCMCIAIsSupported = (1 << 8) // PC card (PCMCIA) is supported. BIOSCharacteristicsPlugAndPlayIsSupported = (1 << 9) // Plug and Play is supported. BIOSCharacteristicsAPMIsSupported = (1 << 10) // APM is supported. BIOSCharacteristicsBIOSIsUpgradeableFlash = (1 << 11) // BIOS is upgradeable (Flash). BIOSCharacteristicsBIOSShadowingIsAllowed = (1 << 12) // BIOS shadowing is allowed. BIOSCharacteristicsVLVESAIsSupported = (1 << 13) // VL-VESA is supported. BIOSCharacteristicsESCDSupportIsAvailable = (1 << 14) // ESCD support is available. BIOSCharacteristicsBootFromCDIsSupported = (1 << 15) // Boot from CD is supported. BIOSCharacteristicsSelectableBootIsSupported = (1 << 16) // Selectable boot is supported. BIOSCharacteristicsBIOSROMIsSocketed = (1 << 17) // BIOS ROM is socketed. BIOSCharacteristicsBootFromPCCardPCMCIAIsSupported = (1 << 18) // Boot from PC card (PCMCIA) is supported. BIOSCharacteristicsEDDSpecificationIsSupported = (1 << 19) // EDD specification is supported. BIOSCharacteristicsInt13hJapaneseFloppyForNEC980012MB351KBytessector360RPMIsSupported = (1 << 20) // Japanese floppy for NEC 9800 1.2 MB (3.5”, 1K bytes/sector, 360 RPM) is BIOSCharacteristicsInt13hJapaneseFloppyForToshiba12MB35360RPMIsSupported = (1 << 21) // Japanese floppy for Toshiba 1.2 MB (3.5”, 360 RPM) is supported. BIOSCharacteristicsInt13h525360KBFloppyServicesAreSupported = (1 << 22) // 5.25” / 360 KB floppy services are supported. BIOSCharacteristicsInt13h52512MBFloppyServicesAreSupported = (1 << 23) // 5.25” /1.2 MB floppy services are supported. BIOSCharacteristicsInt13h35720KBFloppyServicesAreSupported = (1 << 24) // 3.5” / 720 KB floppy services are supported. BIOSCharacteristicsInt13h35288MBFloppyServicesAreSupported = (1 << 25) // 3.5” / 2.88 MB floppy services are supported. BIOSCharacteristicsInt5hPrintScreenServiceIsSupported = (1 << 26) // Int 5h, print screen Service is supported. BIOSCharacteristicsInt9h8042KeyboardServicesAreSupported = (1 << 27) // Int 9h, 8042 keyboard services are supported. BIOSCharacteristicsInt14hSerialServicesAreSupported = (1 << 28) // Int 14h, serial services are supported. BIOSCharacteristicsInt17hPrinterServicesAreSupported = (1 << 29) // Int 17h, printer services are supported. BIOSCharacteristicsInt10hCGAMonoVideoServicesAreSupported = (1 << 30) // Int 10h, CGA/Mono Video Services are supported. BIOSCharacteristicsNECPC98 = (1 << 31) // NEC PC-98. )
BIOSCharacteristics fields are defined in DSP0134 7.1.1.
const ( BIOSCharacteristicsExt1ACPIIsSupported BIOSCharacteristicsExt1 = (1 << 0) // ACPI is supported. BIOSCharacteristicsExt1USBLegacyIsSupported = (1 << 1) // USB Legacy is supported. BIOSCharacteristicsExt1AGPIsSupported = (1 << 2) // AGP is supported. BIOSCharacteristicsExt1I2OBootIsSupported = (1 << 3) // I2O boot is supported. BIOSCharacteristicsExt1LS120SuperDiskBootIsSupported = (1 << 4) // LS-120 SuperDisk boot is supported. BIOSCharacteristicsExt1ATAPIZIPDriveBootIsSupported = (1 << 5) // ATAPI ZIP drive boot is supported. BIOSCharacteristicsExt11394BootIsSupported = (1 << 6) // 1394 boot is supported. BIOSCharacteristicsExt1SmartBatteryIsSupported = (1 << 7) // Smart battery is supported. )
BIOSCharacteristicsExt1 is defined in DSP0134 7.1.2.1.
const ( BIOSCharacteristicsExt2BIOSBootSpecificationIsSupported BIOSCharacteristicsExt2 = (1 << 0) // BIOS Boot Specification is supported. BIOSCharacteristicsExt2FunctionKeyinitiatedNetworkServiceBootIsSupported = (1 << 1) // Function key-initiated network service boot is supported. BIOSCharacteristicsExt2TargetedContentDistributionIsSupported = (1 << 2) // Enable targeted content distribution. BIOSCharacteristicsExt2UEFISpecificationIsSupported = (1 << 3) // UEFI Specification is supported. BIOSCharacteristicsExt2SMBIOSTableDescribesAVirtualMachine = (1 << 4) // SMBIOS table describes a virtual machine. (If this bit is not set, no inference can be made )
BIOSCharacteristicsExt1 is defined in DSP0134 7.1.2.2.
const ( WakeupTypeReserved WakeupType = 0x00 // Reserved WakeupTypeOther = 0x01 // Other WakeupTypeUnknown = 0x02 // Unknown WakeupTypeAPMTimer = 0x03 // APM Timer WakeupTypeModemRing = 0x04 // Modem Ring WakeupTypeLANRemote = 0x05 // LAN Remote WakeupTypePowerSwitch = 0x06 // Power Switch WakeupTypePCIPME = 0x07 // PCI PME# WakeupTypeACPowerRestored = 0x08 // AC Power Restored )
WakeupType values are defined in DSP0134 7.2.2.
Variables ¶
var ( // ErrTableNotFound is retuned if table with specified type is not found. ErrTableNotFound = errors.New("table not found") // ErrUnsupportedTableType is returned by ParseTypedTable if this table type is not supported and cannot be parsed. ErrUnsupportedTableType = errors.New("unsupported table type") )
Functions ¶
Types ¶
type BIOSCharacteristics ¶
type BIOSCharacteristics uint64
BIOSCharacteristics is defined in DSP0134 7.1.1.
func (BIOSCharacteristics) String ¶
func (v BIOSCharacteristics) String() string
type BIOSCharacteristicsExt1 ¶
type BIOSCharacteristicsExt1 uint8
BIOSCharacteristicsExt1 is defined in DSP0134 7.1.2.1.
func (BIOSCharacteristicsExt1) String ¶
func (v BIOSCharacteristicsExt1) String() string
type BIOSCharacteristicsExt2 ¶
type BIOSCharacteristicsExt2 uint8
BIOSCharacteristicsExt2 is defined in DSP0134 7.1.2.2.
func (BIOSCharacteristicsExt2) String ¶
func (v BIOSCharacteristicsExt2) String() string
type BIOSInformation ¶
type BIOSInformation struct { Table Vendor string // 04h Version string // 05h StartingAddressSegment uint16 // 06h ReleaseDate string // 08h ROMSize uint8 // 09h Characteristics BIOSCharacteristics // 0Ah CharacteristicsExt1 BIOSCharacteristicsExt1 // 12h CharacteristicsExt2 BIOSCharacteristicsExt2 // 13h SystemBIOSMajorRelease uint8 // 14h SystemBIOSMinorRelease uint8 // 15h EmbeddedControllerFirmwareMajorRelease uint8 // 16h EmbeddedControllerFirmwareMinorRelease uint8 // 17h ExtendedROMSize uint16 // 18h }
BIOSInformation is Defined in DSP0134 7.1.
func NewBIOSInformation ¶
func NewBIOSInformation(t *Table) (*BIOSInformation, error)
NewBIOSInformation parses a generic Table into BIOSInformation.
func (*BIOSInformation) GetROMSizeBytes ¶
func (bi *BIOSInformation) GetROMSizeBytes() uint
GetROMSizeBytes returns ROM size in bytes.
func (*BIOSInformation) String ¶
func (bi *BIOSInformation) String() string
type Header ¶
Header is the header common to all table types.
type Info ¶
type Info struct { // TODO(rojer): Add entrypoint information. Tables []*Table }
Info contains the SMBIOS information.
func (*Info) GetBIOSInformation ¶
func (i *Info) GetBIOSInformation() (*BIOSInformation, error)
GetBIOSInformation returns the Bios Information (type 0) table, if present.
func (*Info) GetSystemInformation ¶
func (i *Info) GetSystemInformation() (*SystemInformation, error)
GetSystemInformation returns the System Information (type 1) table, if present.
func (*Info) GetTablesByType ¶
GetTablesByType returns tables of specific type.
type SystemInformation ¶
type SystemInformation struct { Table Manufacturer string // 04h ProductName string // 05h Version string // 06h SerialNumber string // 07h UUID UUID // 08h WakeupType WakeupType // 18h SKUNumber string // 19h Family string // 1Ah }
SystemInformation is defined in DSP0134 7.2.
func NewSystemInformation ¶
func NewSystemInformation(t *Table) (*SystemInformation, error)
NewSystemInformation parses a generic Table into SystemInformation.
func (*SystemInformation) String ¶
func (si *SystemInformation) String() string
type Table ¶
type Table struct { Header // contains filtered or unexported fields }
Table is a generic type of table that does not parsed fields, it only allows access to its contents by offset.
func ParseTable ¶
ParseTable parses a table from byte stream. Returns the parsed table and remaining data.
func (*Table) GetByteAt ¶
GetByteAt returns a byte from the structured part at the specified offset.
func (*Table) GetBytesAt ¶
GetBytesAt returns a number of bytes from the structured part at the specified offset.
func (*Table) GetDWordAt ¶
GetDWordAt returns a 32-bit word from the structured part at the specified offset.
func (*Table) GetQWordAt ¶
GetQWordAt returns a 64-bit word from the structured part at the specified offset.
func (*Table) GetStringAt ¶
GetStringAt returns a string pointed to by the byte at the specified offset in the structured part. NB: offset is not the string index.
func (*Table) GetWordAt ¶
GetWordAt returns a 16-bit word from the structured part at the specified offset.
type TableType ¶
type TableType uint8
TableType specifies the DMI type of the table. Types are defined in DMTF DSP0134.
type UUID ¶
type UUID [16]byte
UUID is defined in DSP0134 7.2.1.
func (*UUID) ParseField ¶
ParseField parses UUD field within a table.
type WakeupType ¶
type WakeupType uint8
WakeupType is defined in DSP0134 7.2.2.
func (WakeupType) String ¶
func (v WakeupType) String() string