aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-15 20:34:48 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-15 20:34:48 +0100
commit0fd6883238130b5014ec339692718ce624ba6cd6 (patch)
tree5ac19b4d5fa1b77bb5d14ff756d415553eda8df7 /com32/hdt
parent9ee00e08b773923e9e259c12b811a2b130319608 (diff)
downloadsyslinux.git-0fd6883238130b5014ec339692718ce624ba6cd6.tar.gz
syslinux.git-0fd6883238130b5014ec339692718ce624ba6cd6.tar.xz
syslinux.git-0fd6883238130b5014ec339692718ce624ba6cd6.zip
hdt: Uploading missing vesa files
The vesa files were missing
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-cli-vesa.c91
-rw-r--r--com32/hdt/hdt-menu-vesa.c106
2 files changed, 197 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli-vesa.c b/com32/hdt/hdt-cli-vesa.c
new file mode 100644
index 00000000..4f9179dc
--- /dev/null
+++ b/com32/hdt/hdt-cli-vesa.c
@@ -0,0 +1,91 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * 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-cli.h"
+#include "hdt-common.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+
+void main_show_vesa(struct s_hardware *hardware) {
+ detect_vesa(hardware);
+ if (hardware->is_vesa_valid==false) {
+ more_printf("No VESA BIOS detected\n");
+ return;
+ }
+ more_printf("VESA\n");
+ more_printf(" Vesa version : %d.%d\n",hardware->vesa.major_version, hardware->vesa.minor_version);
+ more_printf(" Vendor : %s\n",hardware->vesa.vendor);
+ more_printf(" Product : %s\n",hardware->vesa.product);
+ more_printf(" Product rev. : %s\n",hardware->vesa.product_revision);
+ more_printf(" Software rev.: %s\n",hardware->vesa.software_rev);
+ more_printf(" Memory (KB) : %d\n",hardware->vesa.total_memory*64);
+ more_printf(" Modes : %d\n",hardware->vesa.vmi_count);
+}
+
+void show_vesa_modes(struct s_hardware *hardware) {
+ detect_vesa(hardware);
+ if (hardware->is_vesa_valid==false) {
+ more_printf("No VESA BIOS detected\n");
+ return;
+ }
+ clear_screen();
+ more_printf(" ResX x ResY x Bits : Kernel Mode : Vesa Mode\n",hardware->vesa.vmi_count);
+ more_printf("---------------------------------------------\n",hardware->vesa.vmi_count);
+
+ for (int i=0;i<hardware->vesa.vmi_count;i++) {
+ struct vesa_mode_info *mi=&hardware->vesa.vmi[i].mi;
+ more_printf("%5u %5u %3u %3d 0x%04x\n",
+ mi->h_res, mi->v_res, mi->bpp, hardware->vesa.vmi[i].mode+0x200,hardware->vesa.vmi[i].mode);
+ }
+}
+
+void show_vesa_help() {
+ more_printf("Show supports the following commands : %s %s\n",CLI_SHOW_LIST, CLI_MODES);
+}
+
+void vesa_show(char *item, struct s_hardware *hardware) {
+ if ( !strncmp(item, CLI_SHOW_LIST, sizeof(CLI_SHOW_LIST) - 1) ) {
+ main_show_vesa(hardware);
+ return;
+ }
+ if ( !strncmp(item, CLI_MODES, sizeof(CLI_MODES) - 1) ) {
+ show_vesa_modes(hardware);
+ return;
+ }
+ show_vesa_help();
+}
+
+void handle_vesa_commands(char *cli_line, struct s_hardware *hardware) {
+ if ( !strncmp(cli_line, CLI_SHOW, sizeof(CLI_SHOW) - 1) ) {
+ vesa_show(strstr(cli_line,"show")+ sizeof(CLI_SHOW), hardware);
+ return;
+ }
+}
+
diff --git a/com32/hdt/hdt-menu-vesa.c b/com32/hdt/hdt-menu-vesa.c
new file mode 100644
index 00000000..dbd94275
--- /dev/null
+++ b/com32/hdt/hdt-menu-vesa.c
@@ -0,0 +1,106 @@
+/* ----------------------------------------------------------------------- *
+ *
+ * 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"
+
+
+/* Submenu for the vesa card */
+void compute_vesa_card(struct s_my_menu *menu, struct s_hardware *hardware) {
+ char buffer[SUBMENULEN+1];
+ char statbuffer[STATLEN+1];
+
+ menu->menu = add_menu(" VESA Card ",-1);
+ menu->items_count=0;
+ set_menu_pos(SUBMENU_Y,SUBMENU_X);
+
+ snprintf(buffer,sizeof buffer,"VESA Version: %d.%d",hardware->vesa.major_version,hardware->vesa.minor_version);
+ snprintf(statbuffer,sizeof statbuffer,"Version: %d.%d",hardware->vesa.major_version,hardware->vesa.minor_version);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,"Vendor : %s",hardware->vesa.vendor);
+ snprintf(statbuffer,sizeof statbuffer,"Vendor Name: %s",hardware->vesa.vendor);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,"Product : %s",hardware->vesa.product);
+ snprintf(statbuffer,sizeof statbuffer,"Product Name: %s",hardware->vesa.product);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,"Product Rev.: %s",hardware->vesa.product_revision);
+ snprintf(statbuffer,sizeof statbuffer,"Produt Revision: %s",hardware->vesa.product_revision);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,"Software Rev: %s",hardware->vesa.software_rev);
+ snprintf(statbuffer,sizeof statbuffer,"Software Revision: %s",hardware->vesa.software_rev);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+
+ snprintf(buffer,sizeof buffer,"Memory (KB) : %d",hardware->vesa.total_memory*64);
+ snprintf(statbuffer,sizeof statbuffer,"Memory (KB): %d",hardware->vesa.total_memory*64);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+}
+
+/* Submenu for the vesa card */
+void compute_vesa_modes(struct s_my_menu *menu, struct s_hardware *hardware) {
+ char buffer[56];
+ char statbuffer[STATLEN];
+
+ menu->menu = add_menu(" VESA Modes ",-1);
+ menu->items_count=0;
+ set_menu_pos(SUBMENU_Y,SUBMENU_X);
+ for (int i=0;i<hardware->vesa.vmi_count;i++) {
+ struct vesa_mode_info *mi=&hardware->vesa.vmi[i].mi;
+ snprintf(buffer,sizeof buffer,"%4u x %4u x %2ubits vga=%3d",
+ mi->h_res, mi->v_res, mi->bpp, hardware->vesa.vmi[i].mode+0x200);
+ snprintf(statbuffer,sizeof statbuffer,"%4ux%4ux%2ubits vga=%3d",
+ mi->h_res, mi->v_res, mi->bpp, hardware->vesa.vmi[i].mode+0x200);
+ add_item(buffer,statbuffer,OPT_INACTIVE,NULL,0);
+ menu->items_count++;
+ }
+}
+
+/* Main VESA Menu*/
+int compute_VESA(struct s_hdt_menu *hdt_menu, struct s_hardware *hardware) {
+ char buffer[15];
+ compute_vesa_card(&hdt_menu->vesa_card_menu,hardware);
+ compute_vesa_modes(&hdt_menu->vesa_modes_menu,hardware);
+ hdt_menu->vesa_menu.menu = add_menu(" VESA ",-1);
+ hdt_menu->vesa_menu.items_count=0;
+
+ add_item("VESA Card","VESA Card",OPT_SUBMENU,NULL,hdt_menu->vesa_card_menu.menu);
+ hdt_menu->vesa_menu.items_count++;
+ snprintf(buffer,sizeof buffer,"%s (%d)","Modes",hardware->vesa.vmi_count);
+ add_item(buffer,"VESA Modes",OPT_SUBMENU,NULL,hdt_menu->vesa_modes_menu.menu);
+ hdt_menu->vesa_menu.items_count++;
+ printf("MENU: VESA menu done (%d items)\n",hdt_menu->vesa_menu.items_count);
+ return 0;
+}