conf.c revision 59767
1274116Sdteske/*-
2295110Sdteske * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3274116Sdteske * All rights reserved.
4274116Sdteske *
5274116Sdteske * Redistribution and use in source and binary forms, with or without
6274116Sdteske * modification, are permitted provided that the following conditions
7274116Sdteske * are met:
8274116Sdteske * 1. Redistributions of source code must retain the above copyright
9274116Sdteske *    notice, this list of conditions and the following disclaimer.
10274116Sdteske * 2. Redistributions in binary form must reproduce the above copyright
11274116Sdteske *    notice, this list of conditions and the following disclaimer in the
12274116Sdteske *    documentation and/or other materials provided with the distribution.
13274116Sdteske *
14274116Sdteske * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15274116Sdteske * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16274116Sdteske * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17274116Sdteske * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18274116Sdteske * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19274116Sdteske * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20274116Sdteske * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21274116Sdteske * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22274116Sdteske * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23274116Sdteske * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24274116Sdteske * SUCH DAMAGE.
25274116Sdteske *
26274116Sdteske * $FreeBSD: head/sys/boot/i386/loader/conf.c 59767 2000-04-29 20:49:33Z jlemon $
27274116Sdteske */
28274116Sdteske
29274116Sdteske#include <stand.h>
30274116Sdteske#include <bootstrap.h>
31274116Sdteske#include "libi386/libi386.h"
32274116Sdteske
33274116Sdteske/*
34274116Sdteske * We could use linker sets for some or all of these, but
35274116Sdteske * then we would have to control what ended up linked into
36274116Sdteske * the bootstrap.  So it's easier to conditionalise things
37274116Sdteske * here.
38274116Sdteske *
39274116Sdteske * XXX rename these arrays to be consistent and less namespace-hostile
40274116Sdteske *
41274116Sdteske * XXX as libi386 and biosboot merge, some of these can become linker sets.
42274116Sdteske */
43274116Sdteske
44274116Sdteske#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
45274116Sdteske#error "Cannot have both tftp and nfs support yet."
46274116Sdteske#endif
47274116Sdteske
48274116Sdteske/* Exported for libstand */
49274116Sdteskestruct devsw *devsw[] = {
50274116Sdteske    &biosdisk,
51274116Sdteske#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
52274116Sdteske    &pxedisk,
53274116Sdteske#endif
54274116Sdteske    NULL
55274116Sdteske};
56274116Sdteske
57274116Sdteskestruct fs_ops *file_system[] = {
58274116Sdteske    &ufs_fsops,
59274116Sdteske    &ext2fs_fsops,
60274116Sdteske    &dosfs_fsops,
61274116Sdteske    &zipfs_fsops,
62274116Sdteske#ifdef LOADER_NFS_SUPPORT
63274116Sdteske    &nfs_fsops,
64274116Sdteske#endif
65274116Sdteske#ifdef LOADER_TFTP_SUPPORT
66274116Sdteske    &tftp_fsops,
67274116Sdteske#endif
68274116Sdteske    NULL
69274116Sdteske};
70274116Sdteske
71274116Sdteske/* Exported for i386 only */
72274116Sdteske/*
73274116Sdteske * Sort formats so that those that can detect based on arguments
74274116Sdteske * rather than reading the file go first.
75274116Sdteske */
76274116Sdteskeextern struct module_format	i386_aout;
77274116Sdteskeextern struct module_format	i386_elf;
78274116Sdteske
79274116Sdteskestruct module_format *module_formats[] = {
80274116Sdteske    &i386_elf,
81274116Sdteske    &i386_aout,
82274116Sdteske    NULL
83274116Sdteske};
84274116Sdteske
85274116Sdteske/*
86274116Sdteske * Consoles
87274116Sdteske *
88274116Sdteske * We don't prototype these in libi386.h because they require
89274116Sdteske * data structures from bootstrap.h as well.
90274116Sdteske */
91274116Sdteskeextern struct console vidconsole;
92274116Sdteskeextern struct console comconsole;
93274116Sdteske
94274116Sdteskestruct console *consoles[] = {
95274116Sdteske    &vidconsole,
96274116Sdteske    &comconsole,
97274116Sdteske    NULL
98274116Sdteske};
99274116Sdteske
100274116Sdteskeextern struct pnphandler isapnphandler;
101274116Sdteskeextern struct pnphandler biospnphandler;
102274116Sdteskeextern struct pnphandler biospcihandler;
103274116Sdteske
104274116Sdteskestruct pnphandler *pnphandlers[] = {
105274116Sdteske    &biospnphandler,		/* should go first, as it may set isapnp_readport */
106274116Sdteske    &isapnphandler,
107274116Sdteske    &biospcihandler,
108274116Sdteske    NULL
109274116Sdteske};
110274116Sdteske