conf.c revision 277946
1193323Sed/*- 2193323Sed * Copyright (c) 1998 Michael Smith <msmith@freebsd.org> 3193323Sed * All rights reserved. 4193323Sed * 5193323Sed * Redistribution and use in source and binary forms, with or without 6193323Sed * modification, are permitted provided that the following conditions 7193323Sed * are met: 8193323Sed * 1. Redistributions of source code must retain the above copyright 9193323Sed * notice, this list of conditions and the following disclaimer. 10193323Sed * 2. Redistributions in binary form must reproduce the above copyright 11193323Sed * notice, this list of conditions and the following disclaimer in the 12193323Sed * documentation and/or other materials provided with the distribution. 13193323Sed * 14193323Sed * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15193323Sed * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16193323Sed * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17193323Sed * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18198090Srdivacky * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19193323Sed * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20193323Sed * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21193323Sed * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22193323Sed * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23193323Sed * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24198090Srdivacky * SUCH DAMAGE. 25198090Srdivacky */ 26198090Srdivacky 27193323Sed#include <sys/cdefs.h> 28193323Sed__FBSDID("$FreeBSD: stable/10/sys/boot/pc98/loader/conf.c 277946 2015-01-30 18:55:05Z jhb $"); 29193323Sed 30193323Sed#include <stand.h> 31193323Sed#include <bootstrap.h> 32198090Srdivacky#include "libi386/libi386.h" 33193323Sed 34193323Sed/* 35193323Sed * We could use linker sets for some or all of these, but 36193323Sed * then we would have to control what ended up linked into 37193323Sed * the bootstrap. So it's easier to conditionalise things 38193323Sed * here. 39193323Sed * 40193323Sed * XXX rename these arrays to be consistent and less namespace-hostile 41193323Sed * 42193323Sed * XXX as libi386 and biosboot merge, some of these can become linker sets. 43193323Sed */ 44193323Sed 45193323Sed#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT) 46193323Sed#error "Cannot have both tftp and nfs support yet." 47193323Sed#endif 48193323Sed 49193323Sed/* Exported for libstand */ 50193323Sedstruct devsw *devsw[] = { 51193323Sed &bioscd, 52193323Sed &biosdisk, 53193323Sed#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT) 54193323Sed &pxedisk, 55193323Sed#endif 56193323Sed NULL 57193323Sed}; 58193323Sed 59193323Sedstruct fs_ops *file_system[] = { 60193323Sed &ufs_fsops, 61193323Sed &ext2fs_fsops, 62198090Srdivacky &dosfs_fsops, 63193323Sed &cd9660_fsops, 64193323Sed#ifdef LOADER_NFS_SUPPORT 65193323Sed &nfs_fsops, 66193323Sed#endif 67193323Sed#ifdef LOADER_TFTP_SUPPORT 68193323Sed &tftp_fsops, 69193323Sed#endif 70193323Sed#ifdef LOADER_GZIP_SUPPORT 71198090Srdivacky &gzipfs_fsops, 72198090Srdivacky#endif 73193323Sed#ifdef LOADER_BZIP2_SUPPORT 74193323Sed &bzipfs_fsops, 75193323Sed#endif 76193323Sed &splitfs_fsops, 77193323Sed NULL 78198090Srdivacky}; 79198090Srdivacky 80198090Srdivacky/* Exported for i386 only */ 81198090Srdivacky/* 82198090Srdivacky * Sort formats so that those that can detect based on arguments 83198090Srdivacky * rather than reading the file go first. 84193323Sed */ 85193323Sedextern struct file_format i386_elf; 86198090Srdivackyextern struct file_format i386_elf_obj; 87198090Srdivacky 88198090Srdivackystruct file_format *file_formats[] = { 89198090Srdivacky &i386_elf, 90198090Srdivacky &i386_elf_obj, 91198090Srdivacky NULL 92198090Srdivacky}; 93198090Srdivacky 94198090Srdivacky/* 95198090Srdivacky * Consoles 96198090Srdivacky * 97198090Srdivacky * We don't prototype these in libi386.h because they require 98198090Srdivacky * data structures from bootstrap.h as well. 99198090Srdivacky */ 100198090Srdivackyextern struct console vidconsole; 101198090Srdivackyextern struct console comconsole; 102198090Srdivackyextern struct console nullconsole; 103198090Srdivacky 104198090Srdivackystruct console *consoles[] = { 105198090Srdivacky &vidconsole, 106198090Srdivacky &comconsole, 107198090Srdivacky &nullconsole, 108198090Srdivacky NULL 109198090Srdivacky}; 110198090Srdivacky 111198090Srdivackyextern struct pnphandler isapnphandler; 112198090Srdivackyextern struct pnphandler biospnphandler; 113198090Srdivackyextern struct pnphandler biospcihandler; 114198090Srdivacky 115198090Srdivackystruct pnphandler *pnphandlers[] = { 116198090Srdivacky &biospnphandler, /* should go first, as it may set isapnp_readport */ 117198090Srdivacky &isapnphandler, 118198090Srdivacky &biospcihandler, 119198090Srdivacky NULL 120198090Srdivacky}; 121198090Srdivacky