From nobody Tue Jan 24 22:11:41 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P1h5V15s0z3bfbJ; Tue, 24 Jan 2023 22:11:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P1h5T4HzDz4P62; Tue, 24 Jan 2023 22:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r+mrO41NUMtzQqyCRK69yXx2bnQCL8XAOvwx1urgFlU=; b=BXSbyir7iAmnKOBN2yiULHoAiVgiaq5oR5huHFM2f+hqz6i4iKk7+ufBKxnMp8iWHKPpHq 1wuALlxNdFL81UxmvywIfV7wvQ7AYhVUz1c+etsGAn1yS6DImyR2Ul/i92IrOTJsn1XSay 9Dwk66+dXYfsNFcNs6hCjqkBZj9TLZvw7GKiJVxPxEbmuveCuxM59J+MFj3lMbURNKvrNs CRV7xDwH9ARkETH1LZQZ4rphehKbWZBuSGuN7DFiE+2IUxPAudy2wFD/7toJ3aqgHNdf1Y cnZ/gVqtn6hZtFD27sFqczJ6XuZd4GY2c3WCBUaUQDNQ2l+WmR0o+bKPoZStuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674598301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=r+mrO41NUMtzQqyCRK69yXx2bnQCL8XAOvwx1urgFlU=; b=kSQ/CkaA9T05K8jHqrE5CD1oxP+3tpG558FTg6xgZqSWB2I5yIYtoKad3eDkAuz19Gvvej Zlfsubhav2tif2P7jT2yaTJiZEMZn6JJlu4iCAyZfT6iCYqS1ezs8mM9yg9a6sGHAIQZWs jHbddj0WKAzJbN7204OUFX2uDDuMwwMT2pKYAXgin4DDCY+ZaLMtPu3kT9EWfWNLJqVFD1 p/soBpwuycExXDJTJbwPHnaWdhghHI+tHiQJ8z2A5nh4zzy9EuOMbs7Dx/o8B7UnizRXXr YmpE3D6EUukU3Dzl1pyZsZPEBjr8MyQgbpgueyClM0Z4ZHlY3uMm4/ehiFvRHQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674598301; a=rsa-sha256; cv=none; b=YKfH4+/rzDulWXnKE1qN5Xme0d8V7n4A0stJlu1wverfPFUgbdzD3572W5JEBuyOzvaTZF KXIzShOm4KKmYHCHfO9IwbjAPzV122WuMSaOQF1Zdr8dzSPFQkvyoGeNTbQYP+GUGyR4D8 7mqsAVwchRkKRlmCuGleVj1gPX5Xm8xGGNKH85bKtzh6O2Gh9O9aiHWNcUFgZp+5W9oY51 RtC4/ZVspMQkfkbJu/8+6jjCkDfvGWIwAuPc7qO+UxB2Md+31ZraEGgN7qz0LdQz76kN9b khOwTh9NJFG3vPdI84NhBI0taTzBNoRfEBvmBiK7Bla3lON9vKQvvEF8aY3+OA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P1h5T3BSKzQXM; Tue, 24 Jan 2023 22:11:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30OMBfDf085072; Tue, 24 Jan 2023 22:11:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30OMBf2b085071; Tue, 24 Jan 2023 22:11:41 GMT (envelope-from git) Date: Tue, 24 Jan 2023 22:11:41 GMT Message-Id: <202301242211.30OMBf2b085071@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 7041245be62b - stable/13 - kboot: Make console raw when we start List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 7041245be62b9760a3bf8103935bb6f0d9561343 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=7041245be62b9760a3bf8103935bb6f0d9561343 commit 7041245be62b9760a3bf8103935bb6f0d9561343 Author: Warner Losh AuthorDate: 2022-07-26 23:39:45 +0000 Commit: Warner Losh CommitDate: 2023-01-24 21:49:29 +0000 kboot: Make console raw when we start Put the console into raw mode on startup. This allows the menus to work as expected. Boot is now interruptable. Note: Likely should restore the terminal settings on most exists. It's not clear the best way to do this, and most shells have an auto stty sane anyway, so note it for future improvement. Sponsored by: Netflix (cherry picked from commit 9579540144880e0a612ec2fdfc66de46c08d28d6) --- stand/kboot/hostcons.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/stand/kboot/hostcons.c b/stand/kboot/hostcons.c index 31dceb019973..80d4a1c4319b 100644 --- a/stand/kboot/hostcons.c +++ b/stand/kboot/hostcons.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include "bootstrap.h" #include "host_syscall.h" +#include "termios.h" static void hostcons_probe(struct console *cp); static int hostcons_init(int arg); @@ -47,6 +48,8 @@ struct console hostconsole = { hostcons_poll, }; +static struct host_termios old_settings; + static void hostcons_probe(struct console *cp) { @@ -57,9 +60,12 @@ hostcons_probe(struct console *cp) static int hostcons_init(int arg) { + struct host_termios new_settings; - /* XXX: set nonblocking */ - /* tcsetattr(~(ICANON | ECHO)) */ + host_tcgetattr(0, &old_settings); + new_settings = old_settings; + host_cfmakeraw(&new_settings); + host_tcsetattr(0, HOST_TCSANOW, &new_settings); return (0); } @@ -94,4 +100,3 @@ hostcons_poll() ret = host_select(32, &fds, NULL, NULL, &tv); return (ret > 0); } -