[syslinux:master] Clean up the version/copyright strings reported via the comboot API

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Tue Mar 30 13:39:37 PDT 2010


Commit-ID:  99c5243867c4e00f516ba622bf4ba249aeb9f115
Gitweb:     http://syslinux.zytor.com/commit/99c5243867c4e00f516ba622bf4ba249aeb9f115
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Tue, 30 Mar 2010 13:37:41 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Tue, 30 Mar 2010 13:37:41 -0700

Clean up the version/copyright strings reported via the comboot API

Skip leading garbage in the version and copyright strings reported via
the comboot API.  Clean up fixes for those, and document the situation.

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 com32/hdt/hdt-cli-syslinux.c  |    4 ++--
 com32/hdt/hdt-menu-syslinux.c |    8 ++++----
 core/comboot.inc              |    4 ++--
 core/diskstart.inc            |    5 ++---
 doc/comboot.txt               |    4 ++++
 5 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/com32/hdt/hdt-cli-syslinux.c b/com32/hdt/hdt-cli-syslinux.c
index 6c231ed..302ca24 100644
--- a/com32/hdt/hdt-cli-syslinux.c
+++ b/com32/hdt/hdt-cli-syslinux.c
@@ -42,10 +42,10 @@ void main_show_syslinux(int argc __unused, char **argv __unused,
     reset_more_printf();
     more_printf("SYSLINUX\n");
     more_printf(" Bootloader : %s\n", hardware->syslinux_fs);
-    more_printf(" Version    : %s\n", hardware->sv->version_string + 2);
+    more_printf(" Version    : %s\n", hardware->sv->version_string);
     more_printf(" Version    : %u\n", hardware->sv->version);
     more_printf(" Max API    : %u\n", hardware->sv->max_api);
-    more_printf(" Copyright  : %s\n", hardware->sv->copyright_string + 1);
+    more_printf(" Copyright  : %s\n", hardware->sv->copyright_string);
 }
 
 struct cli_module_descr syslinux_show_modules = {
diff --git a/com32/hdt/hdt-menu-syslinux.c b/com32/hdt/hdt-menu-syslinux.c
index c85bfbf..02de5b3 100644
--- a/com32/hdt/hdt-menu-syslinux.c
+++ b/com32/hdt/hdt-menu-syslinux.c
@@ -51,9 +51,9 @@ void compute_syslinuxmenu(struct s_my_menu *menu, struct s_hardware *hardware)
     menu->items_count++;
 
     snprintf(buffer, sizeof buffer, "Version    : %s",
-	     hardware->sv->version_string + 2);
+	     hardware->sv->version_string);
     snprintf(statbuffer, sizeof statbuffer, "Version: %s",
-	     hardware->sv->version_string + 2);
+	     hardware->sv->version_string);
     add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
     menu->items_count++;
 
@@ -71,10 +71,10 @@ void compute_syslinuxmenu(struct s_my_menu *menu, struct s_hardware *hardware)
 
     add_item("", "", OPT_SEP, "", 0);
 
-    snprintf(buffer, sizeof buffer, "%s", hardware->sv->copyright_string + 1);
+    snprintf(buffer, sizeof buffer, "%s", hardware->sv->copyright_string);
     /* Remove the trailing LF in the copyright string to avoid scrolling */
     snprintf(statbuffer, sizeof statbuffer, "%s",
-	     remove_trailing_lf(hardware->sv->copyright_string + 1));
+	     remove_trailing_lf(hardware->sv->copyright_string));
     add_item(buffer, statbuffer, OPT_INACTIVE, NULL, 0);
     menu->items_count++;
 
diff --git a/core/comboot.inc b/core/comboot.inc
index 82b158f..6cf051e 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -449,9 +449,9 @@ comapi_get_version:
 
 		mov P_ES,ds
 		; ES:SI -> version banner
-		mov P_SI,syslinux_banner
+		mov P_SI,syslinux_banner + 2	; Skip leading CR LF
 		; ES:DI -> copyright string
-		mov P_DI,copyright_str
+		mov P_DI,copyright_str + 1	; Skip leading space
 
 comapi_nop:
 		clc
diff --git a/core/diskstart.inc b/core/diskstart.inc
index e194b97..b8ab790 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -467,9 +467,8 @@ bootsignature	dw kaboom.again-bootsec
 
 ldlinux_sys:
 
-syslinux_banner	db 0Dh, 0Ah
-		db MY_NAME, ' ', VERSION_STR, ' ', DATE_STR, ' ', 0
-		db 0Dh, 0Ah, 1Ah	; EOF if we "type" this in DOS
+syslinux_banner	db CR, LF, MY_NAME, ' ', VERSION_STR, ' ', DATE_STR, ' ', 0
+		db CR, LF, 1Ah	; EOF if we "type" this in DOS
 
 		alignz 8
 ldlinux_magic	dd LDLINUX_MAGIC
diff --git a/doc/comboot.txt b/doc/comboot.txt
index 81d0602..eb43708 100644
--- a/doc/comboot.txt
+++ b/doc/comboot.txt
@@ -236,6 +236,10 @@ AX=0001h [2.00]	Get Version
 	This API call returns the Syslinux version and API
 	information.
 
+	Note: before version 3.86, the version string had a leading CR LF
+	and the copyright string had a leading space.  The strings might
+	still contain trailing CR and/or LF.
+
 
 AX=0002h [2.01] Write String
 



More information about the Syslinux-commits mailing list