conf.c revision 83616
138465Smsmith/*-
238465Smsmith * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
338465Smsmith * All rights reserved.
438465Smsmith *
538465Smsmith * Redistribution and use in source and binary forms, with or without
638465Smsmith * modification, are permitted provided that the following conditions
738465Smsmith * are met:
838465Smsmith * 1. Redistributions of source code must retain the above copyright
938465Smsmith *    notice, this list of conditions and the following disclaimer.
1038465Smsmith * 2. Redistributions in binary form must reproduce the above copyright
1138465Smsmith *    notice, this list of conditions and the following disclaimer in the
1238465Smsmith *    documentation and/or other materials provided with the distribution.
1338465Smsmith *
1438465Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1538465Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1638465Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1738465Smsmith * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1838465Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1938465Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2038465Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2138465Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2238465Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2338465Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2438465Smsmith * SUCH DAMAGE.
2538465Smsmith *
2650477Speter * $FreeBSD: head/sys/boot/i386/loader/conf.c 83616 2001-09-18 14:52:36Z sobomax $
2738465Smsmith */
2838465Smsmith
2938465Smsmith#include <stand.h>
3038465Smsmith#include <bootstrap.h>
3138465Smsmith#include "libi386/libi386.h"
3238465Smsmith
3338465Smsmith/*
3438465Smsmith * We could use linker sets for some or all of these, but
3538465Smsmith * then we would have to control what ended up linked into
3638465Smsmith * the bootstrap.  So it's easier to conditionalise things
3738465Smsmith * here.
3838465Smsmith *
3938465Smsmith * XXX rename these arrays to be consistent and less namespace-hostile
4038465Smsmith *
4138465Smsmith * XXX as libi386 and biosboot merge, some of these can become linker sets.
4238465Smsmith */
4338465Smsmith
4459087Sps#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
4559087Sps#error "Cannot have both tftp and nfs support yet."
4659087Sps#endif
4759087Sps
4838465Smsmith/* Exported for libstand */
4938465Smsmithstruct devsw *devsw[] = {
5039450Smsmith    &biosdisk,
5159087Sps#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
5258713Sjhb    &pxedisk,
5359087Sps#endif
5438465Smsmith    NULL
5538465Smsmith};
5638465Smsmith
5738465Smsmithstruct fs_ops *file_system[] = {
5838465Smsmith    &ufs_fsops,
5959767Sjlemon    &ext2fs_fsops,
6038465Smsmith    &dosfs_fsops,
6183616Ssobomax#ifdef LOADER_GZIP_SUPPORT
6238465Smsmith    &zipfs_fsops,
6383616Ssobomax#endif
6483616Ssobomax#ifdef LOADER_BZIP2_SUPPORT
6583616Ssobomax    &bzipfs_fsops,
6683616Ssobomax#endif
6759087Sps#ifdef LOADER_NFS_SUPPORT
6859087Sps    &nfs_fsops,
6959087Sps#endif
7059087Sps#ifdef LOADER_TFTP_SUPPORT
7159087Sps    &tftp_fsops,
7259087Sps#endif
7338465Smsmith    NULL
7438465Smsmith};
7538465Smsmith
7638465Smsmith/* Exported for i386 only */
7738465Smsmith/*
7838465Smsmith * Sort formats so that those that can detect based on arguments
7938465Smsmith * rather than reading the file go first.
8038465Smsmith */
8159854Sbpextern struct file_format	i386_aout;
8259854Sbpextern struct file_format	i386_elf;
8338465Smsmith
8459854Sbpstruct file_format *file_formats[] = {
8539834Speter    &i386_elf,
8639731Speter    &i386_aout,
8738465Smsmith    NULL
8838465Smsmith};
8938465Smsmith
9038465Smsmith/*
9138465Smsmith * Consoles
9238465Smsmith *
9338465Smsmith * We don't prototype these in libi386.h because they require
9438465Smsmith * data structures from bootstrap.h as well.
9538465Smsmith */
9638465Smsmithextern struct console vidconsole;
9738465Smsmithextern struct console comconsole;
9866133Sarchieextern struct console nullconsole;
9938465Smsmith
10038465Smsmithstruct console *consoles[] = {
10138465Smsmith    &vidconsole,
10238465Smsmith    &comconsole,
10366133Sarchie    &nullconsole,
10438465Smsmith    NULL
10538465Smsmith};
10639178Smsmith
10739178Smsmithextern struct pnphandler isapnphandler;
10840600Smsmithextern struct pnphandler biospnphandler;
10940618Smsmithextern struct pnphandler biospcihandler;
11039178Smsmith
11139178Smsmithstruct pnphandler *pnphandlers[] = {
11240600Smsmith    &biospnphandler,		/* should go first, as it may set isapnp_readport */
11340555Smsmith    &isapnphandler,
11440618Smsmith    &biospcihandler,
11539178Smsmith    NULL
11639178Smsmith};
117