Check that only one bios date appears in the final ROM. The check simulates nt!CmpGetBiosDate() in order to ensure that Windows sees the correct date.
For reference implementation of nt!CmpGetBiosDate(), see ReactOS: https://doxygen.reactos.org/d5/dd2/i386_2cmhardwr_8c.html Reviewed-by: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Reviewed-by: Arbel Moshe <arbel.mo...@oracle.com> Signed-off-by: Sam Eiderman <shmuel.eider...@oracle.com> Signed-off-by: Liran Alon <liran.a...@oracle.com> --- scripts/checkrom.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/scripts/checkrom.py b/scripts/checkrom.py index aced5e2c..98cdfa7f 100755 --- a/scripts/checkrom.py +++ b/scripts/checkrom.py @@ -17,6 +17,23 @@ def checksum(data, start, size, csum): sumbyte = buildrom.checksum(data[start:start+size]) return subst(data, start+csum, sumbyte) +def check_windows_bios_date(rawdata): + dates = [] + for i in xrange(len(rawdata)): + if (rawdata[i+0:i+2].isdigit() and + rawdata[i+2] == '/' and + rawdata[i+3:i+5].isdigit() and + rawdata[i+5] == '/' and + rawdata[i+6:i+8].isdigit()): + dates.append(rawdata[i:i+8]) + if len(dates) > 1: + print("Warning! More than one date was detected in rom.") + print(" This may cause Windows OS to report incorrect date:") + print(" %s" % (dates, )) + if len(dates) == 0: + print("Warning! No dates were detected in rom.") + print(" This may cause Windows OS to report incorrect date.") + def main(): # Get args objinfo, finalsize, rawfile, outfile = sys.argv[1:] @@ -46,6 +63,8 @@ def main(): sys.exit(1) # Sanity checks + check_windows_bios_date(rawdata) + start = symbols['code32flat_start'].offset end = symbols['code32flat_end'].offset expend = layoutrom.BUILD_BIOS_ADDR + layoutrom.BUILD_BIOS_SIZE -- 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-le...@seabios.org