以DDR4為例,目前在市面上常見的產品有:DDR4 2133、DDR4 2400、DDR4 2666及DDR4 3200
等。
用DDR4 2400來說,有時候也會看到PC4-19200等其他標示,這裡的DDR4 2400的"2400",
單位是MT/s (megatransfers per second),意義上代表每秒鐘可完成2400×106次傳輸操作。
而目前記憶體DIMM的Bus width為8 Bytes(64 Bits),表示DDR4 2400的資料傳輸速率為19200 MB/s
(8 Byte × 2400 MT/s),所以PC4-19200的"19200"就代表記憶體傳輸速率的峰值(Peak Transfer Rate),單位為MB/s。
SMBIOS Type 17中的"Speed"欄位,在先前的SPEC (3.0.0 與之前的版本)中,是用時脈來表示記
憶體速度,單位是MHz。在之後的SPEC,"Speed"欄位則改用MT/s來表示。以DDR4 2400為例,"Speed"所
要填的值為0x0960(2400)(MT/s),而若是SMBIOS 3.0.0以前,就要填為0x4B0(1200)(MHz)。
記憶體的MHz和MT/s間轉換,就是將MHz的數值×2就能獲得MT/s,因為資料傳輸同時計入時脈
的正緣與負緣。
2018年6月11日 星期一
2018年6月10日 星期日
System Management BIOS(SMBIOS) 概述
SMBIOS是由DMTF(https://www.dmtf.org/)組織所制定及維護的業界規範,其目的在於讓主機
板及系統廠商有統一的標準格式,來描述產品相關的管理資訊,並供給作業系統使用。
本篇文章以SMBIOS 3.2.0 Specification 當作參考:
DSP0134_3.2.0
SMBIOS Entry Point主要可以區分為較早期的版本SMBIOS 2.1及現在的SMBIOS 3.0版本,以32-bit和64-bit作為分別。
Legacy
在實體記憶體位址0x000F0000-0x000FFFFF之間,尋找"_SM_"(SMBIOS 2.1) 或者"_SM3_"(SMBIOS 3.0)字串,就可以訪問到其Entry Point structure。
UEFI
透過EFI Configuration Table和SMBIOS GUID來進行訪問。
SMBIOS 2.1為SMBIOS_TABLE_GUID{EB9D2D31-2D88-11D3-9A16-0090273FC14D}。
SMBIOS 3.0為SMBIOS3_TABLE_GUID{F2FD1544-9794-4A2C-992E-E5BBCF20E394}。
得到SMBIOS Entry Point 之後,就可以透過其"Structure Table Address"來訪問 SMBIOS structure。
EDK2中定義的 SMBIOS Entry Point結構
formmated section以長度4 byte的header起始,而接在header之後的資料格式根據Structure type有所不同。 optional unformed section則由文字字串組成。
SMBIOS Structure的Text String區塊接在Structure的formatted section之後。而其是選擇性的, SMBIOS的Structure內並不一定要含有Text String。每個Text String的結尾都是null character(00h)。
在SMBIOS structure的formatted section中,需要使用Text String的時候,就需要填上一個非0 值。假設其填值為02h,就代表這個string field要去參考Text String區塊中的第二個Text String。若其 填為0,就代表此string field不使用Text String。
SPEC中的BIOS Infomation(Type 0)範例:
使用Text String的BIOS Infomation(Type 0)
沒有使用Text String的BIOS Infomation(Type 0)
本篇文章以SMBIOS 3.2.0 Specification 當作參考:
DSP0134_3.2.0
SMBIOS entry point
SMBIOS Entry Point主要可以區分為較早期的版本SMBIOS 2.1及現在的SMBIOS 3.0版本,以32-bit和64-bit作為分別。
SMBIOS Entry Point structure的訪問方法
Legacy
在實體記憶體位址0x000F0000-0x000FFFFF之間,尋找"_SM_"(SMBIOS 2.1) 或者"_SM3_"(SMBIOS 3.0)字串,就可以訪問到其Entry Point structure。
UEFI
透過EFI Configuration Table和SMBIOS GUID來進行訪問。
SMBIOS 2.1為SMBIOS_TABLE_GUID{EB9D2D31-2D88-11D3-9A16-0090273FC14D}。
SMBIOS 3.0為SMBIOS3_TABLE_GUID{F2FD1544-9794-4A2C-992E-E5BBCF20E394}。
得到SMBIOS Entry Point 之後,就可以透過其"Structure Table Address"來訪問 SMBIOS structure。
EDK2中定義的 SMBIOS Entry Point結構
typedef struct {
UINT8 AnchorString[5];
UINT8 EntryPointStructureChecksum;
UINT8 EntryPointLength;
UINT8 MajorVersion;
UINT8 MinorVersion;
UINT8 DocRev;
UINT8 EntryPointRevision;
UINT8 Reserved;
UINT32 TableMaximumSize;
UINT64 TableAddress;
} SMBIOS_TABLE_3_0_ENTRY_POINT;
UINT8 AnchorString[5];
UINT8 EntryPointStructureChecksum;
UINT8 EntryPointLength;
UINT8 MajorVersion;
UINT8 MinorVersion;
UINT8 DocRev;
UINT8 EntryPointRevision;
UINT8 Reserved;
UINT32 TableMaximumSize;
UINT64 TableAddress;
} SMBIOS_TABLE_3_0_ENTRY_POINT;
SMBIOS Structure
formmated section以長度4 byte的header起始,而接在header之後的資料格式根據Structure type有所不同。 optional unformed section則由文字字串組成。
SMBIOS Structure Header
| Offset   | Name   | Length   | Description   |
| 00h   | Type   | BYTE   | Structure的類型。Type 00h到 7Fh是預留給SMBIOS spec定義,而Type 80h到 FFh則讓系統廠可以自行 定義。  |
| 01h   | Length   | BYTE   | Structure formatted section的資料長度,從header的Type開始算起,不包含文字字串的 部分  |
| 02h   | Handle   | WORD   | 用來識別不同structure實體的一組16 bit number,其值範圍是從 FF00h到 FFFFh。  |
Text String
SMBIOS Structure的Text String區塊接在Structure的formatted section之後。而其是選擇性的, SMBIOS的Structure內並不一定要含有Text String。每個Text String的結尾都是null character(00h)。
在SMBIOS structure的formatted section中,需要使用Text String的時候,就需要填上一個非0 值。假設其填值為02h,就代表這個string field要去參考Text String區塊中的第二個Text String。若其 填為0,就代表此string field不使用Text String。
SPEC中的BIOS Infomation(Type 0)範例:
使用Text String的BIOS Infomation(Type 0)
BIOS_Info LABEL BYTE
db    0 ; Indicates BIOS Structure Type
db    13h ; Length of information in bytes
dw    ? ; Reserved for handle
db    01h ; String 1 is the Vendor Name
db    02h ; String 2 is the BIOS version
dw    0E800h ; BIOS Starting Address
db    03h ; String 3 is the BIOS Build Date
db    1 ; Size of BIOS ROM is 128K (64K * (1 + 1))
dq    BIOS_Char ; BIOS Characteristics
db    0 ; BIOS Characteristics Extension Byte 1
db    'System BIOS Vendor Name',0 ;
db    '4.04',0   ;
db    '00/00/0000',0 ;
db    0 ; End of strings
db    0 ; Indicates BIOS Structure Type
db    13h ; Length of information in bytes
dw    ? ; Reserved for handle
db    01h ; String 1 is the Vendor Name
db    02h ; String 2 is the BIOS version
dw    0E800h ; BIOS Starting Address
db    03h ; String 3 is the BIOS Build Date
db    1 ; Size of BIOS ROM is 128K (64K * (1 + 1))
dq    BIOS_Char ; BIOS Characteristics
db    0 ; BIOS Characteristics Extension Byte 1
db    'System BIOS Vendor Name',0 ;
db    '4.04',0   ;
db    '00/00/0000',0 ;
db    0 ; End of strings
沒有使用Text String的BIOS Infomation(Type 0)
BIOS_Info LABEL BYTE
db    0 ; Indicates BIOS Structure Type
db    13h ; Length of information in bytes
dw    ? ; Reserved for handle
db    00h ; No Vendor Name provided
db    00h ; No BIOS version provided
dw    0E800h ; BIOS Starting Address
db    00h ; No BIOS Build Date provided
db    1 ; Size of BIOS ROM is 128K (64K * (1 + 1))
dq    BIOS_Char ; BIOS Characteristics
db    0 ; BIOS Characteristics Extension Byte 1
dw    0000 ; Structure terminator
db    0 ; Indicates BIOS Structure Type
db    13h ; Length of information in bytes
dw    ? ; Reserved for handle
db    00h ; No Vendor Name provided
db    00h ; No BIOS version provided
dw    0E800h ; BIOS Starting Address
db    00h ; No BIOS Build Date provided
db    1 ; Size of BIOS ROM is 128K (64K * (1 + 1))
dq    BIOS_Char ; BIOS Characteristics
db    0 ; BIOS Characteristics Extension Byte 1
dw    0000 ; Structure terminator
訂閱:
文章 (Atom)