Repository navigation
SysWin Dmi Firmware
Home › All Categories › sys/win › sys/win/dmi › Firmware functions
Returns the BIOS vendor, version, date and ROM size and the system UUID.
These functions read single fields of the SMBIOS tables through a CBiosTable of their own, so each call copies the table once. The structures at the end of the page describe the table as Windows returns it and the first fields of the BIOS and system structures.
#import "sys/win"
#import "sys/win/dmi"
using win, dmiDescribes the BIOS, including its ROM size and some of its characteristics:
#import "sys/win"
#import "sys/win/dmi"
using win, dmi
print GetBiosVendor(); " "; GetBiosVersion(); ", released "; GetBiosReleaseDate()
dim nRom as int32 = GetBiosROMSize() and &hFF
if nRom = &hFF then
' too big for the old field: the size is in the SMBIOS 3.1 field at 18h
dim nExtSize as uint32 = CBiosTable( 0 ).GetWord( &h18 )
print "ROM:"; nExtSize and &h3FFF; iif( ( nExtSize shr 14 ) = 1, " GB", " MB" )
else
print "ROM:"; ( nRom + 1 ) * 64; " KB"
end if
dim nFlags as uint64 = CBiosTable( 0 ).GetQWord( &h0A )
if nFlags and &h800 then print "the BIOS can be upgraded"
if nFlags and &h8000 then print "it can boot from a CD"
dim nExtBits as int32 = CBiosTable( 0 ).GetUByte( &h13 )
if nExtBits and &h08 then print "UEFI is supported"
if nExtBits and &h10 then print "this is a virtual machine"
print "system UUID "; SMBIOS_GetSystemUUID()On one desktop it prints (its UUID replaced here):
American Megatrends Inc. 2214, released 01/02/2024
ROM: 32 MB
the BIOS can be upgraded
it can boot from a CD
UEFI is supported
system UUID 12345678-9ABC-DEF0-0123-456789ABCDEF
| Function | Does |
|---|---|
| GetBiosVendor | Returns the name of the BIOS vendor. |
| GetBiosVersion | Returns the BIOS version. |
| GetBiosReleaseDate | Returns the BIOS release date, as mm/dd/yyyy. |
| GetBiosROMSize | Returns the BIOS ROM size field. |
| SMBIOS_GetSystemUUID | Returns the system UUID as text. |
| Type | Holds |
|---|---|
| RawSMBIOSData | The SMBIOS table as GetSystemFirmwareTable returns it. |
| RawSMBIOSTable | The header every SMBIOS structure starts with. |
| RawSMBIOSBiosInfo | The formatted area of the BIOS structure, type 0. |
| RawSMBIOSSystemInfo | The formatted area of the system structure, type 1. |
function GetBiosVendor() as stringReturns the name of the company that made the BIOS (type 0, offset &h04), such as
American Megatrends Inc..
Returns the name, or "" if the firmware does not give one.
Example
print "BIOS by "; GetBiosVendor()function GetBiosVersion() as stringReturns the BIOS version (type 0, offset &h05), in whatever form the vendor writes it.
Returns the version, or "".
Example
print "BIOS version "; GetBiosVersion()function GetBiosReleaseDate() as stringReturns the release date of the BIOS (type 0, offset &h08). The specification asks for
mm/dd/yyyy; firmware from before SMBIOS 2.3 may write mm/dd/yy.
Returns the date, or "".
Example
print "released "; GetBiosReleaseDate()function GetBiosROMSize() as byteReturns the ROM size field of the BIOS structure (type 0, offset &h09): the size is
(n + 1) × 64 KB. A ROM of 16 MB or more does not fit; then the field is &hFF and the size is
in the extended field at &h18 (SMBIOS 3.1), as the example reads it.
The result is a signed byte, so &hFF comes back as −1: and it with &hFF before use.
Returns the field, or 0 if there is no BIOS structure.
Example
dim n as int32 = GetBiosROMSize() and &hFF
if n <> &hFF then print "ROM:"; ( n + 1 ) * 64; " KB"function SMBIOS_GetSystemUUID() as stringReturns the 16-byte UUID of the system structure (type 1, offset &h08) as 32 hexadecimal
digits in five groups, 12345678-9ABC-DEF0-0123-456789ABCDEF.
The bytes are written in the order they are stored. Since SMBIOS 2.6 the first three groups are
stored lowest byte first, and Windows (Win32_ComputerSystemProduct.UUID, wmic csproduct)
reverses them for display: the same machine shows 78563412-BC9A-F0DE-0123-456789ABCDEF there.
Compare with the value from this function, or reverse the bytes of the first three groups.
Returns the UUID, or "" if there is no system structure.
Example
print "machine id: "; SMBIOS_GetSystemUUID()The bits of the 64-bit field at type 0, offset &h0A (GetQWord):
| Bit | Value | Means |
|---|---|---|
| 3 | &h8 |
The characteristics are not supported (and the other bits mean nothing). |
| 4 | &h10 |
ISA |
| 5 | &h20 |
MCA |
| 6 | &h40 |
EISA |
| 7 | &h80 |
PCI |
| 8 | &h100 |
PC Card (PCMCIA) |
| 9 | &h200 |
Plug and Play |
| 10 | &h400 |
APM |
| 11 | &h800 |
The BIOS can be upgraded (flash). |
| 12 | &h1000 |
BIOS shadowing is allowed. |
| 13 | &h2000 |
VL-VESA |
| 14 | &h4000 |
ESCD |
| 15 | &h8000 |
Boot from CD |
| 16 | &h10000 |
Selectable boot |
| 17 | &h20000 |
The BIOS ROM is socketed. |
| 18 | &h40000 |
Boot from PC Card |
| 19 | &h80000 |
Enhanced Disk Drive (EDD) |
The two extension bytes (GetUByte, SMBIOS 2.4):
| Byte | Value | Means |
|---|---|---|
&h12 |
&h01 |
ACPI |
&h12 |
&h02 |
USB legacy |
&h12 |
&h04 |
AGP |
&h12 |
&h08 |
I2O boot |
&h12 |
&h10 |
LS-120 boot |
&h12 |
&h20 |
ATAPI ZIP drive boot |
&h12 |
&h40 |
1394 boot |
&h12 |
&h80 |
Smart battery |
&h13 |
&h01 |
BIOS Boot Specification |
&h13 |
&h02 |
Function key–initiated network boot |
&h13 |
&h04 |
Targeted content distribution |
&h13 |
&h08 |
UEFI |
&h13 |
&h10 |
The table describes a virtual machine. |
type RawSMBIOSData
Used20CallingMethod as BYTE
SMBIOSMajorVersion as BYTE
SMBIOSMinorVersion as BYTE
DmiRevision as BYTE
Length as DWORD
SMBIOSTableData(0) as BYTE
end typeThe buffer GetSystemFirmwareTable fills for the RSMB provider: the SMBIOS version, then
Length bytes of structures starting at SMBIOSTableData. CBiosTable walks it.
Microsoft Learn: GetSystemFirmwareTable
type RawSMBIOSTable
as BYTE Type
as BYTE Length
as WORD Handle
end typeThe four bytes every SMBIOS structure starts with: its type, the length of its formatted area (the strings follow it), and a handle other structures use to refer to it. GetTable returns a pointer to one.
type RawSMBIOSBiosInfo field = 1
as RawSMBIOSTable Header
as BYTE Vendor ' 04h, string number
as BYTE Version ' 05h, string number
as WORD StartingAddrSeg ' 06h
as BYTE ReleaseDate ' 08h, string number
as BYTE ROMSize ' 09h
as ULONG64 Characteristics ' 0Ah
as BYTE Extension(1) ' 12h, SMBIOS 2.4
as BYTE MajorRelease ' 14h
as BYTE MinorRelease ' 15h
as BYTE ECFirmwareMajor ' 16h
as BYTE ECFirmwareMinor ' 17h
as WORD EFROMSize ' 18h, SMBIOS 3.1
end typeThe formatted area of the BIOS structure, type 0, laid over GetTable's
pointer. The string fields hold string numbers, not text. Fields past Header.Length are not
there on older firmware.
Example
dim bios as CBiosTable = 0
dim p as RawSMBIOSBiosInfo ptr = cast( RawSMBIOSBiosInfo ptr, bios.GetTable() )
if p andalso p->Header.Length > &h15 then print "BIOS release"; p->MajorRelease; "."; p->MinorReleasetype RawSMBIOSSystemInfo
as RawSMBIOSTable Header
as BYTE Manufacturer ' 04h, string number
as BYTE ProductName ' 05h, string number
as BYTE Version ' 06h, string number
as BYTE SerialNumber ' 07h, string number
as BYTE UUID(15) ' 08h, SMBIOS 2.1
as BYTE Wakeup_Type ' 18h
as BYTE SKUNumber ' 19h, string number, SMBIOS 2.4
as BYTE Family ' 1Ah, string number
end typeThe formatted area of the system structure, type 1.
- CBiosTable: any field of any structure, and the table of common offsets
- Disk functions
tiko-lang · Home · Feature Index · Keyword Index · License
FreeBASIC manual pages reproduced under the GNU FDL 1.3.
- Home
- What Is tiko-lang
- Quick Start
- Installing on macOS
- Android (experimental)
- Debugging
- Feature Index
- Compatibility
- FAQ
- AI Cheatsheet
- Generics
- Interfaces
- For Each
- Iterators
- Tuples
- Array Results
- Defer
- Move Semantics
- Match
- Lambdas
- Block Strings
- String Interpolation
- Partial Types
- String Slices
- Array Slices
- Embed
- Typed Variadics
- C Header Import
- Foreign Library Linking
- UString
- Fixed-Width Types
- Nullptr
- String Library
- Format
- Array
- Map
- Set
- LinkedList
- OrderedMap
- OrderedSet
- Sorting
- Optional
- Result
- Smart Pointers
- Date and Time (Chrono)
- Time Zones
- Filesystem
- File Streams
- Config (INI and TOML)
- Codec
- Hash
- UUID
- OS
- Hardware
- Process
- Net
- HTTP and TLS
- Math Library
- Finance
- Logging
- Terminal TUI Library
- tkControls
- sys/win
- Goroutines and Channels
- LLVM Backend
- tiko build
- tiko test
- tiko doc
- TIKO_COMPILER
- Variable Declarations
- Standard Data Types
- User Defined Types
- Procedures
- Operators
- Control Flow Statements
- Converting Data Types
- Array Functions
- String Functions
- Mathematical Functions
- Bit Manipulation
- Date and Time Functions
- File I/O Functions
- Console Functions
- User Input (Runtime Library)
- User Input Functions (Graphics Library)
- Screen Functions
- 2D Drawing Functions
- Graphics Library Reference
- Graphics Keyword List
- Memory Functions
- Threading Support Functions
- Error Handling Functions
- Operating System Functions
- Preprocessor
- Intrinsic Defines
- Miscellaneous Keywords
- Modularizing