Deleted Added
full compact
bootinfo.c (138249) bootinfo.c (146698)
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>
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 138249 2004-12-01 04:59:33Z scottl $");
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;
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;
62 int howto;
63 int active;
64 int i;
63 int howto;
64 int active;
65 int i;
65
66 int vidconsole;
67
66 /* Parse kargs */
67 howto = 0;
68 if (kargs != NULL) {
69 cp = kargs;
70 active = 0;
71 while (*cp != 0) {
72 if (!active && (*cp == '-')) {
73 active = 1;

--- 38 unchanged lines hidden (view full) ---

112 }
113 cp++;
114 }
115 }
116 /* get equivalents from the environment */
117 for (i = 0; howto_names[i].ev != NULL; i++)
118 if (getenv(howto_names[i].ev) != NULL)
119 howto |= howto_names[i].mask;
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;
120 if (!strcmp(getenv("console"), "comconsole"))
121 howto |= RB_SERIAL;
122 if (!strcmp(getenv("console"), "nullconsole"))
123 howto |= RB_MUTE;
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
124 return(howto);
125}
126
127/*
128 * Copy the environment into the load area starting at (addr).
129 * Each variable is formatted as <name>=<value>, with a single nul
130 * separating each variable, and a double nul terminating the environment.
131 */

--- 22 unchanged lines hidden ---
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 ---