diff options
author | msmith <msmith@FreeBSD.org> | 1998-09-26 01:29:13 +0000 |
---|---|---|
committer | msmith <msmith@FreeBSD.org> | 1998-09-26 01:29:13 +0000 |
commit | 7e33170a26eb4e00de1118e6ad023f344f2eda57 (patch) | |
tree | 88e60ab6cafa9863d327fce7019ff2b61bd94edd /sys/boot/common/console.c | |
parent | 813a76e7c2c3faee577231049fa983dc48c7de53 (diff) | |
download | FreeBSD-src-7e33170a26eb4e00de1118e6ad023f344f2eda57.zip FreeBSD-src-7e33170a26eb4e00de1118e6ad023f344f2eda57.tar.gz |
console.c
Allow the MI code to override the preferred console (eg. so that
an RB_SERIAL flag from the i386 boot2 can override the default
first active console)
isapnp.c
Use the standard format for ISA PnP IDs.
pnp.c
Allow trailing comments on lines, be less picky about line
contents.
ls.c
Cosmetic error message fix.
panic.c
Print the right arguments.
Diffstat (limited to 'sys/boot/common/console.c')
-rw-r--r-- | sys/boot/common/console.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sys/boot/common/console.c b/sys/boot/common/console.c index 5aed8b1..ffc41a9 100644 --- a/sys/boot/common/console.c +++ b/sys/boot/common/console.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: console.c,v 1.1.1.1 1998/08/21 03:17:41 msmith Exp $ */ #include <stand.h> @@ -48,16 +48,28 @@ cons_probe(void) { int cons; int active; + char *prefconsole; - /* Do all console probes, make the fist fully functional console active */ + /* Do all console probes */ for (cons = 0, active = -1; consoles[cons] != NULL; cons++) { consoles[cons]->c_flags = 0; consoles[cons]->c_probe(consoles[cons]); - if ((consoles[cons]->c_flags == (C_PRESENTIN | C_PRESENTOUT)) && (active == -1)) { - consoles[cons]->c_flags |= (C_ACTIVEIN | C_ACTIVEOUT); - active = cons; - } + if ((consoles[cons]->c_flags == (C_PRESENTIN | C_PRESENTOUT)) && (active == -1)) + active = cons; /* first candidate */ } + + /* Check to see if a console preference has already been registered */ + prefconsole = strdup(getenv("console")); + if (prefconsole != NULL) { + unsetenv("console"); /* we want to replace this */ + for (cons = 0; consoles[cons] != NULL; cons++) + /* look for the nominated console, use it if it's functional */ + if (!strcmp(prefconsole, consoles[cons]->c_name) && + (consoles[cons]->c_flags == (C_PRESENTIN | C_PRESENTOUT))) + active = cons; + free(prefconsole); + } + consoles[active]->c_flags |= (C_ACTIVEIN | C_ACTIVEOUT); printf("Console: %s\n", consoles[active]->c_desc); env_setenv("console", 0, consoles[active]->c_name, cons_set, env_nounset); } |