From nobody Sat Apr 27 01:38:18 2024 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.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; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1583330600; cv=none; d=zohomail.com; s=zohoarc; b=G7ysQgrKU4NgiXjasB3eaamqq9n6eIfxLwy//Q6646Ieqv7QRZgd1HHFaJb8NwUXghHMYotr05PQEkvSseOIfnN0ksPy8cNsslVvtqgSJQoxTQh2Uy+ERhTEVZW4voDTyfH/MlvpPckTwh3Bs+5rqGVoVHvQg4Zib+j00zdCjEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583330600; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To; bh=JRqpuYEJ9sazxgJ8WnXIa8Gya28T4rYDHqpKZv06WJo=; b=nhkjnRyjx/zmLS4E9dnnxMMHi5U0zX1gQWeYbf/dj+Z8nGLX1R/dr9njsGOm6lFd+JosrzYylDSQiPWklnAsXfp8SGDaaMZgQaKSBvm2LOvS47z1YlmDv2E5cmW5dRLlxCNfH6SjVmfyRvVAO2gf2D2w4draip49y0T+2josd0g= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=none (zohomail.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1583330600026822.4522052459922; Wed, 4 Mar 2020 06:03:20 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id D29F5280E5; Wed, 4 Mar 2020 14:03:15 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id BECCA2011B for ; Wed, 4 Mar 2020 14:02:59 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 310CE20645A1D; Wed, 4 Mar 2020 15:02:59 +0100 (CET) To: seabios@seabios.org From: Paul Menzel Message-ID: <95c1cdf5-c2c0-b4e2-20da-74101846f3ed@molgen.mpg.de> Date: Wed, 4 Mar 2020 15:02:59 +0100 MIME-Version: 1.0 Content-Language: en-US Message-ID-Hash: G5LN75GFVJOM4BEPIVEZYAD62HEWYNMY X-Message-ID-Hash: G5LN75GFVJOM4BEPIVEZYAD62HEWYNMY X-MailFrom: pmenzel@molgen.mpg.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.3.1 Precedence: list Subject: [SeaBIOS] [PATCH] boot.c: fix 'booting' text for USB devices List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++ X-Spam-Level: *** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org Content-Type: text/plain; charset="utf-8" From: Matt DeVillier Date: Fri, 13 Jun 2014 17:21:57 -0500 Currently, booting from a USB device displays the same text as booting from a hard disk ('Booting from Hard Disk'). Identify USB devices based on the description string and display identifying text when booting. Signed-off-by: Matt DeVillier Signed-off-by: Paul Menzel --- Upstream commit from https://github.com/MrChromebox/SeaBIOS src/boot.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/boot.c b/src/boot.c index afeb36a..69c602f 100644 --- a/src/boot.c +++ b/src/boot.c @@ -487,6 +487,7 @@ static struct hlist_head BootList VARVERIFY32INIT; #define IPL_TYPE_FLOPPY 0x01 #define IPL_TYPE_HARDDISK 0x02 #define IPL_TYPE_CDROM 0x03 +#define IPL_TYPE_USB 0x04 #define IPL_TYPE_CBFS 0x20 #define IPL_TYPE_BEV 0x80 #define IPL_TYPE_BCV 0x81 @@ -564,8 +565,17 @@ boot_add_floppy(struct drive_s *drive, const char *des= c, int prio) void boot_add_hd(struct drive_s *drive, const char *desc, int prio) { - bootentry_add(IPL_TYPE_HARDDISK, defPrio(prio, DefaultHDPrio) + char *usb =3D "USB"; + char short_desc[4]; + memcpy(short_desc, desc, 3); + short_desc[3]=3D'\0'; + if (strcmp(short_desc, usb) =3D=3D 0) { + bootentry_add(IPL_TYPE_USB, defPrio(prio, DefaultHDPrio) , (u32)drive, desc); + } else { + bootentry_add(IPL_TYPE_HARDDISK, defPrio(prio, DefaultHDPrio) + , (u32)drive, desc); + } } =20 void @@ -764,7 +774,7 @@ static int HaveHDBoot, HaveFDBoot; static void add_bev(int type, u32 vector) { - if (type =3D=3D IPL_TYPE_HARDDISK && HaveHDBoot++) + if ((type =3D=3D IPL_TYPE_HARDDISK || type =3D=3D IPL_TYPE_USB) && Hav= eHDBoot++) return; if (type =3D=3D IPL_TYPE_FLOPPY && HaveFDBoot++) return; @@ -802,6 +812,10 @@ bcv_prepboot(void) map_hd_drive(pos->drive); add_bev(IPL_TYPE_HARDDISK, 0); break; + case IPL_TYPE_USB: + map_hd_drive(pos->drive); + add_bev(IPL_TYPE_USB, 0); + break; case IPL_TYPE_CDROM: map_cd_drive(pos->drive); // NO BREAK @@ -962,6 +976,10 @@ do_boot(int seq_nr) printf("Booting from Hard Disk...\n"); boot_disk(0x80, 1); break; + case IPL_TYPE_USB: + printf("Booting from USB Device...\n"); + boot_disk(0x80, 1); + break; case IPL_TYPE_CDROM: boot_cdrom((void*)ie->vector); break; --=20 2.25.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org