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

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

1.1       nbrk        1: /*     $OpenBSD: boot.c,v 1.7 2006/05/16 22:51:30 miod 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: extern char *version;
                     66: char   line[80];
                     67:
                     68: int
                     69: main()
                     70: {
                     71:        char *cp, *file;
                     72:        int ask = 0, howto, ret;
                     73:
                     74:        /* cycle in the correct args */
                     75:        bugargs.arg_start = bugargs.nbarg_start;
                     76:        bugargs.arg_end   = bugargs.nbarg_end;
                     77:        *bugargs.arg_end = 0; /* ensure */
                     78:
                     79:        printf("\n>> OpenBSD/mvme88k netboot [%s]\n", version);
                     80:
                     81:        ret = parse_args(&file, &howto);
                     82:
                     83:        for (;;) {
                     84:                if (ask) {
                     85:                        printf("boot: ");
                     86:                        gets(line);
                     87:                        if (line[0]) {
                     88:                                bugargs.arg_start = line;
                     89:                                cp = line;
                     90:                                while (cp < (line + sizeof(line) - 1) && *cp)
                     91:                                        cp++;
                     92:                                bugargs.arg_end = cp;
                     93:                                ret =parse_args(&file, &howto);
                     94:                        }
                     95:                }
                     96:                if (ret) {
                     97:                        printf("boot: -q returning to MVME-Bug\n");
                     98:                        break;
                     99:                }
                    100:                exec_mvme(file, howto);
                    101:                printf("boot: %s: %s\n", file, strerror(errno));
                    102:                ask = 1;
                    103:        }
                    104:        _rtt();
                    105:        return (0);
                    106: }

CVSweb