1114407Snyan/*- 2114407Snyan * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3114407Snyan * All rights reserved. 4114407Snyan * 5114407Snyan * Redistribution and use in source and binary forms, with or without 6114407Snyan * modification, are permitted provided that the following conditions 7114407Snyan * are met: 8114407Snyan * 1. Redistributions of source code must retain the above copyright 9114407Snyan * notice, this list of conditions and the following disclaimer. 10114407Snyan * 2. Redistributions in binary form must reproduce the above copyright 11114407Snyan * notice, this list of conditions and the following disclaimer in the 12114407Snyan * documentation and/or other materials provided with the distribution. 13114407Snyan * 14114407Snyan * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15114407Snyan * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16114407Snyan * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17114407Snyan * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18114407Snyan * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19114407Snyan * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20114407Snyan * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21114407Snyan * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22114407Snyan * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23114407Snyan * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24114407Snyan * SUCH DAMAGE. 25114407Snyan */ 26114407Snyan 27119880Sobrien#include <sys/cdefs.h> 28119880Sobrien__FBSDID("$FreeBSD$"); 29119880Sobrien 30114407Snyan#include <stand.h> 31114407Snyan#include <bootstrap.h> 32114407Snyan#include "libi386/libi386.h" 33114407Snyan 34114407Snyan/* 35114407Snyan * We could use linker sets for some or all of these, but 36114407Snyan * then we would have to control what ended up linked into 37114407Snyan * the bootstrap. So it's easier to conditionalise things 38114407Snyan * here. 39114407Snyan * 40114407Snyan * XXX rename these arrays to be consistent and less namespace-hostile 41114407Snyan * 42114407Snyan * XXX as libi386 and biosboot merge, some of these can become linker sets. 43114407Snyan */ 44114407Snyan 45114407Snyan#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT) 46114407Snyan#error "Cannot have both tftp and nfs support yet." 47114407Snyan#endif 48114407Snyan 49114407Snyan/* Exported for libstand */ 50114407Snyanstruct devsw *devsw[] = { 51114407Snyan &bioscd, 52114407Snyan &biosdisk, 53114407Snyan#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT) 54114407Snyan &pxedisk, 55114407Snyan#endif 56114407Snyan NULL 57114407Snyan}; 58114407Snyan 59114407Snyanstruct fs_ops *file_system[] = { 60114407Snyan &ufs_fsops, 61114407Snyan &ext2fs_fsops, 62114407Snyan &dosfs_fsops, 63114407Snyan &cd9660_fsops, 64277946Sjhb#ifdef LOADER_NFS_SUPPORT 65277946Sjhb &nfs_fsops, 66277946Sjhb#endif 67277946Sjhb#ifdef LOADER_TFTP_SUPPORT 68277946Sjhb &tftp_fsops, 69277946Sjhb#endif 70114407Snyan#ifdef LOADER_GZIP_SUPPORT 71114407Snyan &gzipfs_fsops, 72114407Snyan#endif 73114407Snyan#ifdef LOADER_BZIP2_SUPPORT 74114407Snyan &bzipfs_fsops, 75114407Snyan#endif 76277946Sjhb &splitfs_fsops, 77114407Snyan NULL 78114407Snyan}; 79114407Snyan 80114407Snyan/* Exported for i386 only */ 81114407Snyan/* 82114407Snyan * Sort formats so that those that can detect based on arguments 83114407Snyan * rather than reading the file go first. 84114407Snyan */ 85114407Snyanextern struct file_format i386_elf; 86136890Snyanextern struct file_format i386_elf_obj; 87114407Snyan 88114407Snyanstruct file_format *file_formats[] = { 89114407Snyan &i386_elf, 90136890Snyan &i386_elf_obj, 91114407Snyan NULL 92114407Snyan}; 93114407Snyan 94114407Snyan/* 95114407Snyan * Consoles 96114407Snyan * 97114407Snyan * We don't prototype these in libi386.h because they require 98114407Snyan * data structures from bootstrap.h as well. 99114407Snyan */ 100114407Snyanextern struct console vidconsole; 101114407Snyanextern struct console comconsole; 102114407Snyanextern struct console nullconsole; 103114407Snyan 104114407Snyanstruct console *consoles[] = { 105114407Snyan &vidconsole, 106114407Snyan &comconsole, 107114407Snyan &nullconsole, 108114407Snyan NULL 109114407Snyan}; 110114407Snyan 111114407Snyanextern struct pnphandler isapnphandler; 112114407Snyanextern struct pnphandler biospnphandler; 113114407Snyanextern struct pnphandler biospcihandler; 114114407Snyan 115114407Snyanstruct pnphandler *pnphandlers[] = { 116114407Snyan &biospnphandler, /* should go first, as it may set isapnp_readport */ 117114407Snyan &isapnphandler, 118114407Snyan &biospcihandler, 119114407Snyan NULL 120114407Snyan}; 121