1998-08-21 03:17:42 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2003-08-25 23:28:32 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
1998-08-21 03:17:42 +00:00
|
|
|
#include <stand.h>
|
|
|
|
#include <bootstrap.h>
|
|
|
|
#include "libi386/libi386.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* We could use linker sets for some or all of these, but
|
|
|
|
* then we would have to control what ended up linked into
|
|
|
|
* the bootstrap. So it's easier to conditionalise things
|
|
|
|
* here.
|
|
|
|
*
|
|
|
|
* XXX rename these arrays to be consistent and less namespace-hostile
|
|
|
|
*
|
|
|
|
* XXX as libi386 and biosboot merge, some of these can become linker sets.
|
|
|
|
*/
|
|
|
|
|
2000-04-08 01:22:14 +00:00
|
|
|
#if defined(LOADER_NFS_SUPPORT) && defined(LOADER_TFTP_SUPPORT)
|
|
|
|
#error "Cannot have both tftp and nfs support yet."
|
|
|
|
#endif
|
|
|
|
|
1998-08-21 03:17:42 +00:00
|
|
|
/* Exported for libstand */
|
|
|
|
struct devsw *devsw[] = {
|
2001-11-05 18:59:13 +00:00
|
|
|
&bioscd,
|
1998-09-18 02:03:30 +00:00
|
|
|
&biosdisk,
|
2000-04-08 01:22:14 +00:00
|
|
|
#if defined(LOADER_NFS_SUPPORT) || defined(LOADER_TFTP_SUPPORT)
|
2000-03-28 01:19:53 +00:00
|
|
|
&pxedisk,
|
2000-04-08 01:22:14 +00:00
|
|
|
#endif
|
1998-08-21 03:17:42 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
struct fs_ops *file_system[] = {
|
|
|
|
&ufs_fsops,
|
2000-04-29 20:49:33 +00:00
|
|
|
&ext2fs_fsops,
|
1998-08-21 03:17:42 +00:00
|
|
|
&dosfs_fsops,
|
2001-11-05 18:59:13 +00:00
|
|
|
&cd9660_fsops,
|
2002-03-17 12:18:05 +00:00
|
|
|
&splitfs_fsops,
|
2001-09-18 14:52:36 +00:00
|
|
|
#ifdef LOADER_GZIP_SUPPORT
|
2002-12-19 19:34:59 +00:00
|
|
|
&gzipfs_fsops,
|
2001-09-18 14:52:36 +00:00
|
|
|
#endif
|
|
|
|
#ifdef LOADER_BZIP2_SUPPORT
|
|
|
|
&bzipfs_fsops,
|
|
|
|
#endif
|
2000-04-08 01:22:14 +00:00
|
|
|
#ifdef LOADER_NFS_SUPPORT
|
|
|
|
&nfs_fsops,
|
|
|
|
#endif
|
|
|
|
#ifdef LOADER_TFTP_SUPPORT
|
|
|
|
&tftp_fsops,
|
|
|
|
#endif
|
1998-08-21 03:17:42 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Exported for i386 only */
|
|
|
|
/*
|
|
|
|
* Sort formats so that those that can detect based on arguments
|
|
|
|
* rather than reading the file go first.
|
|
|
|
*/
|
2000-05-01 17:41:25 +00:00
|
|
|
extern struct file_format i386_elf;
|
2003-05-01 03:56:30 +00:00
|
|
|
extern struct file_format amd64_elf;
|
1998-08-21 03:17:42 +00:00
|
|
|
|
2000-05-01 17:41:25 +00:00
|
|
|
struct file_format *file_formats[] = {
|
1998-09-30 19:48:42 +00:00
|
|
|
&i386_elf,
|
2003-05-01 03:56:30 +00:00
|
|
|
&amd64_elf,
|
1998-08-21 03:17:42 +00:00
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Consoles
|
|
|
|
*
|
|
|
|
* We don't prototype these in libi386.h because they require
|
|
|
|
* data structures from bootstrap.h as well.
|
|
|
|
*/
|
|
|
|
extern struct console vidconsole;
|
|
|
|
extern struct console comconsole;
|
2000-09-20 18:13:36 +00:00
|
|
|
extern struct console nullconsole;
|
1998-08-21 03:17:42 +00:00
|
|
|
|
|
|
|
struct console *consoles[] = {
|
|
|
|
&vidconsole,
|
|
|
|
&comconsole,
|
2000-09-20 18:13:36 +00:00
|
|
|
&nullconsole,
|
1998-08-21 03:17:42 +00:00
|
|
|
NULL
|
|
|
|
};
|
1998-09-14 18:27:06 +00:00
|
|
|
|
|
|
|
extern struct pnphandler isapnphandler;
|
1998-10-22 20:23:58 +00:00
|
|
|
extern struct pnphandler biospnphandler;
|
1998-10-23 22:29:19 +00:00
|
|
|
extern struct pnphandler biospcihandler;
|
1998-09-14 18:27:06 +00:00
|
|
|
|
|
|
|
struct pnphandler *pnphandlers[] = {
|
1998-10-22 20:23:58 +00:00
|
|
|
&biospnphandler, /* should go first, as it may set isapnp_readport */
|
1998-10-21 20:10:33 +00:00
|
|
|
&isapnphandler,
|
1998-10-23 22:29:19 +00:00
|
|
|
&biospcihandler,
|
1998-09-14 18:27:06 +00:00
|
|
|
NULL
|
|
|
|
};
|