Deleted Added
full compact
autoconf.c (25172) autoconf.c (25460)
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
1/*-
2 * Copyright (c) 1990 The Regents of the University of California.
3 * All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * William Jolitz.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
35 *
36 * from: @(#)autoconf.c 7.1 (Berkeley) 5/9/91
37 * $Id: autoconf.c,v 1.65 1997/04/26 11:45:02 peter Exp $
37 * $Id: autoconf.c,v 1.66 1997/04/26 18:57:34 peter Exp $
38 */
39
40/*
41 * Setup the system to run on the current machine.
42 *
43 * Configure() is called at boot time and initializes the vba
44 * device tables and the memory controller monitoring. Available
45 * devices are determined (from possibilities mentioned in ioconf.c),
46 * and the drivers are initialized.
47 */
48#include "opt_smp.h"
38 */
39
40/*
41 * Setup the system to run on the current machine.
42 *
43 * Configure() is called at boot time and initializes the vba
44 * device tables and the memory controller monitoring. Available
45 * devices are determined (from possibilities mentioned in ioconf.c),
46 * and the drivers are initialized.
47 */
48#include "opt_smp.h"
49#include "opt_cd9660.h"
49
50#include <sys/param.h>
51#include <sys/systm.h>
52#include <sys/buf.h>
53#include <sys/conf.h>
54#include <sys/dmap.h>
55#include <sys/reboot.h>
56#include <sys/kernel.h>

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

96
97static void configure_finish __P((void));
98static void configure_start __P((void));
99static int setdumpdev __P((dev_t dev));
100static void setroot __P((void));
101
102#ifdef CD9660
103
50
51#include <sys/param.h>
52#include <sys/systm.h>
53#include <sys/buf.h>
54#include <sys/conf.h>
55#include <sys/dmap.h>
56#include <sys/reboot.h>
57#include <sys/kernel.h>

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

97
98static void configure_finish __P((void));
99static void configure_start __P((void));
100static int setdumpdev __P((dev_t dev));
101static void setroot __P((void));
102
103#ifdef CD9660
104
105#include <sys/fcntl.h>
106#include <sys/proc.h>
107#include <sys/stat.h>
108#include <machine/clock.h>
104#include <isofs/cd9660/iso.h>
105
109#include <isofs/cd9660/iso.h>
110
106/* We need to try out all our potential CDROM drives, so we need a table. */
111/*
112 * XXX All this CD-ROM root stuff is fairly messy. Ick.
113 *
114 * We need to try out all our potential CDROM drives, so we need a table.
115 */
107static struct {
108 char *name;
109 int major;
110} try_cdrom[] = {
111 { "cd", 6 },
112 { "mcd", 7 },
113 { "scd", 16 },
114 { "matcd", 17 },
116static struct {
117 char *name;
118 int major;
119} try_cdrom[] = {
120 { "cd", 6 },
121 { "mcd", 7 },
122 { "scd", 16 },
123 { "matcd", 17 },
124 { "wcd", 19 },
115 { 0, 0}
116};
117
125 { 0, 0}
126};
127
118static int find_cdrom_root __P((void *));
128static int find_cdrom_root __P((void));
119
120static int
129
130static int
121find_cdrom_root(dummy)
122 void *dummy;
131find_cdrom_root()
123{
132{
124 int i,j,k;
133 int i, j, error;
134 struct bdevsw *bd;
135 dev_t orootdev;
125
136
126 for (j = 0 ; j < 2; j++)
127 for (k = 0 ; try_cdrom[k].name ; k++) {
128 rootdev = makedev(try_cdrom[k].major,j*8);
129 printf("trying rootdev=0x%lx (%s%d)\n",
130 rootdev, try_cdrom[k].name,j);
131 i = (*cd9660_mountroot)();
132 if (!i) return i;
137#if CD9660_ROOTDELAY > 0
138 DELAY(CD9660_ROOTDELAY * 1000000);
139#endif
140 orootdev = rootdev;
141 for (i = 0 ; i < 2; i++)
142 for (j = 0 ; try_cdrom[j].name ; j++) {
143 if (try_cdrom[j].major >= nblkdev)
144 continue;
145 rootdev = makedev(try_cdrom[j].major, i * 8);
146 bd = bdevsw[major(rootdev)];
147 if (bd == NULL || bd->d_open == NULL)
148 continue;
149 if (bootverbose)
150 printf("trying %s%d as rootdev (0x%x)\n",
151 try_cdrom[j].name, i, rootdev);
152 error = (bd->d_open)(rootdev, FREAD, S_IFBLK, curproc);
153 if (error == 0) {
154 if (bd->d_close != NULL)
155 (bd->d_close)(rootdev, FREAD, S_IFBLK,
156 curproc);
157 return 0;
158 }
133 }
159 }
160
161 rootdev = orootdev;
134 return EINVAL;
135}
136#endif /* CD9660 */
137
138static void
139configure_start()
140{
141#if NSCBUS > 0

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

228
229 printf("Device configuration finished.\n");
230 }
231
232#ifdef CD9660
233 if ((boothowto & RB_CDROM)) {
234 if (bootverbose)
235 printf("Considering CD-ROM root f/s.\n");
162 return EINVAL;
163}
164#endif /* CD9660 */
165
166static void
167configure_start()
168{
169#if NSCBUS > 0

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

256
257 printf("Device configuration finished.\n");
258 }
259
260#ifdef CD9660
261 if ((boothowto & RB_CDROM)) {
262 if (bootverbose)
263 printf("Considering CD-ROM root f/s.\n");
236 mountrootfsname = "cd9660";
264 /* NB: find_cdrom_root() sets rootdev if successful. */
265 if (find_cdrom_root() == 0)
266 mountrootfsname = "cd9660";
267 else if (bootverbose)
268 printf("No CD-ROM available as root f/s.\n");
237 }
238#endif
239
240#ifdef MFS_ROOT
241 if (!mountrootfsname) {
242 if (bootverbose)
243 printf("Considering MFS root f/s.\n");
244 mountrootfsname = "mfs";

--- 169 unchanged lines hidden ---
269 }
270#endif
271
272#ifdef MFS_ROOT
273 if (!mountrootfsname) {
274 if (bootverbose)
275 printf("Considering MFS root f/s.\n");
276 mountrootfsname = "mfs";

--- 169 unchanged lines hidden ---