@@ -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;
@@ -751,7 +753,16 @@ fn smbios_info() {
751
753
DefinedStruct :: SystemInformation ( data) => {
752
754
println ! ( "System Information" ) ;
753
755
if let Some ( version) = dmidecode_string_val ( & data. version ( ) ) {
754
- println ! ( " Version: {}" , version) ;
756
+ // Assumes it's ASCII, which is guaranteed by SMBIOS
757
+ let config_digit0 = & version[ 0 ..1 ] ;
758
+ let config_digit0 = u8:: from_str_radix ( config_digit0, 16 ) . unwrap ( ) ;
759
+ if let Some ( version_config) =
760
+ <ConfigDigit0 as FromPrimitive >:: from_u8 ( config_digit0)
761
+ {
762
+ println ! ( " Version: {:?} ({})" , version_config, version) ;
763
+ } else {
764
+ println ! ( " Version: {}" , version) ;
765
+ }
755
766
}
756
767
if let Some ( manufacturer) = dmidecode_string_val ( & data. manufacturer ( ) ) {
757
768
println ! ( " Manufacturer: {}" , manufacturer) ;
0 commit comments