diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/Makefile | 21 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/boot.c | 45 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/dev_net.c | 8 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/if_ie.c | 11 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/if_le.c | 11 |
5 files changed, 47 insertions, 49 deletions
diff --git a/sys/arch/mvme68k/stand/netboot/Makefile b/sys/arch/mvme68k/stand/netboot/Makefile index dc611c3879f..66ab572ce96 100644 --- a/sys/arch/mvme68k/stand/netboot/Makefile +++ b/sys/arch/mvme68k/stand/netboot/Makefile @@ -1,26 +1,27 @@ -# $OpenBSD: Makefile,v 1.4 1996/05/10 20:02:18 deraadt Exp $ +# $OpenBSD: Makefile,v 1.5 1996/05/16 02:55:35 chuck Exp $ RELOC=0x3F0000 S= ${.CURDIR}/../../../.. -DEFS= -DSTANDALONE -DSUN_BOOTPARAMS -INCPATH=-I${.CURDIR} -I${.CURDIR}/../libsa -I${S} -I${S}/lib/libsa +DEFS= -DSUN_BOOTPARAMS +INCPATH=-I${.CURDIR} -I${.CURDIR}/../libsa -I${.CURDIR}/../libbug \ + -I${S} -I${S}/lib/libsa CFLAGS= -O2 ${INCPATH} ${DEFS} ${COPTS} - CLEANFILES+=netboot netboot.bin +.include "${S}/arch/${MACHINE}/stand/bugcrt/Makefile.inc" +.include "${S}/arch/${MACHINE}/stand/libbug/Makefile.inc" .include "${S}/arch/${MACHINE}/stand/libsa/Makefile.inc" -.PATH: ${S}/arch/${MACHINE}/stand/libsa -SRTOBJ= SRT0.o SRT1.o -SRCS= boot.c conf.c version.c dev_net.c +SRCS= boot.c conf.c version.c devopen.c dev_net.c SRCS+= if_ie.c if_le.c -OBJS= ${SRTOBJ} ${SRCS:S/.c/.o/g} +OBJS= ${SRCS:S/.c/.o/g} all: netboot.bin -netboot: ${OBJS} ${LIBSA} - ${LD} -s -N -T ${RELOC} -e start -o $@ ${OBJS} ${LIBSA} +netboot: ${OBJS} ${LIBSA} ${BUGCRT} ${LIBBUG} + ${LD} -s -N -T ${RELOC} -o $@ \ + ${SRTOBJ} ${BUGCRT} ${OBJS} ${LIBSA} ${LIBBUG} @size $@ netboot.bin: netboot diff --git a/sys/arch/mvme68k/stand/netboot/boot.c b/sys/arch/mvme68k/stand/netboot/boot.c index ba095695b77..784134f2858 100644 --- a/sys/arch/mvme68k/stand/netboot/boot.c +++ b/sys/arch/mvme68k/stand/netboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.4 1996/04/28 10:49:17 deraadt Exp $ */ +/* $OpenBSD: boot.c,v 1.5 1996/05/16 02:55:36 chuck Exp $ */ /*- * Copyright (c) 1995 Theo de Raadt @@ -66,54 +66,47 @@ #include <sys/param.h> #include <sys/reboot.h> +#include <machine/prom.h> #include "stand.h" -#include "promboot.h" +#include "libsa.h" /* * Boot device is derived from ROM provided information. */ #define LOADADDR 0x10000 -extern char *version; -char defname[32] = "bsd"; +extern char *version; char line[80]; -#if 0 -u_int bootdev = MAKEBOOTDEV(0, sdmajor, 0, 0, 0); /* disk boot */ -#endif -u_int bootdev = MAKEBOOTDEV(1, 0, 0, 0, 0); /* network boot */ - main() { char *cp, *file; - int io; - extern int cputyp; - extern char *oparg, *opargend; - int ask = 0; - - printf(">> OpenBSD netboot [%s]\n", version); - printf("model MVME%x\n", cputyp); + int ask = 0, howto; - *opargend = '\0'; - prom_get_boot_info(); - file = defname; + printf(">> OpenBSD MVME%x netboot [%s]\n", bugargs.cputyp, version); + /* cycle in the correct args */ + bugargs.arg_start = bugargs.nbarg_start; + bugargs.arg_end = bugargs.nbarg_end; + *bugargs.arg_end = 0; /* ensure */ - cp = prom_bootfile; - if (cp && *cp) - file = cp; + parse_args(&file, &howto); for (;;) { if (ask) { printf("boot: "); gets(line); if (line[0]) { - oparg = line; - prom_get_boot_info(); + bugargs.arg_start = line; + cp = line; + while (cp < (line + sizeof(line) - 1) && *cp) + cp++; + bugargs.arg_end = cp; + parse_args(&file, &howto); } } - exec_sun(file, (char *)LOADADDR, prom_boothow); - printf("boot: %s\n", strerror(errno)); + exec_mvme(file, howto); + printf("boot: %s: %s\n", file, strerror(errno)); ask = 1; } } diff --git a/sys/arch/mvme68k/stand/netboot/dev_net.c b/sys/arch/mvme68k/stand/netboot/dev_net.c index 3242f28646f..241b3ac47df 100644 --- a/sys/arch/mvme68k/stand/netboot/dev_net.c +++ b/sys/arch/mvme68k/stand/netboot/dev_net.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev_net.c,v 1.5 1996/04/28 10:49:19 deraadt Exp $ */ +/* $OpenBSD: dev_net.c,v 1.6 1996/05/16 02:55:36 chuck Exp $ */ /* * Copyright (c) 1995 Gordon W. Ross @@ -55,7 +55,10 @@ #include <netinet/if_ether.h> #include <netinet/in_systm.h> +#include <machine/prom.h> + #include "stand.h" +#include "libsa.h" #include "net.h" #include "netif.h" #include "config.h" @@ -183,9 +186,8 @@ machdep_common_ether(ether) u_char *ether; { u_char *ea; - extern int cputyp; - if (cputyp == CPU_147) { + if (bugargs.cputyp == CPU_147) { ea = (u_char *) ETHER_ADDR_147; if ((*(int *) ea & 0x2fffff00) == 0x2fffff00) diff --git a/sys/arch/mvme68k/stand/netboot/if_ie.c b/sys/arch/mvme68k/stand/netboot/if_ie.c index 273463be844..c688d625fce 100644 --- a/sys/arch/mvme68k/stand/netboot/if_ie.c +++ b/sys/arch/mvme68k/stand/netboot/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.4 1996/04/28 10:49:22 deraadt Exp $ */ +/* $OpenBSD: if_ie.c,v 1.5 1996/05/16 02:55:36 chuck Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -44,7 +44,10 @@ #define NRXBUF 16 #define IE_RBUF_SIZE ETHER_MAX_LEN +#include <machine/prom.h> + #include "stand.h" +#include "libsa.h" #include "netif.h" #include "config.h" @@ -107,9 +110,8 @@ ie_match(nif, machdep_hint) { char *name; int i, val = 0; - extern int cputyp; - if (cputyp == CPU_147) + if (bugargs.cputyp == CPU_147) return (0); name = machdep_hint; if (name && !bcmp(ie_driver.netif_bname, name, 2)) @@ -132,13 +134,12 @@ ie_probe(nif, machdep_hint) struct netif *nif; void *machdep_hint; { - extern int cputyp; /* the set unit is the current unit */ if (ie_debug) printf("ie%d: ie_probe called\n", nif->nif_unit); - if (cputyp != CPU_147) + if (bugargs.cputyp != CPU_147) return (0); return (1); } diff --git a/sys/arch/mvme68k/stand/netboot/if_le.c b/sys/arch/mvme68k/stand/netboot/if_le.c index bebb67774b2..d3ded1d6070 100644 --- a/sys/arch/mvme68k/stand/netboot/if_le.c +++ b/sys/arch/mvme68k/stand/netboot/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.5 1996/04/28 10:49:24 deraadt Exp $ */ +/* $OpenBSD: if_le.c,v 1.6 1996/05/16 02:55:37 chuck Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -66,7 +66,10 @@ #include <netinet/in.h> #include <netinet/in_systm.h> +#include <machine/prom.h> + #include "stand.h" +#include "libsa.h" #include "netif.h" #include "config.h" @@ -129,9 +132,8 @@ le_match(nif, machdep_hint) { char *name; int i, val = 0; - extern int cputyp; - if (cputyp != CPU_147) + if (bugargs.cputyp != CPU_147) return (0); name = machdep_hint; if (name && !bcmp(le_driver.netif_bname, name, 2)) @@ -154,13 +156,12 @@ le_probe(nif, machdep_hint) struct netif *nif; void *machdep_hint; { - extern int cputyp; /* the set unit is the current unit */ if (le_debug) printf("le%d: le_probe called\n", nif->nif_unit); - if (cputyp == CPU_147) + if (bugargs.cputyp == CPU_147) return 0; return 1; } |