[BACK]Return to boot.c CVS log [TXT][DIR] Up to [local] / sys / arch / mvme68k / stand / netboot

Annotation of sys/arch/mvme68k/stand/netboot/boot.c, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: boot.c,v 1.10 2003/08/20 00:26:00 deraadt Exp $ */
                      2:
                      3: /*-
                      4:  * Copyright (c) 1995 Theo de Raadt
                      5:  * All rights reserved.
                      6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  *
                     16:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
                     17:  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
                     18:  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     19:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
                     20:  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     21:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     22:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     23:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     24:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     25:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     26:  * SUCH DAMAGE.
                     27:  *
                     28:  * Copyright (c) 1982, 1986, 1990, 1993
                     29:  *     The Regents of the University of California.  All rights reserved.
                     30:  *
                     31:  * Redistribution and use in source and binary forms, with or without
                     32:  * modification, are permitted provided that the following conditions
                     33:  * are met:
                     34:  * 1. Redistributions of source code must retain the above copyright
                     35:  *    notice, this list of conditions and the following disclaimer.
                     36:  * 2. Redistributions in binary form must reproduce the above copyright
                     37:  *    notice, this list of conditions and the following disclaimer in the
                     38:  *    documentation and/or other materials provided with the distribution.
                     39:  * 3. Neither the name of the University nor the names of its contributors
                     40:  *    may be used to endorse or promote products derived from this software
                     41:  *    without specific prior written permission.
                     42:  *
                     43:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
                     44:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
                     45:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
                     46:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
                     47:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
                     48:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
                     49:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
                     50:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
                     51:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
                     52:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
                     53:  * SUCH DAMAGE.
                     54:  *
                     55:  *     @(#)boot.c      8.1 (Berkeley) 6/10/93
                     56:  */
                     57:
                     58: #include <sys/param.h>
                     59: #include <sys/reboot.h>
                     60: #include <machine/prom.h>
                     61:
                     62: #include "stand.h"
                     63: #include "libsa.h"
                     64:
                     65: /*
                     66:  * Boot device is derived from ROM provided information.
                     67:  */
                     68: #define LOADADDR       0x10000
                     69:
                     70: extern   char *version;
                     71: char  line[80];
                     72:
                     73: main(int argc, char *argv[])
                     74: {
                     75:        char *cp, *file;
                     76:        int ask = 0, howto, ret;
                     77:
                     78:        printf(">> OpenBSD MVME%x netboot [%s]\n", bugargs.cputyp, version);
                     79:        /* cycle in the correct args */
                     80:        bugargs.arg_start = bugargs.nbarg_start;
                     81:        bugargs.arg_end   = bugargs.nbarg_end;
                     82:        *bugargs.arg_end = 0; /* ensure */
                     83:
                     84:        ret = parse_args(&file, &howto);
                     85:
                     86:        for (;;) {
                     87:                if (ask) {
                     88:                        printf("boot: ");
                     89:                        gets(line);
                     90:                        if (line[0]) {
                     91:                                bugargs.arg_start = line;
                     92:                                cp = line;
                     93:                                while (cp < (line + sizeof(line) - 1) && *cp)
                     94:                                        cp++;
                     95:                                bugargs.arg_end = cp;
                     96:                                ret =parse_args(&file, &howto);
                     97:                        }
                     98:                }
                     99:                if (ret) {
                    100:                        printf("boot: -q returning to MVME-Bug\n");
                    101:                        break;
                    102:                }
                    103:                exec_mvme(file, howto);
                    104:                printf("boot: %s: %s\n", file, strerror(errno));
                    105:                ask = 1;
                    106:        }
                    107: }

CVSweb