/*-1* Copyright (c) 1998 Michael Smith <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526#include <stand.h>27#include <bootstrap.h>28#include "libi386/libi386.h"29#if defined(LOADER_ZFS_SUPPORT)30#include "libzfs.h"31#endif3233/*34* We could use linker sets for some or all of these, but35* then we would have to control what ended up linked into36* the bootstrap. So it's easier to conditionalise things37* here.38*39* XXX rename these arrays to be consistent and less namespace-hostile40*41* XXX as libi386 and biosboot merge, some of these can become linker sets.42*/4344extern struct devsw vdisk_dev;4546/* Exported for libsa */47struct devsw *devsw[] = {48&biosfd,49&bioscd,50&bioshd,51#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)52&pxedisk,53#endif54&vdisk_dev,55#if defined(LOADER_ZFS_SUPPORT)56&zfs_dev,57#endif58NULL59};6061struct fs_ops *file_system[] = {62#if defined(LOADER_ZFS_SUPPORT)63&zfs_fsops,64#endif65#if defined(LOADER_UFS_SUPPORT)66&ufs_fsops,67#endif68#if defined(LOADER_EXT2FS_SUPPORT)69&ext2fs_fsops,70#endif71#if defined(LOADER_MSDOS_SUPPORT)72&dosfs_fsops,73#endif74#if defined(LOADER_CD9660_SUPPORT)75&cd9660_fsops,76#endif77#ifdef LOADER_NFS_SUPPORT78&nfs_fsops,79#endif80#ifdef LOADER_TFTP_SUPPORT81&tftp_fsops,82#endif83#ifdef LOADER_GZIP_SUPPORT84&gzipfs_fsops,85#endif86#ifdef LOADER_BZIP2_SUPPORT87&bzipfs_fsops,88#endif89#ifdef LOADER_SPLIT_SUPPORT90&splitfs_fsops,91#endif92NULL93};9495/* Exported for i386 only */96/*97* Sort formats so that those that can detect based on arguments98* rather than reading the file go first.99*/100extern struct file_format i386_elf;101extern struct file_format i386_elf_obj;102extern struct file_format amd64_elf;103extern struct file_format amd64_elf_obj;104extern struct file_format multiboot;105extern struct file_format multiboot_obj;106107struct file_format *file_formats[] = {108&multiboot,109&multiboot_obj,110#ifdef LOADER_PREFER_AMD64111&amd64_elf,112&amd64_elf_obj,113#endif114&i386_elf,115&i386_elf_obj,116#ifndef LOADER_PREFER_AMD64117&amd64_elf,118&amd64_elf_obj,119#endif120NULL121};122123/*124* Consoles125*126* We don't prototype these in libi386.h because they require127* data structures from bootstrap.h as well.128*/129extern struct console textvidc;130extern struct console vidconsole;131extern struct console comconsole;132extern struct console nullconsole;133extern struct console spinconsole;134135struct console *consoles[] = {136#ifdef BIOS_TEXT_ONLY /* Note: We need a forced commit for this */137&textvidc,138#else139&vidconsole,140#endif141&comconsole,142&nullconsole,143&spinconsole,144NULL145};146147extern struct pnphandler isapnphandler;148extern struct pnphandler biospnphandler;149extern struct pnphandler biospcihandler;150151struct pnphandler *pnphandlers[] = {152&biospnphandler, /* should go first, as it may set isapnp_readport */153&isapnphandler,154&biospcihandler,155NULL156};157158159