@@ -7,6 +7,7 @@ use alloc::string::String;
77use alloc:: string:: ToString ;
88use alloc:: vec:: Vec ;
99use log:: Level ;
10+ use num_traits:: FromPrimitive ;
1011
1112#[ cfg( not( feature = "uefi" ) ) ]
1213pub mod clap_std;
@@ -39,6 +40,7 @@ use crate::ec_binary;
3940use crate :: esrt;
4041use crate :: power;
4142use crate :: smbios;
43+ use crate :: smbios:: ConfigDigit0 ;
4244use crate :: smbios:: { dmidecode_string_val, get_smbios, is_framework} ;
4345#[ cfg( feature = "uefi" ) ]
4446use crate :: uefi:: enable_page_break;
@@ -786,7 +788,16 @@ fn smbios_info() {
786788 DefinedStruct :: SystemInformation ( data) => {
787789 println ! ( "System Information" ) ;
788790 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+ }
790801 }
791802 if let Some ( manufacturer) = dmidecode_string_val ( & data. manufacturer ( ) ) {
792803 println ! ( " Manufacturer: {}" , manufacturer) ;
0 commit comments