From nobody Sat Mar 14 10:08:32 2026 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=oracle.com ARC-Seal: i=1; a=rsa-sha256; t=1558201237; cv=none; d=zoho.com; s=zohoarc; b=XvMFFvCfd5NEfKilD3peI6JHEgRsj7MtO6cERLafdvl2a0LxCypHE5yOm7L7hpv1kt67pqtKEXH72QdKSmy0Z+pMdfJGJehTrqJFqKDsUPXpoHHH8NQ0qVJnwoOkTweXzAh+r515nczFTUx1rydCHg4uOdhJOXhtJQHFtgGXPvU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1558201237; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=vdKK2mMpT229cv8HKLeFj0xFZaUUuXYE8YI15OwsaMM=; b=j93W/lzzJpIncbC3SUz3nMkEk2C7QtOhFUYBQKxFp+GUcIRJcN8yud+aDLzztVHGdYLjjAtoxMEKInr6OXRuAO1IP9v/BrAtjjwncXeLO0fORSSmzmX2uC4J4p2K57E7S6P1XDo39vJ4Wl+7W8LUw3aXp1rVMllWJLs0Mnr8Pps= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1558201237207445.54897908724774; Sat, 18 May 2019 10:40:37 -0700 (PDT) Received: from [192.168.203.99] (mailu_mailman-core_1.mailu_default [192.168.203.99]) by coreboot.org (Postfix) with ESMTP id D46F512E2E84; Sat, 18 May 2019 17:40:31 +0000 (UTC) Received: from aserp2130.oracle.com (aserp2130.oracle.com [141.146.126.79]) by coreboot.org (Postfix) with ESMTP id CC23412E111A for ; Sat, 18 May 2019 17:40:22 +0000 (UTC) Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IG9rqu116318; Sat, 18 May 2019 16:17:00 GMT Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2130.oracle.com with ESMTP id 2sj7jd9h6d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:17:00 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x4IGFcmZ095619; Sat, 18 May 2019 16:16:59 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 2sj9v1n08a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 18 May 2019 16:16:59 +0000 Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x4IGGxor006360; Sat, 18 May 2019 16:16:59 GMT Received: from nexus.ravello.local (/213.57.127.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 18 May 2019 09:16:58 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=ntCfU6jZ+YcTTuKHzv4PfXJj4ocKF0ZeLXzKvI6vfmU=; b=i2RV4VoxU6qX33wFKQQdS0XmErA8ga1aR/RQU7bZUc7MG7IL+LlxPsiWyXiLEcEXMeLz ODomDBKRF/YW+PbTdqnrwM7gP3yN/WRWFLQ79IYw6U+uRhQ9AgiXHlmIst1LrRE6Ie2W 3mNlcpEcbKTtxfYGOaavoPdHk1uXDaoZOLHM2c7VsW3VHwLvFZRp3zToMfR770LgKHkN REOeZWy2JxBtRPIKZWgDDWpaeVzfFvFDsacB58txzf+rkEk0EKGMRUGADkL7fKAQlAuZ tfbUjAKn6mbhYYMn+zS6rQWLnerJpAyFeBYJ75rqQfK3fUqJ7pSqaayimwye0MZREOPn VQ== From: Sam Eiderman To: seabios@seabios.org, kraxel@redhat.com, kevin@koconnor.net Date: Sat, 18 May 2019 19:15:40 +0300 Message-Id: <20190518161542.12662-5-shmuel.eiderman@oracle.com> X-Mailer: git-send-email 2.13.3 In-Reply-To: <20190518161542.12662-1-shmuel.eiderman@oracle.com> References: <20190518161542.12662-1-shmuel.eiderman@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=981 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9261 signatures=668687 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905180117 Message-ID-Hash: VK5K3OHYQT5UF3KBZ2TR2AHXHX4FXD7J X-Message-ID-Hash: VK5K3OHYQT5UF3KBZ2TR2AHXHX4FXD7J X-MailFrom: shmuel.eiderman@oracle.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: arbel.moshe@oracle.com, konrad.wilk@oracle.com X-Mailman-Version: 3.2.2 Precedence: list Subject: [SeaBIOS] [PATCH v2 4/6] bios_date: Add bios date checks in checkrom.py List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Arbel Moshe Signed-off-by: Sam Eiderman Signed-off-by: Liran Alon --- 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 =3D buildrom.checksum(data[start:start+size]) return subst(data, start+csum, sumbyte) =20 +def check_windows_bios_date(rawdata): + dates =3D [] + for i in xrange(len(rawdata)): + if (rawdata[i+0:i+2].isdigit() and + rawdata[i+2] =3D=3D '/' and + rawdata[i+3:i+5].isdigit() and + rawdata[i+5] =3D=3D '/' 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) =3D=3D 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 =3D sys.argv[1:] @@ -46,6 +63,8 @@ def main(): sys.exit(1) =20 # Sanity checks + check_windows_bios_date(rawdata) + start =3D symbols['code32flat_start'].offset end =3D symbols['code32flat_end'].offset expend =3D layoutrom.BUILD_BIOS_ADDR + layoutrom.BUILD_BIOS_SIZE --=20 2.13.3 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org