@@ -7,6 +7,7 @@ use alloc::string::String;
7
7
use alloc:: string:: ToString ;
8
8
use alloc:: vec:: Vec ;
9
9
use log:: Level ;
10
+ use num_traits:: FromPrimitive ;
10
11
11
12
#[ cfg( not( feature = "uefi" ) ) ]
12
13
pub mod clap_std;
@@ -39,6 +40,7 @@ use crate::ec_binary;
39
40
use crate :: esrt;
40
41
use crate :: power;
41
42
use crate :: smbios;
43
+ use crate :: smbios:: ConfigDigit0 ;
42
44
use crate :: smbios:: { dmidecode_string_val, get_smbios, is_framework} ;
43
45
#[ cfg( feature = "uefi" ) ]
44
46
use crate :: uefi:: enable_page_break;
@@ -786,7 +788,16 @@ fn smbios_info() {
786
788
DefinedStruct :: SystemInformation ( data) => {
787
789
println ! ( "System Information" ) ;
788
790
if let Some ( version) = dmidecode_string_val ( & data. version ( ) ) {
789
- println ! ( " Version: {}" , version) ;
791
+ // Assumes it's ASCII, which is guaranteed by SMBIOS
792
+ let config_digit0 = & version[ 0 ..1 ] ;
793
+ let config_digit0 = u8:: from_str_radix ( config_digit0, 16 ) . unwrap ( ) ;
794
+ if let Some ( version_config) =
795
+ <ConfigDigit0 as FromPrimitive >:: from_u8 ( config_digit0)
796
+ {
797
+ println ! ( " Version: {:?} ({})" , version_config, version) ;
798
+ } else {
799
+ println ! ( " Version: {}" , version) ;
800
+ }
790
801
}
791
802
if let Some ( manufacturer) = dmidecode_string_val ( & data. manufacturer ( ) ) {
792
803
println ! ( " Manufacturer: {}" , manufacturer) ;
0 commit comments