summaryrefslogtreecommitdiff
path: root/sys/arch/i386/stand
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>1997-09-21 10:02:12 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>1997-09-21 10:02:12 +0000
commitca43aba394c3633bb3f02c9b89df7495e6db5e89 (patch)
tree67137dea79b93e7fe854e5c58be2044181e798cc /sys/arch/i386/stand
parent572cbf65df19540fed3718f8771b519637279d55 (diff)
/boot engine is in sys/stand/boot/ now (;
use it, reuse it, i can't imagine any brokenness ...
Diffstat (limited to 'sys/arch/i386/stand')
-rw-r--r--sys/arch/i386/stand/boot/Makefile4
-rw-r--r--sys/arch/i386/stand/boot/boot.c98
-rw-r--r--sys/arch/i386/stand/boot/boot.conf4
-rw-r--r--sys/arch/i386/stand/boot/cmd.c628
-rw-r--r--sys/arch/i386/stand/boot/cmd.h63
-rw-r--r--sys/arch/i386/stand/libsa/Makefile4
6 files changed, 5 insertions, 796 deletions
diff --git a/sys/arch/i386/stand/boot/Makefile b/sys/arch/i386/stand/boot/Makefile
index 26e66918800..91ed167d967 100644
--- a/sys/arch/i386/stand/boot/Makefile
+++ b/sys/arch/i386/stand/boot/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.13 1997/09/02 21:58:20 mickey Exp $
+# $OpenBSD: Makefile,v 1.14 1997/09/21 10:02:09 mickey Exp $
PROG= boot
SRCS= srt0.S boot.c cmd.c conf.c
@@ -13,6 +13,8 @@ SADIR= ${.CURDIR}/..
LDADD= ${LIBSA} ${LIBZ}
DPADD= ${LIBSA} ${LIBZ}
+.PATH: ${S}/stand/boot
+
all: machine-links
machine-links:
diff --git a/sys/arch/i386/stand/boot/boot.c b/sys/arch/i386/stand/boot/boot.c
deleted file mode 100644
index d4a228436d8..00000000000
--- a/sys/arch/i386/stand/boot/boot.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/* $OpenBSD: boot.c,v 1.16 1997/09/02 21:37:38 mickey Exp $ */
-
-/*
- * Copyright (c) 1997 Michael Shalayeff
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Michael Shalayeff.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 REGENTS 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.
- *
- */
-
-#include <sys/param.h>
-#include <sys/reboot.h>
-#include <sys/stat.h>
-#include <libsa.h>
-#include "cmd.h"
-
-const char *const kernels[] = {
- "/bsd", "/bsd.gz",
- "/obsd", "/obsd.gz",
- NULL
-};
-
-extern const char version[];
-struct cmd_state cmd;
-
-void
-boot(bootdev)
- dev_t bootdev;
-{
- register const char *bootfile = kernels[0];
- register int i = 0, f;
-
- machdep();
-
- devboot(bootdev, cmd.bootdev);
- strncpy(cmd.image, bootfile, sizeof(cmd.image));
- cmd.boothowto = 0;
- cmd.conf = "/etc/boot.conf";
- cmd.addr = (void *)0x100000;
- cmd.timeout = 5;
-
- f = read_conf();
-
- printf(">> OpenBSD BOOT %s\n", version);
-
- while (1) {
- if (f <= 0) /* no boot.conf, or no boot cmd in there */
- do {
- printf("boot> ");
- } while(!getcmd());
- f = 0;
-
- printf("booting %s: ", cmd.path);
- exec(cmd.path, cmd.addr, cmd.boothowto);
-
- if (kernels[++i] == NULL)
- bootfile = kernels[i=0];
- else
- bootfile = kernels[i];
-
- cmd.timeout++;
- printf(" failed(%d). will try %s\n", errno, bootfile);
- strncpy(cmd.image, bootfile, sizeof(cmd.image));
- }
-}
-
-#ifdef _TEST
-int
-main()
-{
- boot(0);
- return 0;
-}
-#endif
diff --git a/sys/arch/i386/stand/boot/boot.conf b/sys/arch/i386/stand/boot/boot.conf
deleted file mode 100644
index eb0cbbcfa0e..00000000000
--- a/sys/arch/i386/stand/boot/boot.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-# $OpenBSD: boot.conf,v 1.2 1997/08/06 23:14:10 mickey Exp $
-# sample boot.conf file
-set
-echo timeout in 5 seconds
diff --git a/sys/arch/i386/stand/boot/cmd.c b/sys/arch/i386/stand/boot/cmd.c
deleted file mode 100644
index 114af576393..00000000000
--- a/sys/arch/i386/stand/boot/cmd.c
+++ /dev/null
@@ -1,628 +0,0 @@
-/* $OpenBSD: cmd.c,v 1.33 1997/09/20 22:40:37 flipk Exp $ */
-
-/*
- * Copyright (c) 1997 Michael Shalayeff
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Michael Shalayeff.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 REGENTS 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.
- *
- */
-
-#include <sys/param.h>
-#include <libsa.h>
-#include <biosdev.h>
-#include <sys/reboot.h>
-#include "cmd.h"
-
-extern int debug;
-
-#define CTRL(c) ((c)&0x1f)
-
-static int Xaddr __P((void));
-static int Xboot __P((void));
-static int Xdevice __P((void));
-#ifdef DEBUG
-static int Xdebug __P((void));
-#endif
-static int Xhelp __P((void));
-static int Ximage __P((void));
-static int Xls __P((void));
-static int Xreboot __P((void));
-static int Xset __P((void));
-static int Xstty __P((void));
-static int Xhowto __P((void));
-static int Xtty __P((void));
-static int Xtime __P((void));
-static int Xecho __P((void));
-#ifdef MACHINE_CMD
-static int Xmachine __P((void));
-extern const struct cmd_table MACHINE_CMD[];
-#endif
-
-static const struct cmd_table cmd_set[] = {
- {"addr", CMDT_VAR, Xaddr},
- {"howto", CMDT_VAR, Xhowto},
-#ifdef DEBUG
- {"debug", CMDT_VAR, Xdebug},
-#endif
- {"device", CMDT_VAR, Xdevice},
- {"tty", CMDT_VAR, Xtty},
- {"image", CMDT_VAR, Ximage},
- {NULL,0}
-};
-
-static const struct cmd_table cmd_table[] = {
- {"boot", CMDT_CMD, Xboot}, /* XXX must be first */
- {"echo", CMDT_CMD, Xecho},
- {"help", CMDT_CMD, Xhelp},
- {"ls", CMDT_CMD, Xls},
-#ifdef MACHINE_CMD
- {"machine",CMDT_MDC, Xmachine},
-#endif
- {"reboot", CMDT_CMD, Xreboot},
- {"set", CMDT_SET, Xset},
- {"stty", CMDT_CMD, Xstty},
- {"time", CMDT_CMD, Xtime},
- {NULL, 0},
-};
-
-extern const char version[];
-static void ls __P((char *, register struct stat *));
-static int readline __P((register char *, int));
-char *nextword __P((register char *));
-static int bootparse __P((int));
-static char *whatcmd
- __P((register const struct cmd_table **ct, register char *));
-static int docmd __P((void));
-static char *qualify __P((char *));
-
-static char cmd_buf[133];
-
-int
-getcmd()
-{
- cmd.cmd = NULL;
-
- if (!readline(cmd_buf, cmd.timeout))
- cmd.cmd = cmd_table;
-
- return docmd();
-}
-
-int
-read_conf()
-{
-#ifndef INSECURE
- struct stat sb;
-#endif
- int fd, eof = 0;
-
- if ((fd = open(qualify(cmd.conf), 0)) < 0) {
- if (errno != ENOENT && errno != ENXIO) {
- printf("open(%s): %s\n", cmd.path, strerror(errno));
- return 0;
- }
- return -1;
- }
-
-#ifndef INSECURE
- (void) fstat(fd, &sb);
- if (sb.st_uid || (sb.st_mode & 2)) {
- printf("non-secure %s, will not proceed\n", cmd.path);
- close(fd);
- return -1;
- }
-#endif
-
- do {
- register char *p = cmd_buf;
-
- cmd.cmd = NULL;
-
- do
- eof = read(fd, p, 1);
- while (eof > 0 && *p++ != '\n');
-
- if (eof < 0)
- printf("%s: %s\n", cmd.path, strerror(errno));
- else
- *--p = '\0';
-
- } while (eof > 0 && !(eof = docmd()));
-
- close(fd);
- return eof;
-}
-
-static int
-docmd()
-{
- register char *p = NULL;
- const struct cmd_table *ct, *cs;
-
- cmd.argc = 1;
- if (cmd.cmd == NULL) {
-
- /* command */
- for (p = cmd_buf; *p && (*p == ' ' || *p == '\t'); p++)
- ;
- if (*p == '#' || *p == '\0') { /* comment or empty string */
-#ifdef DEBUG
- printf("rem\n");
-#endif
- return 0;
- }
- ct = cmd_table;
- cs = NULL;
- cmd.argv[cmd.argc] = p; /* in case it's shortcut boot */
- p = whatcmd(&ct, p);
- if (ct == NULL) {
- cmd.argc++;
- ct = cmd_table;
- } else if (ct->cmd_type == CMDT_SET && p != NULL) {
- cs = cmd_set;
-#ifdef MACHINE_CMD
- } else if (ct->cmd_type == CMDT_MDC && p != NULL) {
- cs = MACHINE_CMD;
-#endif
- }
-
- if (cs != NULL) {
- p = whatcmd(&cs, p);
- if (cs == NULL) {
- printf("%s: syntax error\n", ct->cmd_name);
- return 0;
- }
- ct = cs;
- }
- cmd.cmd = ct;
- }
-
- cmd.argv[0] = ct->cmd_name;
- while (p && cmd.argc+1 < sizeof(cmd.argv) / sizeof(cmd.argv[0])) {
- cmd.argv[cmd.argc++] = p;
- p = nextword(p);
- }
- cmd.argv[cmd.argc] = NULL;
-
- return (*cmd.cmd->cmd_exec)();
-}
-
-static char *
-whatcmd(ct, p)
- register const struct cmd_table **ct;
- register char *p;
-{
- register char *q;
- register int l;
-
- q = nextword(p);
-
- for (l = 0; p[l]; l++)
- ;
-
- while ((*ct)->cmd_name != NULL && strncmp(p, (*ct)->cmd_name, l))
- (*ct)++;
-
- if ((*ct)->cmd_name == NULL)
- *ct = NULL;
-
- return q;
-}
-
-static int
-readline(buf, to)
- register char *buf;
- int to;
-{
- register char *p = buf, *pe = buf, ch;
- time_t tt;
-
- for (tt = getsecs() + to; getsecs() < tt && !cnischar(); )
- ;
-
- if (!cnischar())
- return 0;
-
- while (1) {
- switch ((ch = getchar())) {
- case CTRL('u'):
- while (pe-- > buf)
- putchar('\177');
- p = pe = buf;
- continue;
- case '\n':
- case '\r':
- pe[1] = *pe = '\0';
- break;
- case '\b':
- case '\177':
- if (p > buf) {
- putchar('\177');
- p--;
- pe--;
- }
- continue;
- default:
- pe++;
- *p++ = ch;
- continue;
- }
- break;
- }
-
- return pe - buf;
-}
-
-/*
- * Search for spaces/tabs after the current word. If found, \0 the
- * first one. Then pass a pointer to the first character of the
- * next word, or NULL if there is no next word.
- */
-char *
-nextword(p)
- register char *p;
-{
- /* skip blanks */
- while (*p && *p != '\t' && *p != ' ')
- p++;
- if (*p) {
- *p++ = '\0';
- while (*p == '\t' || *p == ' ')
- p++;
- }
- if (*p == '\0')
- p = NULL;
- return p;
-}
-
-#ifdef DEBUG
-static int
-Xdebug()
-{
- if (cmd.argc !=2)
- printf(debug? "on": "off");
- else
- debug = (cmd.argv[1][0] == '0' ||
- (cmd.argv[1][0] == 'o' && cmd.argv[1][1] == 'f'))?
- 0: 1;
- return 0;
-}
-#endif
-
-static void
-print_help(register const struct cmd_table *ct)
-{
- for (; ct->cmd_name != NULL; ct++)
- printf(" %s", ct->cmd_name);
- putchar('\n');
-}
-
-static int
-Xhelp()
-{
- printf("commands:");
- print_help(cmd_table);
-#ifdef MACHINE_CMD
- return Xmachine();
-#else
- return 0;
-#endif
-}
-
-#ifdef MACHINE_CMD
-static int
-Xmachine()
-{
- printf("machine:");
- print_help(MACHINE_CMD);
- return 0;
-}
-#endif
-
-static int
-Xecho()
-{
- register int i;
- for (i = 1; i < cmd.argc; i++)
- printf(cmd.argv[i]), putchar(' ');
- putchar('\n');
- return 0;
-}
-
-/* called only w/ no arguments */
-static int
-Xset()
-{
- register const struct cmd_table *ct;
-
- printf("OpenBSD boot[%s]\n", version);
- for (ct = cmd_set; ct->cmd_name != NULL; ct++) {
- printf("%s\t ", ct->cmd_name);
- (*ct->cmd_exec)();
- putchar('\n');
- }
- return 0;
-}
-
-static int
-Xstty()
-{
- int sp;
- char *cp;
- if (cmd.argc == 1)
- printf("com speed is %d\n", com_setsp(0));
- else {
- sp = 0;
- for (cp = cmd.argv[1]; *cp && isdigit(*cp); cp++)
- sp = sp*10 + (*cp - '0');
- com_setsp(sp);
- }
-
- return 0;
-}
-
-static int
-Xdevice()
-{
- if (cmd.argc != 2)
- printf(cmd.bootdev);
- else
- strncpy(cmd.bootdev, cmd.argv[1], sizeof(cmd.bootdev));
- return 0;
-}
-
-static int
-Ximage()
-{
- if (cmd.argc != 2)
- printf(cmd.image);
- else
- strncpy(cmd.image, cmd.argv[1], sizeof(cmd.image));
- return 0;
-}
-
-static int
-Xaddr()
-{
- register char *p;
-
- if (cmd.argc != 2)
- printf("%p", cmd.addr);
- else {
- register u_long a;
-
- p = cmd.argv[1];
- if (p[0] == '0' && p[1] == 'x')
- p += 2;
- for (a = 0; *p != '\0'; p++) {
- a <<= 4;
- a |= (isdigit(*p)? *p - '0':
- 10 + tolower(*p) - 'a') & 0xf;
- }
- cmd.addr = (void *)a;
- }
- return 0;
-}
-
-static int
-Xtty()
-{
- dev_t dev;
-
- if (cmd.argc == 1)
- printf(ttyname(0));
- else {
- dev = ttydev(cmd.argv[1]);
- if (dev == NODEV)
- printf("%s not a console device\n", cmd.argv[1]);
- else {
- printf("switching console to %s\n", cmd.argv[1]);
- if (cnset(dev))
- printf("%s console not present\n",
- cmd.argv[1]);
- }
- }
- return 0;
-}
-
-static int
-Xtime()
-{
- if (cmd.argc == 1)
- time_print();
- else {
- }
-
- return 0;
-}
-
-static int
-Xls()
-{
- struct stat sb;
- register char *p;
- int fd;
-
- if (stat(qualify((cmd.argv[1]? cmd.argv[1]: "/.")), &sb) < 0) {
- printf("stat(%s): %s\n", cmd.path, strerror(errno));
- return 0;
- }
-
- if ((sb.st_mode & S_IFMT) != S_IFDIR)
- ls(cmd.path, &sb);
- else {
- if ((fd = opendir(cmd.path)) < 0) {
- printf ("opendir(%s): %s\n", cmd.path,
- strerror(errno));
- return 0;
- }
-
- /* no strlen in lib !!! */
- for (p = cmd.path; *p; p++);
- *p++ = '/';
- *p = '\0';
-
- while(readdir(fd, p) >= 0) {
- if (stat(cmd.path, &sb) < 0)
- printf("stat(%s): %s\n", cmd.path,
- strerror(errno));
- else
- ls(p, &sb);
- }
- closedir (fd);
- }
- return 0;
-}
-
-#define lsrwx(mode,s) \
- putchar ((mode) & S_IROTH? 'r' : '-'); \
- putchar ((mode) & S_IWOTH? 'w' : '-'); \
- putchar ((mode) & S_IXOTH? *(s): (s)[1]);
-
-static void
-ls(name, sb)
- register char *name;
- register struct stat *sb;
-{
- putchar("-fc-d-b---l-s-w-"[(sb->st_mode & S_IFMT) >> 12]);
- lsrwx(sb->st_mode >> 6, (sb->st_mode & S_ISUID? "sS" : "x-"));
- lsrwx(sb->st_mode >> 3, (sb->st_mode & S_ISUID? "sS" : "x-"));
- lsrwx(sb->st_mode , (sb->st_mode & S_ISTXT? "tT" : "x-"));
-
- printf (" %u,%u\t%lu\t%s\n", sb->st_uid, sb->st_gid,
- (u_long)sb->st_size, name);
-}
-#undef lsrwx
-
-static int
-Xhowto()
-{
- if (cmd.argc < 2) {
- if (cmd.boothowto) {
- putchar('-');
- if (cmd.boothowto & RB_ASKNAME)
- putchar('a');
- if (cmd.boothowto & RB_HALT)
- putchar('b');
- if (cmd.boothowto & RB_CONFIG)
- putchar('c');
- if (cmd.boothowto & RB_SINGLE)
- putchar('s');
- if (cmd.boothowto & RB_KDB)
- putchar('d');
- }
- } else
- bootparse(1);
- return 0;
-}
-
-static int
-Xboot()
-{
- if (cmd.argc > 1 && cmd.argv[1][0] != '-') {
- qualify((cmd.argv[1]? cmd.argv[1]: cmd.image));
- if (bootparse(2))
- return 0;
- } else {
- if (bootparse(1))
- return 0;
- sprintf(cmd.path, "%s:%s", cmd.bootdev, cmd.image);
- }
-
- return 1;
-}
-
-/*
- * Qualifies the path adding neccessary dev
- */
-
-static char *
-qualify(name)
- char *name;
-{
- register char *p;
-
- for (p = name; *p; p++)
- if (*p == ':')
- break;
- if (*p == ':')
- strncpy(cmd.path, name, sizeof(cmd.path));
- else
- sprintf(cmd.path, "%s:%s", cmd.bootdev, name);
- return cmd.path;
-}
-
-static int
-bootparse(i)
- int i;
-{
- register char *cp;
- int howto = cmd.boothowto;
-
- for (; i < cmd.argc; i++) {
- cp = cmd.argv[i];
- if (*cp == '-') {
- while (*++cp) {
- switch (*cp) {
- case 'a':
- howto |= RB_ASKNAME;
- break;
- case 'b':
- howto |= RB_HALT;
- break;
- case 'c':
- howto |= RB_CONFIG;
- break;
- case 's':
- howto |= RB_SINGLE;
- break;
- case 'd':
- howto |= RB_KDB;
- break;
- default:
- printf("howto: bad option: %c\n", *cp);
- return 1;
- }
- }
- } else {
- printf("boot: illegal argument %s\n", cmd.argv[i]);
- return 1;
- }
- }
- cmd.boothowto = howto;
- return 0;
-}
-
-static int
-Xreboot()
-{
- printf("Rebooting...\n");
- exit();
- return 0; /* just in case */
-}
-
diff --git a/sys/arch/i386/stand/boot/cmd.h b/sys/arch/i386/stand/boot/cmd.h
deleted file mode 100644
index a3ecfcad048..00000000000
--- a/sys/arch/i386/stand/boot/cmd.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/* $OpenBSD: cmd.h,v 1.9 1997/09/02 20:48:18 mickey Exp $ */
-
-/*
- * Copyright (c) 1997 Michael Shalayeff
- * 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.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Michael Shalayeff.
- * 4. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 REGENTS 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.
- *
- */
-
-
-struct cmd_table {
- char *cmd_name;
- char cmd_type;
-#define CMDT_CMD 0
-#define CMDT_VAR 1
-#define CMDT_SET 2
-#define CMDT_MDC 3
- int (*cmd_exec) __P((void));
-};
-
-struct cmd_state {
- char bootdev[16]; /* device */
- char image[MAXPATHLEN - 16]; /* image */
- int boothowto; /* howto */
- char *conf; /* /etc/boot.conf normally */
- void *addr; /* load here */
- int timeout;
-
- char path[MAXPATHLEN]; /* buffer for pathname compose */
- const struct cmd_table *cmd;
- int argc;
- char *argv[8]; /* XXX i hope this is enough */
-};
-extern struct cmd_state cmd;
-
-int getcmd __P((void));
-int read_conf __P((void));
-
diff --git a/sys/arch/i386/stand/libsa/Makefile b/sys/arch/i386/stand/libsa/Makefile
index e84d626c0cd..a1d5a8c9dd1 100644
--- a/sys/arch/i386/stand/libsa/Makefile
+++ b/sys/arch/i386/stand/libsa/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.25 1997/09/02 20:58:15 mickey Exp $
+# $OpenBSD: Makefile,v 1.26 1997/09/21 10:02:08 mickey Exp $
LIB= sa
@@ -57,5 +57,5 @@ install:
.include <bsd.lib.mk>
CPPFLAGS+=-DLINKADDR=${LINKADDR} -DHEAP_LIMIT=${HEAP_LIMIT} ${DEBUGFLAGS}
-CPPFLAGS+=-I${.CURDIR}/../boot
+CPPFLAGS+=-I${S}/stand/boot
CFLAGS+=${SACFLAGS} -D__INTERNAL_LIBSA_CREAD