Deleted Added
full compact
main.c (84617) main.c (106738)
1/*-
2 * Copyright (c) 2000 Benno Rice <benno@jeamland.net>
3 * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 2000 Benno Rice <benno@jeamland.net>
3 * Copyright (c) 2000 Stephane Potvin <sepotvin@videotron.ca>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/boot/ofw/common/main.c 84617 2001-10-07 13:22:25Z benno $
27 * $FreeBSD: head/sys/boot/ofw/common/main.c 106738 2002-11-10 19:17:36Z jake $
28 */
29
30#include <stand.h>
31#include "openfirm.h"
32#include "libofw.h"
33#include "bootstrap.h"
34
28 */
29
30#include <stand.h>
31#include "openfirm.h"
32#include "libofw.h"
33#include "bootstrap.h"
34
35struct ofw_devdesc currdev; /* our current device */
36struct arch_switch archsw; /* MI/MD interface boundary */
37
38extern char end[];
39extern char bootprog_name[];
40extern char bootprog_rev[];
41extern char bootprog_date[];
42extern char bootprog_maker[];
43

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

118
119 OF_getprop(chosen, "bootpath", bootpath, 64);
120 ch = index(bootpath, ':');
121 *ch = '\0';
122 printf("Booted from: %s\n", bootpath);
123
124 printf("\n");
125
35struct arch_switch archsw; /* MI/MD interface boundary */
36
37extern char end[];
38extern char bootprog_name[];
39extern char bootprog_rev[];
40extern char bootprog_date[];
41extern char bootprog_maker[];
42

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

117
118 OF_getprop(chosen, "bootpath", bootpath, 64);
119 ch = index(bootpath, ':');
120 *ch = '\0';
121 printf("Booted from: %s\n", bootpath);
122
123 printf("\n");
124
126 switch (ofw_devicetype(bootpath)) {
127 case DEVT_DISK:
128 currdev.d_dev = &ofwdisk;
129 currdev.d_type = DEVT_DISK;
130 strncpy(currdev.d_kind.ofwdisk.path, bootpath, 64);
131 currdev.d_kind.ofwdisk.unit = ofwd_getunit(bootpath);
132
133 if (currdev.d_kind.ofwdisk.unit == -1) {
134 printf("Could not locate boot device.\n");
135 OF_exit();
136 }
137
138 break;
139
140 case DEVT_NET:
141 currdev.d_dev = &netdev;
142 currdev.d_type = DEVT_NET;
143 strncpy(currdev.d_kind.netif.path, bootpath, 64);
144 /* XXX Only works when we only look for one net device */
145 currdev.d_kind.netif.unit = 0;
146
147 break;
148
149 case DEVT_NONE:
150 default:
151 printf("\n");
152 printf("Could not establish type of boot device.\n");
153 OF_exit();
154 /* NOTREACHED */
155 break;
156 }
157
158 env_setenv("currdev", EV_VOLATILE, ofw_fmtdev(&currdev),
125 env_setenv("currdev", EV_VOLATILE, bootpath,
159 ofw_setcurrdev, env_nounset);
126 ofw_setcurrdev, env_nounset);
160 env_setenv("loaddev", EV_VOLATILE, ofw_fmtdev(&currdev), env_noset,
127 env_setenv("loaddev", EV_VOLATILE, bootpath, env_noset,
161 env_nounset);
162 setenv("LINES", "24", 1); /* optional */
163
164 archsw.arch_getdev = ofw_getdev;
165 archsw.arch_copyin = ofw_copyin;
166 archsw.arch_copyout = ofw_copyout;
167 archsw.arch_readin = ofw_readin;
168 archsw.arch_autoload = ofw_autoload;

--- 27 unchanged lines hidden ---
128 env_nounset);
129 setenv("LINES", "24", 1); /* optional */
130
131 archsw.arch_getdev = ofw_getdev;
132 archsw.arch_copyin = ofw_copyin;
133 archsw.arch_copyout = ofw_copyout;
134 archsw.arch_readin = ofw_readin;
135 archsw.arch_autoload = ofw_autoload;

--- 27 unchanged lines hidden ---