Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 1996 16:40:34 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        hackers@FreeBSD.org, julian@whistle.com
Subject:   Re: Running FreeBSD with NO CONSOLE (AT ALL)
Message-ID:  <199610050640.QAA15141@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199610050640.QAA15141>