diff options
author | H. Peter Anvin <hpa@linux.intel.com> | 2009-03-02 10:40:49 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@linux.intel.com> | 2009-03-02 10:40:49 -0800 |
commit | 13aa7ae1146f23322844c3531686f27f1af7d8fd (patch) | |
tree | 40ae5e5a84c62e4a99acb717493846461617132f | |
parent | cec06cac17751fed108150f416fe121f30e25faa (diff) | |
parent | 5b71509662a5b6167f95233c7f0824b4031130b2 (diff) | |
download | syslinux-elf-13aa7ae1146f23322844c3531686f27f1af7d8fd.tar.gz syslinux-elf-13aa7ae1146f23322844c3531686f27f1af7d8fd.tar.xz syslinux-elf-13aa7ae1146f23322844c3531686f27f1af7d8fd.zip |
Merge commit 'erwan-hdt/master' into hdt
-rw-r--r-- | com32/hdt/Makefile | 1 | ||||
-rw-r--r-- | com32/hdt/hdt-cli-dmi.c | 10 | ||||
-rw-r--r-- | com32/hdt/hdt-cli-kernel.c | 1 | ||||
-rw-r--r-- | com32/hdt/hdt-cli.c | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-cli.h | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-menu-pxe.c | 99 | ||||
-rw-r--r-- | com32/hdt/hdt-menu.c | 11 | ||||
-rw-r--r-- | com32/hdt/hdt-menu.h | 4 | ||||
-rw-r--r-- | com32/hdt/hdt.h | 2 |
9 files changed, 123 insertions, 9 deletions
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile index 15044d48..a8f87c91 100644 --- a/com32/hdt/Makefile +++ b/com32/hdt/Makefile @@ -44,6 +44,7 @@ all: hdt.c32 $(LIB) hdt.elf: hdt.o hdt-ata.o hdt-menu.o hdt-menu-pci.o hdt-menu-kernel.o \ hdt-menu-disk.o hdt-menu-dmi.o hdt-menu-processor.o hdt-menu-syslinux.o hdt-menu-about.o \ hdt-cli.o hdt-common.o hdt-cli-pci.o hdt-cli-dmi.o hdt-cli-cpu.o hdt-cli-pxe.o hdt-cli-kernel.o\ + hdt-menu-pxe.o\ $(com32)/modules/cpuid.o $(com32)/modules/dmi.o $(topdir)/menu/libmenu/libmenu.a $(LIB) $(C_LIBS) $(LD) $(LDFLAGS) -o $@ $^ diff --git a/com32/hdt/hdt-cli-dmi.c b/com32/hdt/hdt-cli-dmi.c index b3c486dc..287786ff 100644 --- a/com32/hdt/hdt-cli-dmi.c +++ b/com32/hdt/hdt-cli-dmi.c @@ -57,7 +57,7 @@ void dmi_show(char *item, struct s_hardware *hardware) { return; } if ( !strncmp(item, CLI_DMI_MEMORY, sizeof(CLI_DMI_MEMORY) - 1) ) { - show_dmi_memory_modules(hardware,true); + show_dmi_memory_modules(hardware,true,true); return; } if ( !strncmp(item, CLI_DMI_MEMORY_BANK, sizeof(CLI_DMI_MEMORY_BANK) - 1) ) { @@ -271,7 +271,7 @@ void show_dmi_cpu(struct s_hardware *hardware) { more_printf(" Cpu Model : %u\n",hardware->dmi.processor.signature.model); more_printf(" Cpu Stepping : %u\n",hardware->dmi.processor.signature.stepping); more_printf(" Cpu Minor Stepping : %u\n",hardware->dmi.processor.signature.minor_stepping); - //more_printf(" Voltage %f\n",hardware->dmi.processor.voltage); +// more_printf(" Voltage : %f\n",hardware->dmi.processor.voltage); more_printf(" Status : %s\n",hardware->dmi.processor.status); more_printf(" Upgrade : %s\n",hardware->dmi.processor.upgrade); more_printf(" Cache L1 Handle : %s\n",hardware->dmi.processor.cache1); @@ -288,7 +288,7 @@ void show_dmi_cpu(struct s_hardware *hardware) { } -void show_dmi_memory_modules(struct s_hardware *hardware, bool clear) { +void show_dmi_memory_modules(struct s_hardware *hardware, bool clear, bool show_free_banks) { char bank_number[10]; char available_dmi_commands[1024]; memset(available_dmi_commands,0,sizeof(available_dmi_commands)); @@ -307,8 +307,12 @@ void show_dmi_memory_modules(struct s_hardware *hardware, bool clear) { memset(bank_number,0,sizeof(bank_number)); snprintf(bank_number,sizeof(bank_number),"%d ",i); strncat(available_dmi_commands,bank_number,sizeof(bank_number)); + if (show_free_banks==false) { if (strncmp(hardware->dmi.memory[i].size,"Free",4)) printf(" bank %02d : %s %s@%s\n",i,hardware->dmi.memory[i].size, hardware->dmi.memory[i].type, hardware->dmi.memory[i].speed); + } else { + printf(" bank %02d : %s %s@%s\n",i,hardware->dmi.memory[i].size, hardware->dmi.memory[i].type, hardware->dmi.memory[i].speed); + } } } //printf("Type 'show bank<bank_number>' for more details.\n"); diff --git a/com32/hdt/hdt-cli-kernel.c b/com32/hdt/hdt-cli-kernel.c index 0485ca00..62ca5370 100644 --- a/com32/hdt/hdt-cli-kernel.c +++ b/com32/hdt/hdt-cli-kernel.c @@ -32,7 +32,6 @@ #include <string.h> #include <stdlib.h> #include <errno.h> -#include <syslinux/pxe.h> void main_show_kernel(struct s_hardware *hardware,struct s_cli_mode *cli_mode) { char buffer[1024]; diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 25658808..6819471d 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -197,7 +197,7 @@ void main_show_summary(struct s_hardware *hardware, struct s_cli_mode *cli_mode) more_printf("Bios\n"); more_printf(" Version : %s\n",hardware->dmi.bios.version); more_printf(" Release : %s\n",hardware->dmi.bios.release_date); - show_dmi_memory_modules(hardware,false); + show_dmi_memory_modules(hardware,false,false); } main_show_pci(hardware); if (hardware->is_pxe_valid) diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h index 31a5c0d4..2dcabb51 100644 --- a/com32/hdt/hdt-cli.h +++ b/com32/hdt/hdt-cli.h @@ -84,7 +84,7 @@ void show_dmi_bios(struct s_hardware *hardware); void show_dmi_chassis(struct s_hardware *hardware); void show_dmi_cpu(struct s_hardware *hardware); void show_dmi_modules(struct s_hardware *hardware); -void show_dmi_memory_modules(struct s_hardware *hardware,bool clearscreen); +void show_dmi_memory_modules(struct s_hardware *hardware,bool clearscreen, bool show_free_banks); void show_dmi_memory_bank(struct s_hardware *hardware, const char *item); void show_dmi_battery(struct s_hardware *hardware); diff --git a/com32/hdt/hdt-menu-pxe.c b/com32/hdt/hdt-menu-pxe.c new file mode 100644 index 00000000..5ab3d8b3 --- /dev/null +++ b/com32/hdt/hdt-menu-pxe.c @@ -0,0 +1,99 @@ +/* ----------------------------------------------------------------------- * + * + * Copyright 2009 Erwan Velu - All Rights Reserved + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall + * be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * ----------------------------------------------------------------------- +*/ + +#include "hdt-menu.h" + +/* Main Kernel Menu*/ +void compute_PXE(struct s_my_menu *menu,struct s_hardware *hardware) { + char buffer[SUBMENULEN+1]; + char infobar[STATLEN+1]; + + if (hardware->is_pxe_valid==false) return; + + menu->menu = add_menu(" PXE ",-1); + menu->items_count=0; + set_menu_pos(SUBMENU_Y,SUBMENU_X); + + struct s_pxe *p = &hardware->pxe; + + if (hardware->pci_ids_return_code == -ENOPCIIDS) { + snprintf(buffer,sizeof buffer, "PCI Vendor : %d",p->vendor_id); + snprintf(infobar,sizeof infobar,"PCI Vendor : %d",p->vendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Product : %d",p->vendor_id); + snprintf(infobar,sizeof infobar,"PCI Product : %d",p->vendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI SubVendor : %d",p->subvendor_id); + snprintf(infobar,sizeof infobar,"PCI SubVendor : %d",p->subvendor_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI SubProduct : %d",p->subproduct_id); + snprintf(infobar,sizeof infobar,"PCI SubProduct : %d",p->subproduct_id); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Revision : %d",p->rev); + snprintf(infobar,sizeof infobar,"PCI Revision : %d",p->rev); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "PCI Bus Pos. : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func); + snprintf(infobar,sizeof infobar,"PCI Bus Pos. : %02x:%02x.%02x",p->pci_bus,p->pci_dev, p->pci_func); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + } else { + + snprintf(buffer,sizeof buffer, "Manufacturer : %s", p->pci_device->dev_info->vendor_name); + snprintf(infobar,sizeof infobar,"Manufacturer : %s", p->pci_device->dev_info->vendor_name); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "Product : %s", p->pci_device->dev_info->product_name); + snprintf(infobar,sizeof infobar,"Product : %s", p->pci_device->dev_info->product_name); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + } + + snprintf(buffer,sizeof buffer, "MAC Address : %s", p->mac_addr); + snprintf(infobar,sizeof infobar, "MAC Address : %s", p->mac_addr); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + snprintf(buffer,sizeof buffer, "IP Address : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]); + snprintf(infobar,sizeof infobar, "IP Address : %d.%d.%d.%d", p->ip_addr[0], p->ip_addr[1], p->ip_addr[2], p->ip_addr[3]); + add_item(buffer,infobar,OPT_INACTIVE,NULL,0); + menu->items_count++; + + printf("MENU: PXE menu done (%d items)\n",menu->items_count); +} diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c index 65129003..0c5bfe58 100644 --- a/com32/hdt/hdt-menu.c +++ b/com32/hdt/hdt-menu.c @@ -140,6 +140,7 @@ void compute_submenus(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware) compute_disks(hdt_menu,hardware->disk_info); #ifdef WITH_PCI compute_PCI(hdt_menu,hardware); + compute_PXE(&(hdt_menu->pxe_menu),hardware); compute_kernel(&(hdt_menu->kernel_menu),hardware); #endif compute_syslinuxmenu(&(hdt_menu->syslinux_menu)); @@ -205,9 +206,15 @@ if (hardware->is_dmi_valid) { } add_item("","",OPT_SEP,"",0); #ifdef WITH_PCI - add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu); - hdt_menu->main_menu.items_count++; + if (hardware->modules_pcimap_return_code != -ENOMODULESPCIMAP) { + add_item("<K>ernel Modules","Kernel Modules Menu",OPT_SUBMENU,NULL,hdt_menu->kernel_menu.menu); + hdt_menu->main_menu.items_count++; + } #endif + if (hardware->is_pxe_valid == true) { + add_item("P<X>E","PXE Information Menu",OPT_SUBMENU,NULL,hdt_menu->pxe_menu.menu); + hdt_menu->main_menu.items_count++; + } add_item("<S>yslinux","Syslinux Information Menu",OPT_SUBMENU,NULL,hdt_menu->syslinux_menu.menu); hdt_menu->main_menu.items_count++; add_item("S<w>itch to CLI","Switch to Command Line",OPT_RUN,HDT_SWITCH_TO_CLI,0); diff --git a/com32/hdt/hdt-menu.h b/com32/hdt/hdt-menu.h index 9c614595..725da458 100644 --- a/com32/hdt/hdt-menu.h +++ b/com32/hdt/hdt-menu.h @@ -70,6 +70,7 @@ struct s_hdt_menu { struct s_my_menu battery_menu; struct s_my_menu syslinux_menu; struct s_my_menu about_menu; + struct s_my_menu pxe_menu; int total_menu_count; // sum of all menus we have }; @@ -105,6 +106,9 @@ void compute_syslinuxmenu(struct s_my_menu *menu); // About menu void compute_aboutmenu(struct s_my_menu *menu); +//PXE menu +void compute_PXE(struct s_my_menu *menu,struct s_hardware *hardware); + int start_menu_mode(struct s_hardware *hardware, char *version_string); void setup_menu(char *version); void compute_main_menu(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware); diff --git a/com32/hdt/hdt.h b/com32/hdt/hdt.h index a9436b1f..ba847d54 100644 --- a/com32/hdt/hdt.h +++ b/com32/hdt/hdt.h @@ -32,7 +32,7 @@ #define PRODUCT_NAME "Hardware Detection Tool" #define AUTHOR "Erwan Velu" #define CONTACT "erwan(dot)velu(point)free(dot)fr" -#define VERSION "0.2.0" +#define VERSION "0.2.1" #define ATTR_PACKED __attribute__((packed)) |