aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-02-22 07:08:45 +0100
committerH. Peter Anvin <hpa@zytor.com>2009-02-25 20:58:43 -0800
commitf49d7bf0b91c67e5be74f2219788731317b03b02 (patch)
tree04549d0fb100bcbcb40fcaa12a10c1b492080552
parenta08ad3c383f507e6e9be90d6b7df50d327e29574 (diff)
downloadsyslinux-elf-f49d7bf0b91c67e5be74f2219788731317b03b02.tar.gz
syslinux-elf-f49d7bf0b91c67e5be74f2219788731317b03b02.tar.xz
syslinux-elf-f49d7bf0b91c67e5be74f2219788731317b03b02.zip
hdt: Menu: Only display detected DMI modules Menu: Using "Memory banks" instead of "Memory Modules" DMI: Fixing error code when no memory module is installed
-rw-r--r--com32/hdt/hdt-menu-dmi.c8
-rw-r--r--com32/hdt/hdt-menu.c53
-rw-r--r--com32/include/dmi/dmi_memory.h2
3 files changed, 41 insertions, 22 deletions
diff --git a/com32/hdt/hdt-menu-dmi.c b/com32/hdt/hdt-menu-dmi.c
index 4681a827..485f25ec 100644
--- a/com32/hdt/hdt-menu-dmi.c
+++ b/com32/hdt/hdt-menu-dmi.c
@@ -210,7 +210,7 @@ void compute_memory_module(struct s_my_menu *menu, s_dmi *dmi, int slot_number)
char buffer[MENULEN+1];
char statbuffer[STATLEN+1];
- sprintf(buffer," Module <%d> ",i);
+ sprintf(buffer," Bank <%d> ",i);
menu->items_count=0;
menu->menu = add_menu(buffer,-1);
@@ -298,12 +298,12 @@ void compute_memory(struct s_hdt_menu *menu, s_dmi *dmi) {
compute_memory_module(&(menu->memory_sub_menu[i]),dmi,i);
}
- menu->memory_menu.menu = add_menu(" Modules ",-1);
+ menu->memory_menu.menu = add_menu(" Memory Banks ",-1);
menu->memory_menu.items_count=0;
for (int i=0;i<dmi->memory_count;i++) {
- snprintf(buffer,sizeof buffer," Module <%d> ",i);
- add_item(buffer,"Memory Module",OPT_SUBMENU,NULL,menu->memory_sub_menu[i].menu);
+ snprintf(buffer,sizeof buffer," Bank <%d> ",i);
+ add_item(buffer,"Memory Bank",OPT_SUBMENU,NULL,menu->memory_sub_menu[i].menu);
menu->memory_menu.items_count++;
}
printf("MENU: Memory menu done (%d items)\n",menu->memory_menu.items_count);
diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c
index df6a5b55..e24866e1 100644
--- a/com32/hdt/hdt-menu.c
+++ b/com32/hdt/hdt-menu.c
@@ -121,12 +121,17 @@ void setup_menu(char *version) {
void compute_submenus(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware) {
/* Compute this menus if a DMI table exist */
if (hardware->is_dmi_valid) {
- compute_motherboard(&(hdt_menu->mobo_menu),&(hardware->dmi));
- compute_chassis(&(hdt_menu->chassis_menu),&(hardware->dmi));
- compute_system(&(hdt_menu->system_menu),&(hardware->dmi));
- compute_memory(hdt_menu,&(hardware->dmi));
- compute_bios(&(hdt_menu->bios_menu),&(hardware->dmi));
- compute_battery(&(hdt_menu->battery_menu),&(hardware->dmi));
+ if (hardware->dmi.base_board.filled==true) compute_motherboard(&(hdt_menu->mobo_menu),&(hardware->dmi));
+ if (hardware->dmi.chassis.filled==true) compute_chassis(&(hdt_menu->chassis_menu),&(hardware->dmi));
+ if (hardware->dmi.system.filled==true) compute_system(&(hdt_menu->system_menu),&(hardware->dmi));
+ for (int i=0;i<hardware->dmi.memory_count;i++) {
+ if (hardware->dmi.memory[i].filled==true) {
+ compute_memory(hdt_menu,&(hardware->dmi));
+ break;
+ }
+ }
+ if (hardware->dmi.bios.filled==true) compute_bios(&(hdt_menu->bios_menu),&(hardware->dmi));
+ if (hardware->dmi.battery.filled==true) compute_battery(&(hdt_menu->battery_menu),&(hardware->dmi));
}
compute_processor(&(hdt_menu->cpu_menu),hardware);
@@ -160,7 +165,7 @@ void compute_main_menu(struct s_hdt_menu *hdt_menu,struct s_hardware *hardware)
}
if (hdt_menu->memory_menu.items_count>0) {
- add_item("<M>emory Modules","Memory Modules Menu",OPT_SUBMENU,NULL,hdt_menu->memory_menu.menu);
+ add_item("<M>emory","Memory Menu",OPT_SUBMENU,NULL,hdt_menu->memory_menu.menu);
hdt_menu->main_menu.items_count++;
hdt_menu->total_menu_count+=hdt_menu->memory_menu.items_count;
}
@@ -168,16 +173,30 @@ void compute_main_menu(struct s_hdt_menu *hdt_menu,struct s_hardware *hardware)
hdt_menu->main_menu.items_count++;
if (hardware->is_dmi_valid) {
- add_item("M<o>therboard","Motherboard Menu",OPT_SUBMENU,NULL,hdt_menu->mobo_menu.menu);
- hdt_menu->main_menu.items_count++;
- add_item("<B>ios","Bios Menu",OPT_SUBMENU,NULL,hdt_menu->bios_menu.menu);
- hdt_menu->main_menu.items_count++;
- add_item("<C>hassis","Chassis Menu",OPT_SUBMENU,NULL,hdt_menu->chassis_menu.menu);
- hdt_menu->main_menu.items_count++;
- add_item("<S>ystem","System Menu",OPT_SUBMENU,NULL,hdt_menu->system_menu.menu);
- hdt_menu->main_menu.items_count++;
- add_item("Ba<t>tery","Battery Menu",OPT_SUBMENU,NULL,hdt_menu->battery_menu.menu);
- hdt_menu->main_menu.items_count++;
+ if (hardware->dmi.base_board.filled==true) {
+ add_item("M<o>therboard","Motherboard Menu",OPT_SUBMENU,NULL,hdt_menu->mobo_menu.menu);
+ hdt_menu->main_menu.items_count++;
+ }
+
+ if (hardware->dmi.bios.filled==true) {
+ add_item("<B>ios","Bios Menu",OPT_SUBMENU,NULL,hdt_menu->bios_menu.menu);
+ hdt_menu->main_menu.items_count++;
+ }
+
+ if (hardware->dmi.chassis.filled==true) {
+ add_item("<C>hassis","Chassis Menu",OPT_SUBMENU,NULL,hdt_menu->chassis_menu.menu);
+ hdt_menu->main_menu.items_count++;
+ }
+
+ if (hardware->dmi.system.filled==true) {
+ add_item("<S>ystem","System Menu",OPT_SUBMENU,NULL,hdt_menu->system_menu.menu);
+ hdt_menu->main_menu.items_count++;
+ }
+
+ if (hardware->dmi.battery.filled==true) {
+ add_item("Ba<t>tery","Battery Menu",OPT_SUBMENU,NULL,hdt_menu->battery_menu.menu);
+ hdt_menu->main_menu.items_count++;
+ }
}
add_item("","",OPT_SEP,"",0);
#ifdef WITH_PCI
diff --git a/com32/include/dmi/dmi_memory.h b/com32/include/dmi/dmi_memory.h
index dffe4c61..2491f6ea 100644
--- a/com32/include/dmi/dmi_memory.h
+++ b/com32/include/dmi/dmi_memory.h
@@ -75,7 +75,7 @@ static void dmi_memory_device_width(u16 code, char *width)
static void dmi_memory_device_size(u16 code, char *size)
{
if (code == 0)
- sprintf(size,"%s","No Module Installed");
+ sprintf(size,"%s","Free");
else if (code == 0xFFFF)
sprintf(size,"%s","Unknown");
else {