File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,8 @@ static __volatile__ struct limine_smbios_request smbios_request = {
1515int smbios_major_version (void ) {
1616 struct EntryPoint64 * entry = (struct EntryPoint64 * ) smbios_request .response -> entry_64 ;
1717 if (entry == NULL ){
18- return -1 ;
18+ struct EntryPoint32 * entry32 = (struct EntryPoint32 * ) smbios_request .response -> entry_32 ;
19+ return entry32 == NULL ? -1 : entry32 -> SMBIOSMajorVersion ;
1920 }
2021 return entry -> SMBIOSMajorVersion ;
2122}
@@ -24,7 +25,8 @@ int smbios_major_version(void) {
2425int smbios_minor_version (void ) {
2526 struct EntryPoint64 * entry = (struct EntryPoint64 * ) smbios_request .response -> entry_64 ;
2627 if (entry == NULL ){
27- return -1 ;
28+ struct EntryPoint32 * entry32 = (struct EntryPoint32 * )smbios_request .response -> entry_32 ;
29+ return entry32 == NULL ? -1 : entry32 -> SMBIOSMinorVersion ;
2830 }
2931 return entry -> SMBIOSMinorVersion ;
3032}
Original file line number Diff line number Diff line change @@ -20,6 +20,23 @@ struct EntryPoint64 {
2020 uint64_t StructureTableAddress ; // 结构表地址
2121};
2222
23+ struct EntryPoint32 {
24+ char AnchorString [4 ];
25+ uint8_t EntryPointChecksum ; // 入口点校验和
26+ uint8_t EntryPointLength ; // 入口点结构长度
27+ uint8_t SMBIOSMajorVersion ; // SMBIOS主版本
28+ uint8_t SMBIOSMinorVersion ; // SMBIOS次版本
29+ uint8_t SMBIOSDocrev ; // 文档修订版
30+ uint8_t EntryPointRevision ; // 入口点修订版
31+ uint8_t FormattedArea [5 ]; // 保留
32+ uint8_t IntermediateAnchorString [5 ];
33+ uint8_t IntermediateChecksum ;
34+ uint16_t StructureTableMaxSize ; // 结构表最大大小
35+ uint32_t StructureTableAddress ; // 结构表地址
36+ uint16_t NumberOfStructures ; // 结构数量
37+ uint8_t BCDRevision ; // BCD修订
38+ };
39+
2340/* 结构表头部 */
2441struct Header {
2542 uint8_t type ; // 结构类型
You can’t perform that action at this time.
0 commit comments