11590Srgrimes/*-
21590Srgrimes * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
31590Srgrimes * All rights reserved.
41590Srgrimes *
51590Srgrimes * Redistribution and use in source and binary forms, with or without
61590Srgrimes * modification, are permitted provided that the following conditions
71590Srgrimes * are met:
81590Srgrimes * 1. Redistributions of source code must retain the above copyright
91590Srgrimes *    notice, this list of conditions and the following disclaimer.
101590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright
111590Srgrimes *    notice, this list of conditions and the following disclaimer in the
121590Srgrimes *    documentation and/or other materials provided with the distribution.
131590Srgrimes *
141590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
151590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
161590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
171590Srgrimes * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
181590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
191590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
201590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
211590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
221590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
231590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
241590Srgrimes * SUCH DAMAGE.
251590Srgrimes */
261590Srgrimes
271590Srgrimes#include <sys/cdefs.h>
281590Srgrimes__FBSDID("$FreeBSD$");
291590Srgrimes
301590Srgrimes#include <stand.h>
311590Srgrimes#include <bootstrap.h>
321590Srgrimes#include "libi386/libi386.h"
331590Srgrimes
341590Srgrimes/*
3599112Sobrien * We could use linker sets for some or all of these, but
36116390Scharnier * then we would have to control what ended up linked into
3799112Sobrien * the bootstrap.  So it's easier to conditionalise things
381590Srgrimes * here.
39116390Scharnier *
4099112Sobrien * XXX rename these arrays to be consistent and less namespace-hostile
41116390Scharnier *
4299112Sobrien * XXX as libi386 and biosboot merge, some of these can become linker sets.
4399112Sobrien */
4499112Sobrien
45116390Scharnier#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
461590Srgrimes#error "Cannot have both tftp and nfs support yet."
471590Srgrimes#endif
481590Srgrimes
4985632Sschweikh/* Exported for libstand */
501590Srgrimesstruct devsw *devsw[] = {
511590Srgrimes    &bioscd,
521590Srgrimes    &biosdisk,
531590Srgrimes#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
541590Srgrimes    &pxedisk,
551590Srgrimes#endif
561590Srgrimes    NULL
571590Srgrimes};
581590Srgrimes
591590Srgrimesstruct fs_ops *file_system[] = {
601590Srgrimes    &ufs_fsops,
611590Srgrimes    &ext2fs_fsops,
621590Srgrimes    &dosfs_fsops,
631590Srgrimes    &cd9660_fsops,
641590Srgrimes#ifdef LOADER_NFS_SUPPORT
651590Srgrimes    &nfs_fsops,
661590Srgrimes#endif
671590Srgrimes#ifdef LOADER_TFTP_SUPPORT
681590Srgrimes    &tftp_fsops,
691590Srgrimes#endif
701590Srgrimes#ifdef LOADER_GZIP_SUPPORT
711590Srgrimes    &gzipfs_fsops,
721590Srgrimes#endif
731590Srgrimes#ifdef LOADER_BZIP2_SUPPORT
741590Srgrimes    &bzipfs_fsops,
751590Srgrimes#endif
761590Srgrimes    &splitfs_fsops,
771590Srgrimes    NULL
781590Srgrimes};
791590Srgrimes
801590Srgrimes/* Exported for i386 only */
8185632Sschweikh/*
8285632Sschweikh * Sort formats so that those that can detect based on arguments
831590Srgrimes * rather than reading the file go first.
841590Srgrimes */
851590Srgrimesextern struct file_format	i386_elf;
861590Srgrimesextern struct file_format	i386_elf_obj;
871590Srgrimes
881590Srgrimesstruct file_format *file_formats[] = {
891590Srgrimes    &i386_elf,
901590Srgrimes    &i386_elf_obj,
911590Srgrimes    NULL
9285632Sschweikh};
931590Srgrimes
941590Srgrimes/*
951590Srgrimes * Consoles
961590Srgrimes *
9785632Sschweikh * We don't prototype these in libi386.h because they require
981590Srgrimes * data structures from bootstrap.h as well.
991590Srgrimes */
1001590Srgrimesextern struct console vidconsole;
1011590Srgrimesextern struct console comconsole;
1021590Srgrimesextern struct console nullconsole;
1031590Srgrimes
1041590Srgrimesstruct console *consoles[] = {
1051590Srgrimes    &vidconsole,
1061590Srgrimes    &comconsole,
1071590Srgrimes    &nullconsole,
1081590Srgrimes    NULL
1091590Srgrimes};
1101590Srgrimes
1111590Srgrimesextern struct pnphandler isapnphandler;
1121590Srgrimesextern struct pnphandler biospnphandler;
1131590Srgrimesextern struct pnphandler biospcihandler;
1141590Srgrimes
1151590Srgrimesstruct pnphandler *pnphandlers[] = {
1161590Srgrimes    &biospnphandler,		/* should go first, as it may set isapnp_readport */
1171590Srgrimes    &isapnphandler,
1181590Srgrimes    &biospcihandler,
1191590Srgrimes    NULL
12069795Sobrien};
12169795Sobrien