conf.c revision 86093
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 86093 2001-11-05 18:59:13Z jhb $ 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[] = { 5086093Sjhb &bioscd, 5139450Smsmith &biosdisk, 5259087Sps#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT) 5358713Sjhb &pxedisk, 5459087Sps#endif 5538465Smsmith NULL 5638465Smsmith}; 5738465Smsmith 5838465Smsmithstruct fs_ops *file_system[] = { 5938465Smsmith &ufs_fsops, 6059767Sjlemon &ext2fs_fsops, 6138465Smsmith &dosfs_fsops, 6286093Sjhb &cd9660_fsops, 6383616Ssobomax#ifdef LOADER_GZIP_SUPPORT 6438465Smsmith &zipfs_fsops, 6583616Ssobomax#endif 6683616Ssobomax#ifdef LOADER_BZIP2_SUPPORT 6783616Ssobomax &bzipfs_fsops, 6883616Ssobomax#endif 6959087Sps#ifdef LOADER_NFS_SUPPORT 7059087Sps &nfs_fsops, 7159087Sps#endif 7259087Sps#ifdef LOADER_TFTP_SUPPORT 7359087Sps &tftp_fsops, 7459087Sps#endif 7538465Smsmith NULL 7638465Smsmith}; 7738465Smsmith 7838465Smsmith/* Exported for i386 only */ 7938465Smsmith/* 8038465Smsmith * Sort formats so that those that can detect based on arguments 8138465Smsmith * rather than reading the file go first. 8238465Smsmith */ 8359854Sbpextern struct file_format i386_aout; 8459854Sbpextern struct file_format i386_elf; 8538465Smsmith 8659854Sbpstruct file_format *file_formats[] = { 8739834Speter &i386_elf, 8839731Speter &i386_aout, 8938465Smsmith NULL 9038465Smsmith}; 9138465Smsmith 9238465Smsmith/* 9338465Smsmith * Consoles 9438465Smsmith * 9538465Smsmith * We don't prototype these in libi386.h because they require 9638465Smsmith * data structures from bootstrap.h as well. 9738465Smsmith */ 9838465Smsmithextern struct console vidconsole; 9938465Smsmithextern struct console comconsole; 10066133Sarchieextern struct console nullconsole; 10138465Smsmith 10238465Smsmithstruct console *consoles[] = { 10338465Smsmith &vidconsole, 10438465Smsmith &comconsole, 10566133Sarchie &nullconsole, 10638465Smsmith NULL 10738465Smsmith}; 10839178Smsmith 10939178Smsmithextern struct pnphandler isapnphandler; 11040600Smsmithextern struct pnphandler biospnphandler; 11140618Smsmithextern struct pnphandler biospcihandler; 11239178Smsmith 11339178Smsmithstruct pnphandler *pnphandlers[] = { 11440600Smsmith &biospnphandler, /* should go first, as it may set isapnp_readport */ 11540555Smsmith &isapnphandler, 11640618Smsmith &biospcihandler, 11739178Smsmith NULL 11839178Smsmith}; 119