From: Erwan Velu Date: Fri, 20 Nov 2009 15:49:42 +0000 (+0100) Subject: hdt: Adding vesa mode support X-Git-Tag: syslinux-3.84-pre5~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9af8d807c3ab7b1a880bb307454481fd9a7150e;p=platform%2Fupstream%2Fsyslinux.git hdt: Adding vesa mode support Impact: cli can now be turned into vesa Using the "vesa" keyword at boot time, you can enable the vesa mode for the cli. --- diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c index 55b0b7e..cdcd695 100644 --- a/com32/hdt/hdt-common.c +++ b/com32/hdt/hdt-common.c @@ -58,6 +58,9 @@ void detect_parameters(const int argc, const char *argv[], /* Quiet mode - make the output more quiet */ quiet = false; + /* Vesa mode isn't set until we explictly call it*/ + vesamode = false; + for (int i = 1; i < argc; i++) { if (!strncmp(argv[i], "quiet", 5)) { quiet = true; @@ -81,6 +84,9 @@ void detect_parameters(const int argc, const char *argv[], strncpy(hardware->reboot_label, argv[i] + 7, sizeof(hardware->reboot_label)); convert_isolinux_filename(hardware->reboot_label,hardware); + } else if (!strncmp(argv[i], "vesa", 4)) { + vesamode=true; + max_console_lines=24; } else if (!strncmp(argv[i], "auto=", 5)) { /* The auto= parameter is separated in several argv[] * as it can contains spaces. diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index f178b22..cd1dc3c 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -69,6 +69,13 @@ /* Defines if the cli is quiet*/ bool quiet; +/* Defines if we must use the vesa mode */ +bool vesamode; + +/* Defines the number of lines in the console + * Default is 20 for a std console */ +extern int max_console_lines; + extern int display_line_nb; extern bool disable_more_printf; @@ -84,7 +91,7 @@ extern bool disable_more_printf; */ #define more_printf(...) do {\ if (__likely(!disable_more_printf)) {\ - if (display_line_nb == 20) {\ + if (display_line_nb == max_console_lines) {\ display_line_nb=0;\ printf("\n--More--");\ get_key(stdin, 0);\ diff --git a/com32/hdt/hdt.c b/com32/hdt/hdt.c index 30cb062..6daf3ae 100644 --- a/com32/hdt/hdt.c +++ b/com32/hdt/hdt.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "hdt.h" #include "hdt-cli.h" #include "hdt-menu.h" @@ -42,6 +43,9 @@ int display_line_nb = 0; bool disable_more_printf = false; +/* Defines the number of lines in the console + * Default is 20 for a std console */ +int max_console_lines=20; int main(const int argc, const char *argv[]) { @@ -52,23 +56,25 @@ int main(const int argc, const char *argv[]) snprintf(version_string, sizeof version_string, "%s %s (%s)", PRODUCT_NAME,VERSION, CODENAME); + /* Detecting parameters */ + detect_parameters(argc, argv, &hardware); + /* Opening the Syslinux console */ - console_ansi_raw(); + if (vesamode) openconsole(&dev_rawcon_r, &dev_vesaserial_w); + else console_ansi_raw(); /* Cleaning structures */ init_hardware(&hardware); /* Detecting Syslinux version */ detect_syslinux(&hardware); - - /* Detecting parameters */ - detect_parameters(argc, argv, &hardware); - + /* Clear the screen and reset position of the cursor */ clear_screen(); printf("\033[1;1H"); - + printf("%s\n", version_string); + if ((arg = find_argument(argv + 1, "nomenu")) || (find_argument(argv+1,"auto"))) start_cli_mode(&hardware); else {