From owner-freebsd-hackers@freebsd.org Fri Nov 6 10:23:57 2020 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25D0E2E903C for ; Fri, 6 Nov 2020 10:23:57 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4CSGhD5zFhz4v7x for ; Fri, 6 Nov 2020 10:23:56 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: by mailman.nyi.freebsd.org (Postfix) id CD1152E8FAE; Fri, 6 Nov 2020 10:23:56 +0000 (UTC) Delivered-To: hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCDB92E9303 for ; Fri, 6 Nov 2020 10:23:56 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from s2gw.ddhf.dk (s2gw.ddhf.dk [130.226.214.244]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CSGhC55Qkz4vKZ for ; Fri, 6 Nov 2020 10:23:55 +0000 (UTC) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by s2gw.ddhf.dk (Postfix) with ESMTPS id B91B8C3F3A for ; Fri, 6 Nov 2020 10:23:36 +0000 (UTC) Received: (from phk@localhost) by critter.freebsd.dk (8.16.1/8.16.1/Submit) id 0A6ANorU057255; Fri, 6 Nov 2020 10:23:50 GMT (envelope-from phk) To: hackers@freebsd.org Subject: Have trick, not sure where to document... From: Poul-Henning Kamp MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <57253.1604658230.1@critter.freebsd.dk> Date: Fri, 06 Nov 2020 10:23:50 +0000 Message-ID: <57254.1604658230@critter.freebsd.dk> X-Rspamd-Queue-Id: 4CSGhC55Qkz4vKZ X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of phk@critter.freebsd.dk designates 130.226.214.244 as permitted sender) smtp.mailfrom=phk@critter.freebsd.dk X-Spamd-Result: default: False [0.14 / 15.00]; RCVD_TLS_ALL(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[130.226.214.244:from]; FREEFALL_USER(0.00)[phk]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[hackers@freebsd.org]; NEURAL_SPAM_MEDIUM(0.47)[0.469]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[130.226.214.244:from:127.0.2.255]; ARC_NA(0.00)[]; NEURAL_HAM_SHORT(-0.33)[-0.329]; DMARC_NA(0.00)[freebsd.dk]; FORGED_SENDER(0.30)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:1835, ipnet:130.226.0.0/16, country:EU]; FROM_NEQ_ENVFROM(0.00)[phk@phk.freebsd.dk,phk@critter.freebsd.dk]; MAILMAN_DEST(0.00)[hackers]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Nov 2020 10:23:57 -0000 I had some trouble with a particular remote site, and wanted to have the hardware watchdog protect the boot-sequence, but the BIOS had no support for this. The solution I found was to use the UEFI shell to arm the watchdog before the actuall boot. After digging around in the abysmal UEFI ecosystem some time, I ended up with a bunch of "MM" commands in startup.nsh, before it launches BOOTx64.efi: MM 4e ;IO :87 -n MM 4e ;IO :87 -n MM 4e ;IO :20 -n MM 4f ;IO -n MM 4e ;IO :21 -n MM 4f ;IO -n [...] MM 4e ;IO :aa -n BOOTx64.efi This seems like a genuinely useful trick to have in the tool-box and now I'm trying to find out where in our documentation something like this belongs ? It seems too specialized and with too many sharp edges for the handbook ? Wiki/UEFI seems rather historical... Suggestions ? -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.