1/*- 2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/bootinfo.c 146698 2005-05-27 19:31:00Z jhb $"); |
29 30#include <stand.h> 31#include <sys/param.h> 32#include <sys/reboot.h> 33#include <sys/linker.h> 34#include "bootstrap.h" 35#include "libi386.h" 36#include "btxv86.h" --- 17 unchanged lines hidden (view full) --- 54 {"boot_serial", RB_SERIAL}, 55 {NULL, 0} 56}; 57 58int 59bi_getboothowto(char *kargs) 60{ 61 char *cp; |
62 char *curpos, *next, *string; |
63 int howto; 64 int active; 65 int i; |
66 int vidconsole; 67 |
68 /* Parse kargs */ 69 howto = 0; 70 if (kargs != NULL) { 71 cp = kargs; 72 active = 0; 73 while (*cp != 0) { 74 if (!active && (*cp == '-')) { 75 active = 1; --- 38 unchanged lines hidden (view full) --- 114 } 115 cp++; 116 } 117 } 118 /* get equivalents from the environment */ 119 for (i = 0; howto_names[i].ev != NULL; i++) 120 if (getenv(howto_names[i].ev) != NULL) 121 howto |= howto_names[i].mask; |
122 123 /* Enable selected consoles */ 124 string = next = strdup(getenv("console")); 125 vidconsole = 0; 126 while (next != NULL) { 127 curpos = strsep(&next, " ,"); 128 if (*curpos == '\0') 129 continue; 130 if (!strcmp(curpos, "vidconsole")) 131 vidconsole = 1; 132 else if (!strcmp(curpos, "comconsole")) 133 howto |= RB_SERIAL; 134 else if (!strcmp(curpos, "nullconsole")) 135 howto |= RB_MUTE; 136 } 137 138 if (vidconsole && (howto & RB_SERIAL)) 139 howto |= RB_MULTIPLE; 140 141 /* 142 * XXX: Note that until the kernel is ready to respect multiple consoles 143 * for the boot messages, the first named console is the primary console 144 */ 145 if (!strcmp(string, "vidconsole")) 146 howto &= ~RB_SERIAL; 147 148 free(string); 149 |
150 return(howto); 151} 152 153/* 154 * Copy the environment into the load area starting at (addr). 155 * Each variable is formatted as <name>=<value>, with a single nul 156 * separating each variable, and a double nul terminating the environment. 157 */ --- 22 unchanged lines hidden --- |