aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-11-20 16:49:42 +0100
committerErwan Velu <erwan.velu@free.fr>2009-11-20 16:49:42 +0100
commite9af8d807c3ab7b1a880bb307454481fd9a7150e (patch)
tree688f8995f6279f42a5fe3e17740bef5abde46b88
parent30078a2b872a3e137d4809ffab53f34377ffce98 (diff)
downloadsyslinux-e9af8d807c3ab7b1a880bb307454481fd9a7150e.tar.gz
syslinux-e9af8d807c3ab7b1a880bb307454481fd9a7150e.tar.xz
syslinux-e9af8d807c3ab7b1a880bb307454481fd9a7150e.zip
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.
-rw-r--r--com32/hdt/hdt-common.c6
-rw-r--r--com32/hdt/hdt-common.h9
-rw-r--r--com32/hdt/hdt.c18
3 files changed, 26 insertions, 7 deletions
diff --git a/com32/hdt/hdt-common.c b/com32/hdt/hdt-common.c
index 55b0b7e1..cdcd6954 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 f178b223..cd1dc3ca 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 30cb0629..6daf3ae4 100644
--- a/com32/hdt/hdt.c
+++ b/com32/hdt/hdt.c
@@ -35,6 +35,7 @@
#include <stdio.h>
#include <console.h>
#include <consoles.h>
+#include <syslinux/vesacon.h>
#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 {