Clean up the version/copyright strings reported via the comboot API
authorH. Peter Anvin <hpa@linux.intel.com>
Tue, 30 Mar 2010 20:37:41 +0000 (13:37 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Tue, 30 Mar 2010 20:37:41 +0000 (13:37 -0700)
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@linux.intel.com>
com32/hdt/hdt-cli-syslinux.c
com32/hdt/hdt-menu-syslinux.c
core/comboot.inc
core/diskstart.inc
doc/comboot.txt

index 6c231ed..302ca24 100644 (file)
@@ -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 = {
index c85bfbf..02de5b3 100644 (file)
@@ -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++;
 
index 82b158f..6cf051e 100644 (file)
@@ -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
index e194b97..b8ab790 100644 (file)
@@ -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
index 81d0602..eb43708 100644 (file)
@@ -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