Annotation of sys/arch/mvmeppc/stand/tftpboot/boot.c, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: boot.c,v 1.3 2003/06/02 23:27:53 millert Exp $ */
2: /*-
3: * Copyright (c) 1995 Theo de Raadt
4: * Copyright (c) 2001 Steve Murphree, Jr.
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: /*
67: * Boot device is derived from ROM provided information.
68: */
69: #define LOADADDR 0x10000
70:
71: extern char *version;
72: char line[80];
73:
74: main()
75: {
76: char *cp, *file;
77: int ask = 0, howto, ret;
78:
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: bootdev_type = BUGDEV_NET;
85:
86: printf("\n>> OpenBSD/mvmeppc netboot [%s]\n", version);
87:
88: ret = parse_args(&file, &howto);
89:
90: for (;;) {
91: if (ask) {
92: printf("boot: ");
93: gets(line);
94: if (line[0]) {
95: bugargs.arg_start = line;
96: cp = line;
97: while (cp < (line + sizeof(line) - 1) && *cp)
98: cp++;
99: bugargs.arg_end = cp;
100: ret =parse_args(&file, &howto);
101: }
102: }
103: if (ret) {
104: printf("boot: -q returning to MVME-Bug\n");
105: break;
106: }
107: exec_mvme(file, howto);
108: printf("boot: %s: %s\n", file, strerror(errno));
109: ask = 1;
110: }
111: }
CVSweb