From owner-freebsd-hackers Fri Oct 4 23:49:35 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA29799 for hackers-outgoing; Fri, 4 Oct 1996 23:49:35 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id XAA29778 for ; Fri, 4 Oct 1996 23:47:24 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.7.6/8.6.9) id QAA15141; Sat, 5 Oct 1996 16:40:34 +1000 Date: Sat, 5 Oct 1996 16:40:34 +1000 From: Bruce Evans Message-Id: <199610050640.QAA15141@godzilla.zeta.org.au> To: hackers@FreeBSD.org, julian@whistle.com Subject: Re: Running FreeBSD with NO CONSOLE (AT ALL) Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk >I'm running freeBSD with no available sio device and no videa Which version? :-) >the only problem I've seen so far is that in exit() >there is an unguarded call to p->pg_session->s_ttyp >which is NULL. >there is a check for p->pg_session->s_ttyvp and the assumption is >being made that if s_ttyvp (points to /dev/console's vnode) is valid, >then the tty struct in the physical device is also valid. I think cnopen() should fail when there is no tty. Then this problem can't happen. init might die instead when it can't open /dev/console :-). Note that cnopen() and all the cn i/o routines return 0 if there is no tty. Thus /dev/console is the same as /dev/null, except cnwrite() is broken - it doesn't advance the uio pointers, so write() returns 0 with no error. This can't happen :-). They do this in case init depends on opening /dev/console, but your problem shows that they don't do enough. >Eventually the aim is to be able to run with no console, but in >some special case, attach the console to sio0 >but only with some special checks. It should be possible to change the physcal console at any time using a sysctl. This should include starting from or ending with a null console or a dead console. But first, check the error handling of init and syslogd etc. when /dev/console doesn't exist (open fails) or is dead (has been opened and revoked - revoke() stops it being a control terminal so the nonexistent tty doesn't matter). Bruce