Subject: Testing for devices in kernel startup
To: None <tech-kern@NetBSD.ORG>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: tech-kern
Date: 11/01/1996 20:44:50
I've gotten kinda tired of seeing people run into problems from installing
w/o building devices. I've done this once too. Since the people who hit
this error are usually dependent on the net for support, I think it'd
be nice if we could help them some.
My thought is to basically just lstat some device and make sure it exists
and is a reasonable device. If it's not, then we print an error message
suggesting you might want to make devices. If the kernel then soon
crashes, there's a diagnostic message saying what to do.
My thought was to look at /dev/console, since, AFAIK, it should be a
character device on all ports.
So two questions:
1) what do people think? I envision a small change, just enough code to
set up the lookup, do it, vn_stat, and then vn_put. And print a message.
2) When would be a good time to do it? I.E. after namei will succede, but
before we've tried to actually use something from /dev. I was thinking
somewhere around swapinit() in kern/init_main.c (it doesn't seem to
actualy look at /dev)
Take care,
Bill