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: stable/11/stand/pc98/loader/conf.c 307632 2016-10-19 13:26:07Z bapt $"); 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/* Exported for libstand */ 46114407Snyanstruct devsw *devsw[] = { 47114407Snyan &bioscd, 48114407Snyan &biosdisk, 49114407Snyan#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT) 50114407Snyan &pxedisk, 51114407Snyan#endif 52114407Snyan NULL 53114407Snyan}; 54114407Snyan 55114407Snyanstruct fs_ops *file_system[] = { 56114407Snyan &ufs_fsops, 57114407Snyan &ext2fs_fsops, 58114407Snyan &dosfs_fsops, 59114407Snyan &cd9660_fsops, 60274537Snyan#ifdef LOADER_NFS_SUPPORT 61274537Snyan &nfs_fsops, 62274537Snyan#endif 63274537Snyan#ifdef LOADER_TFTP_SUPPORT 64274537Snyan &tftp_fsops, 65274537Snyan#endif 66114407Snyan#ifdef LOADER_GZIP_SUPPORT 67114407Snyan &gzipfs_fsops, 68114407Snyan#endif 69114407Snyan#ifdef LOADER_BZIP2_SUPPORT 70114407Snyan &bzipfs_fsops, 71114407Snyan#endif 72274537Snyan &splitfs_fsops, 73114407Snyan NULL 74114407Snyan}; 75114407Snyan 76114407Snyan/* Exported for i386 only */ 77114407Snyan/* 78114407Snyan * Sort formats so that those that can detect based on arguments 79114407Snyan * rather than reading the file go first. 80114407Snyan */ 81114407Snyanextern struct file_format i386_elf; 82136890Snyanextern struct file_format i386_elf_obj; 83114407Snyan 84114407Snyanstruct file_format *file_formats[] = { 85114407Snyan &i386_elf, 86136890Snyan &i386_elf_obj, 87114407Snyan NULL 88114407Snyan}; 89114407Snyan 90114407Snyan/* 91114407Snyan * Consoles 92114407Snyan * 93114407Snyan * We don't prototype these in libi386.h because they require 94114407Snyan * data structures from bootstrap.h as well. 95114407Snyan */ 96114407Snyanextern struct console vidconsole; 97114407Snyanextern struct console comconsole; 98114407Snyanextern struct console nullconsole; 99114407Snyan 100114407Snyanstruct console *consoles[] = { 101114407Snyan &vidconsole, 102114407Snyan &comconsole, 103114407Snyan &nullconsole, 104114407Snyan NULL 105114407Snyan}; 106114407Snyan 107114407Snyanextern struct pnphandler isapnphandler; 108114407Snyanextern struct pnphandler biospnphandler; 109114407Snyanextern struct pnphandler biospcihandler; 110114407Snyan 111114407Snyanstruct pnphandler *pnphandlers[] = { 112114407Snyan &biospnphandler, /* should go first, as it may set isapnp_readport */ 113114407Snyan &isapnphandler, 114114407Snyan &biospcihandler, 115114407Snyan NULL 116114407Snyan}; 117