From nobody Fri Jul 08 15:37:10 2022 X-Original-To: freebsd-hackers@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 E0D9C17FBFA1 for ; Fri, 8 Jul 2022 15:37:27 +0000 (UTC) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (kazi.fit.vutbr.cz [IPv6:2001:67c:1220:808::93e5:80c]) (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 (2048 bits) client-digest SHA256) (Client CN "kazi.fit.vutbr.cz", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lfcpt2mVmz3tnn for ; Fri, 8 Jul 2022 15:37:26 +0000 (UTC) (envelope-from cejkar@fit.vutbr.cz) Received: from kazi.fit.vutbr.cz (localhost [127.0.0.1]) by kazi.fit.vutbr.cz (8.17.1.9/8.17.1) with ESMTPS id 268FbFxb029352 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 8 Jul 2022 17:37:15 +0200 (CEST) (envelope-from cejkar@fit.vutbr.cz) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fit.vutbr.cz; s=mx1; t=1657294635; bh=nq37K0vOPG1IHq6yExto4Z32B0+uIRB+4wwjRIt5bco=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=wbH3d7emzO4UaNLQ0yFxhZnVX1BTWdXzSwaR/0vPHKEFCJAUPCGfNlObw2jlLfhdN CzrNinC+iDyjzs3cbV58g/DERp8eDD+Y98bS+m7cbGipLKIcgNUQt0bmK3+k1N1AY/ qSuTZ42GrAuVMrLByKCZeIokRI407i58UUfTErqw= Received: (from cejkar@localhost) by kazi.fit.vutbr.cz (8.17.1.9/8.17.1/Submit) id 268FbAUM029347; Fri, 8 Jul 2022 17:37:10 +0200 (CEST) (envelope-from cejkar@fit.vutbr.cz) X-Authentication-Warning: kazi.fit.vutbr.cz: cejkar set sender to cejkar@fit.vutbr.cz using -f Date: Fri, 8 Jul 2022 17:37:10 +0200 From: Cejka Rudolf To: Warner Losh Cc: Emmanuel Vadot , FreeBSD Hackers Subject: Re: Reasons for keeping sc(4) and libvgl ? Message-ID: References: <20211126160454.3eb827365a02103169ab9adc@bidouilliste.com> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 4Lfcpt2mVmz3tnn X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fit.vutbr.cz header.s=mx1 header.b=wbH3d7em; dmarc=pass (policy=none) header.from=fit.vutbr.cz; spf=pass (mx1.freebsd.org: domain of cejkar@fit.vutbr.cz designates 2001:67c:1220:808::93e5:80c as permitted sender) smtp.mailfrom=cejkar@fit.vutbr.cz X-Spamd-Result: default: False [-3.00 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[fit.vutbr.cz,none]; R_SPF_ALLOW(-0.20)[+a:kazi.fit.vutbr.cz]; R_DKIM_ALLOW(-0.20)[fit.vutbr.cz:s=mx1]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-hackers]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[fit.vutbr.cz:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ASN(0.00)[asn:197451, ipnet:2001:67c:1220::/46, country:CZ]; FROM_HAS_DN(0.00)[]; TO_DN_ALL(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; RCVD_COUNT_THREE(0.00)[3]; HAS_XAW(0.00)[]; RCVD_TLS_LAST(0.00)[] X-ThisMailContainsUnwantedMimeParts: N Warner Losh wrote (2022/06/23): > On Thu, Jun 23, 2022 at 1:44 AM Cejka Rudolf wrote: > > Hello, > > so is there any solution for problem below now? > > > > Cejka Rudolf wrote (2021/11/29): > > > Hello, > > > I have one problem or two with VT in FreeBSD 12. I wrote a question in > > > freebsd-stable what to do, but without response, so I still have to > > > use SC. Please, could you look at it? There is not configured device > > > /dev/console without monitor after upgrade from 11 to 12 and device > > > /dev/kbdmux0 is busy using VT but not with SC. > > > > > > Subject: Unable to grab keyboard with VT on a headless node in stable/12 > > > > > > Hello, > > > I have a headless node without monitor and without keyboard. There > > > is just network and USB card reader in keyboard mode. > > > > > > In stable/11, there was no problem to disconnect USB card reader > > > from kbdmux using kbdcontrol -A ukbd0 < /dev/console and open > > > /dev/ukbd0 in a program. > > > > > > However, under stable/12 it works just with connected monitor. > > > > > > Without monitor, there is an error: > > > > > > # kbdcontrol < /dev/console > > > -bash: /dev/console: Device not configured > > > > > > Furthermore with default VT, it is also impossible to use /dev/kbdmux0: > > > > > > # kbdcontrol < /dev/kbdmux0 > > > -bash: /dev/kbdmux0: Device busy > > > > > > I have found a workaround using SC, where it is possible to atleast > > > open /dev/kbdmux0 and use kbdcontrol -A ukbd0 < /dev/kbdmux0, but why > > > keyboard operation is now dependend on connected monitor? And why VT > > > does not allow to open /dev/kbdmux0? > > > > > > Thank you. > > > > Have you filed a bug for this? This looks like a legit bug and one that > should be easy(ish) to reproduce. Not yet, I'm still not sure, if it is a bug or a feature. > Or at least it looks that way on the surface, there might be a pilot error > as well that just happened to > work before and needs a slightly different workaround to what you are > doing... During getting answers to your questions I finally found a workaround - do not use /dev/console nor /dev/kbdmux0, but use /dev/ttyv0. With /dev/ttyv0 I can detach USB card reader: # usbconfig show_ifdrv ugen0.2: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA) ugen0.2.0: ukbd0: ugen0.2.1: uhid0: from kbdmux0 using kbdcontrol -A ukbd0 And it's an actual monitor connected that's the only difference? Yes. > Or is this some KVM switch that's connected, so there's an atkbd > in the mix somewhere? No, just direct cable connection between computer and monitor. > What's the difference in dmesg between > these two boots? Is this with EFI or legacy BIOS boot? > A dmesg with bootverbose would be most enligtening. It is EFI boot and it seems that the only interesting difference is that with connected monitor there is kernel: VT(efifb): resolution 1280x1024 while with disconnected monitor there is kernel: VT(vga): resolution 640x480 > 'Not conifgured' is ENXIO which is returned when /dev/console isn't there > (eg, no /dev/console), which seems weird in the extreme. And it's 'bash' > that's giving the message, which means kbdcontrol isn't even getting invoked. Ok, however there is question, what is the suggested device for kbdcontrol. I see just /dev/kbdmux0 or /dev/console in manual. SC with or without monitor, both are the same (I temporarily connected also one USB keyboard): # kbdcontrol -i And I'm also a little confused, detach ukbd0 from a usb card reader? That's > an interesting setup. While > it won't affect whether or not this is a bug, I'd be interested to know > more details there... Detach ukbd0 (= USB card reader) from kbdmux0, so USB card reader is usable as an inpout in a program. Without detach, characters from USB card reader are grabbed by kbdmux0. PC connected to the network with USB card reader works as a controller for Xerox printer for users authentication, when they want to make paid paper copies. -- Rudolf Cejka https://www.fit.vut.cz/~cejkar Brno University of Technology, Faculty of Information Technology Bozetechova 1/2, 612 00 Brno, Czech Republic