On Thu, May 23, 2019 at 06:58:57PM +0300, Sam Eiderman wrote:
On 23 May 2019, at 18:54, Kevin O'Connor <kevin@koconnor.net> wrote:
I understand. If we ensured the smbios date is always in the
f-segment, would that also solve the problem? (That is, using the
'char win_bios_date[] VARFSEG' method discussed previously.)
That would only be half of the solution, since F-SEG contains the following dates: ['04/01/2014', '01/01/2011', '06/23/99’]
It means that no matter what is found in "char win_bios_date[] VARFSEG”, SystemBiosDate will always be a date of ’04/01/2014’ or later.
To really control the output of SystemBiosDate, all dates in SeaBIOS’s F-SEG should be the desired SystemBiosDate (or older).
Under normal circumstances, the 32bit init code is relocated out of
the f-segment. Unfortunately, that doesn't work for anonymous
strings. One simple trick, though, is to force these problematic
strings into named variables (see patch below).
-Kevin
diff --git a/src/fw/biostables.c b/src/fw/biostables.c
index fe8626e..269b858 100644
--- a/src/fw/biostables.c
+++ b/src/fw/biostables.c
@@ -401,7 +401,7 @@ smbios_new_type_0(void *start,
}
#define BIOS_NAME "SeaBIOS"
-#define BIOS_DATE "04/01/2014"
+static const char BIOS_DATE[] = "04/01/2014";
static int
smbios_romfile_setup(void)
diff --git a/src/fw/smbios.c b/src/fw/smbios.c
index 62a563b..8e7ee6a 100644
--- a/src/fw/smbios.c
+++ b/src/fw/smbios.c
@@ -161,7 +161,7 @@ get_external(int type, char **p, unsigned *nr_structs,
} while (0)
/* Type 0 -- BIOS Information */
-#define RELEASE_DATE_STR "01/01/2011"
+static const char RELEASE_DATE_STR[] = "01/01/2011";
static void *
smbios_init_type_0(void *start)
{