From nobody Thu Jul 28 21:37:48 2022 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 4Lv3sT10NXz4X179; Thu, 28 Jul 2022 21:37:49 +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 4Lv3sS6yLnz3s2L; Thu, 28 Jul 2022 21:37:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659044269; 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=salzXdYAUv7Kw/+5Vx6C71jWxDCrtLBS+/G9NgKzftg=; b=HLTn52sc8MtXD0/To1oQgXYATpxx3K3/EnICd4/Z0l9c9sPr4imkIY2LJrrY3y4Abwt8Be 8yzBV3RueFhVOMBNcgF76cEZUZMS4cCkD5W7V0oBoGw/Wm2h1Xga4GqLhHap9Fkd8d8Y1X ORPjETx6+9XrHSEEDc9XEZFpwfVBz/am0Pzc7vzpsqmAzM8Pe1AzjG9P7ULjFvHxW9vPZy vtpwcsK35hLnOtg6oovlAP7jbtBPxQpxfJqAu1xEB1qkFp16cL1tXQRgoShnXwZYqPpDjZ EphKY9Mx4RgYAUxQ20XH+W5QZ37NRU/CBxtCSk3hMkmHobFpf/BOMF0gx4c1dg== 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 4Lv3sS5h6Mz19kD; Thu, 28 Jul 2022 21:37:48 +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 26SLbmxW001767; Thu, 28 Jul 2022 21:37:48 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26SLbmpc001766; Thu, 28 Jul 2022 21:37:48 GMT (envelope-from git) Date: Thu, 28 Jul 2022 21:37:48 GMT Message-Id: <202207282137.26SLbmpc001766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 957954014488 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 9579540144880e0a612ec2fdfc66de46c08d28d6 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1659044269; 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=salzXdYAUv7Kw/+5Vx6C71jWxDCrtLBS+/G9NgKzftg=; b=kTw/W2c5nzcck90KWt5iz02rmkzP/ZvnDzVrLSMyE/wIZn4VZ9HXfZZF+0skAek0zuKNYv DupMkHmrr5iFMrc8GHIUL2lDsgF6A4q3hxi8B4XFI1yIl3//s5UK64+VTUv/5Aae5g2IpR 38dRkWJm4jVR6TkkcfPiQIwwrOI6mrVEeynqvtqQMjvSnECscBhBf+W9bfWtqc6SFm1TOa HnMlx75U1Qipu3oiAQHcUJ/DW6OmFTSgNXNskb5VwU4WGStcbWUEZX631wWFO1s5LdWzaT n4KpE6JLRGpuDfvdlbZ+T0+uDRwaZFcJz4M4I43AehwJBKGXEZWVCetBPHDz5w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1659044269; a=rsa-sha256; cv=none; b=iJOhVzgtWqr3AkEg18dS9jZQ15u50ojb6hl+iAQedO0k3JVG9qn1qKWAff9VezRaDdFig7 i15LMHtDI+bIkNBN8q0tSO38OOXxNM1Oms9pYRM5+2plff9dMK+8oiAQEat1F8EqlciGu8 6S7ur3yMkJidgi9fCjuTV5jHgOB8UloF7H7Dd812sGaH5ld9bgH3QtDA8bWoSgdFXKX8h0 6T6luWtmYs2kL11gf3H62pEiRBgUkme2D0YJIQDn24m+U7ph+tX5l+la/cfCuxCuOLUxm0 nxeRGw4Q9IW/jKKh24/Zk6Wl462OrPmz7PcKtj29tHLmS9IvW8s/J0buzjgqJg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9579540144880e0a612ec2fdfc66de46c08d28d6 commit 9579540144880e0a612ec2fdfc66de46c08d28d6 Author: Warner Losh AuthorDate: 2022-07-26 23:39:45 +0000 Commit: Warner Losh CommitDate: 2022-07-28 21:35:42 +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 --- 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); } -