diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 1998-12-15 06:32:36 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 1998-12-15 06:32:36 +0000 |
commit | 2b15acd640c31ffe78e62a6f74608d3a5b7f6954 (patch) | |
tree | 7937f297944744e67d9c13c31ea238fc450d56e1 | |
parent | 6d51a3609c2a75795ae9487536608be366f37cca (diff) |
This fixed a number of things. A serious bug in bugcrt.c's initial stack
among other things.
-rw-r--r-- | sys/arch/mvme88k/stand/bootsd/Makefile | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootsd/README | 2 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootsd/boot.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootxx/Makefile | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/bootxx/bootxx.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/installboot/Makefile | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/installboot/installboot.8 | 16 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/installboot/installboot.c | 101 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/libbug/diskrd.c | 2 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/libbug/putchar.c | 13 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/libsa/SRT0.S | 116 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/libsa/exec_mvme.c | 14 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/Makefile | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/boot.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/stand/netboot/if_ie.c | 4 |
15 files changed, 221 insertions, 99 deletions
diff --git a/sys/arch/mvme88k/stand/bootsd/Makefile b/sys/arch/mvme88k/stand/bootsd/Makefile index ca7ae74a7c1..a44e8916872 100644 --- a/sys/arch/mvme88k/stand/bootsd/Makefile +++ b/sys/arch/mvme88k/stand/bootsd/Makefile @@ -1,7 +1,7 @@ # from: @(#)Makefile 8.1 (Berkeley) 6/10/93 -# $OpenBSD: Makefile,v 1.3 1998/08/22 09:25:06 smurph Exp $ +# $OpenBSD: Makefile,v 1.4 1998/12/15 06:32:33 smurph Exp $ -RELOC=0x3F0000 +RELOC=0xCF0000 S= ${.CURDIR}/../../../.. DEFS= @@ -18,7 +18,7 @@ CLEANFILES+=bootsd SRCS= boot.c conf.c version.c -LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} +LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} -lgcc -lc -lgcc OBJS= ${SRCS:N*.h:R:S/$/.o/g} @@ -29,7 +29,7 @@ all: ${ALL} bootsd: ${OBJS} ${BUGCRT} ${LIBS} ${LD} ${LDFLAGS} -o $@ \ - ${BUGCRT} ${OBJS} ${LIBS} + ${SDCRT} ${OBJS} ${LIBS} #${SRTOBJ} install: install -c -m 555 -g bin -o bin ${BOOTS} ${DESTDIR}${MDEC_DIR} diff --git a/sys/arch/mvme88k/stand/bootsd/README b/sys/arch/mvme88k/stand/bootsd/README index 86d2b194056..47a7aab2813 100644 --- a/sys/arch/mvme88k/stand/bootsd/README +++ b/sys/arch/mvme88k/stand/bootsd/README @@ -1,7 +1,7 @@ In short: cd /usr/mdec cp bootsd / - ./installboot -v /bootsd ./bootxx /dev/rsd0c + ./installboot -v /bootsd ./bootxx /dev/rsd0a (you will need to be single user to run installboot since it writes to a raw disk device) diff --git a/sys/arch/mvme88k/stand/bootsd/boot.c b/sys/arch/mvme88k/stand/bootsd/boot.c index a50d358b66a..869cf1eb97b 100644 --- a/sys/arch/mvme88k/stand/bootsd/boot.c +++ b/sys/arch/mvme88k/stand/bootsd/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.2 1998/08/22 07:17:18 smurph Exp $ */ +/* $OpenBSD: boot.c,v 1.3 1998/12/15 06:32:33 smurph Exp $ */ /* $NetBSD: boot.c,v 1.2 1995/09/23 03:42:52 gwr Exp $ */ /*- @@ -56,7 +56,7 @@ main() int io, flag, ret; int ask = 0; - printf(">> OpenBSD MVME%x bootsd [%s]\n", bugargs.cputyp, version); + printf("\n>> OpenBSD MVME%x bootsd [%s]\n", bugargs.cputyp, version); ret = parse_args(&file, &flag); diff --git a/sys/arch/mvme88k/stand/bootxx/Makefile b/sys/arch/mvme88k/stand/bootxx/Makefile index 9d4e72acdf3..d9e3b8891a1 100644 --- a/sys/arch/mvme88k/stand/bootxx/Makefile +++ b/sys/arch/mvme88k/stand/bootxx/Makefile @@ -1,7 +1,7 @@ # from: @(#)Makefile 8.1 (Berkeley) 6/10/93 -# $OpenBSD: Makefile,v 1.2 1998/08/22 09:25:08 smurph Exp $ +# $OpenBSD: Makefile,v 1.3 1998/12/15 06:32:34 smurph Exp $ -RELOC=0x3F0000 +RELOC=0xAF0000 S= ${.CURDIR}/../../../.. DEFS= @@ -17,7 +17,7 @@ CLEANFILES+=bootxx SRCS= bootxx.c conf.c version.c -LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} +LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} -lgcc -lc -lgcc OBJS= ${SRCS:N*.h:R:S/$/.o/g} diff --git a/sys/arch/mvme88k/stand/bootxx/bootxx.c b/sys/arch/mvme88k/stand/bootxx/bootxx.c index 5f488b616ec..d55a99bb711 100644 --- a/sys/arch/mvme88k/stand/bootxx/bootxx.c +++ b/sys/arch/mvme88k/stand/bootxx/bootxx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bootxx.c,v 1.1 1998/08/22 08:27:08 smurph Exp $ */ +/* $OpenBSD: bootxx.c,v 1.2 1998/12/15 06:32:34 smurph Exp $ */ /* * Copyright (c) 1994 Paul Kranenburg @@ -51,7 +51,7 @@ /* * Boot device is derived from ROM provided information. */ -#define LOADADDR 0x11000 /* where to load level 2 bootstrap */ +#define LOADADDR 0xCf0000 /* where to load level 2 bootstrap */ /* (l2 must relocate itself) */ /* This determines the largest boot program we can load. */ @@ -90,7 +90,7 @@ main() error = copyboot(&f, addr); f.f_dev->dv_close(&f); if (!error) { - bugexec((void (*)())addr); + bugexec((void (*)())addr + 8); } /* copyboot had a problem... */ _rtt(); diff --git a/sys/arch/mvme88k/stand/installboot/Makefile b/sys/arch/mvme88k/stand/installboot/Makefile index 3dbe8bb1715..d9ba6f51e6a 100644 --- a/sys/arch/mvme88k/stand/installboot/Makefile +++ b/sys/arch/mvme88k/stand/installboot/Makefile @@ -3,8 +3,11 @@ PROG= installboot MAN= installboot.8 BINDIR=/usr/mdec +DPADD= ${LIBUTIL} +LDADD= -lutil # Need this to work in the miniroot + LDSTATIC= -static .include <bsd.prog.mk> diff --git a/sys/arch/mvme88k/stand/installboot/installboot.8 b/sys/arch/mvme88k/stand/installboot/installboot.8 index a9dcd9c9e1a..b9811645e2a 100644 --- a/sys/arch/mvme88k/stand/installboot/installboot.8 +++ b/sys/arch/mvme88k/stand/installboot/installboot.8 @@ -1,4 +1,4 @@ -.\" $Id: installboot.8,v 1.1 1998/08/22 06:38:35 smurph Exp $ +.\" $Id: installboot.8,v 1.2 1998/12/15 06:32:34 smurph Exp $ .\" .Dd 31 May 1995 .Dt INSTALLBOOT 8 @@ -10,7 +10,7 @@ .Nm installboot .Op Fl n .Op Fl v -.Ar ufsboot +.Ar bootsd .Ar bootxx .Ar rawdev .Sh DESCRIPTION @@ -28,12 +28,12 @@ Do not actually write anything on the disk. Be verbose, printing out the block numbers that .Ar bootxx will use to load -.Ar ufsboot . +.Ar bootsd . .El .Pp The arguments are: -.Bl -tag -width ufsboot -.It Ar ufsboot +.Bl -tag -width bootsd +.It Ar bootsd the name of the second-stage boot program in the file system where the first-stage boot program is to be installed. .It Ar bootxx @@ -45,6 +45,12 @@ on which the file system containing .Ar ufsboot is mounted. .El +.Sh EXAMPLE +.Bd -literal -offset +cd /usr/mdec +cp bootsd / +installboot -v /bootsd ./bootxx /dev/rsd0a +.Ed .Sh BUGS .Nm installboot requires simultaneous access to the mounted file system and diff --git a/sys/arch/mvme88k/stand/installboot/installboot.c b/sys/arch/mvme88k/stand/installboot/installboot.c index 88244cb41ba..74d37b66616 100644 --- a/sys/arch/mvme88k/stand/installboot/installboot.c +++ b/sys/arch/mvme88k/stand/installboot/installboot.c @@ -45,9 +45,13 @@ #include <stdio.h> #include <string.h> #include <unistd.h> +#include <util.h> +#include <machine/disklabel.h> int verbose, nowrite, hflag; char *boot, *proto, *dev; +char cdev[80]; + struct nlist nl[] = { #define X_BLOCK_SIZE 0 {"_block_size"}, @@ -69,6 +73,7 @@ int loadblocknums __P((char *, int)); static void devread __P((int, void *, daddr_t, size_t, char *)); static void usage __P((void)); int main __P((int, char *[])); +static void vid_to_disklabel __P((char *, char*)); static void @@ -115,13 +120,19 @@ main(argc, argv) boot = argv[optind]; proto = argv[optind + 1]; dev = argv[optind + 2]; - + strcpy(cdev, dev); + cdev[strlen(cdev)-1] = 'c'; + if (verbose) { printf("boot: %s\n", boot); printf("proto: %s\n", proto); printf("device: %s\n", dev); + printf("cdevice: %s\n", cdev); } - + + /* Insert VID into disklabel */ + vid_to_disklabel(cdev, proto); + /* Load proto blocks into core */ if ((protostore = loadprotoblocks(proto, &protosize)) == NULL) exit(1); @@ -147,7 +158,7 @@ main(argc, argv) if (protosize > SBSIZE - DEV_BSIZE) errx(1, "proto bootblocks too big"); - if ((devfd = open(dev, O_RDWR, 0)) < 0) + if ((devfd = open(cdev, O_RDWR, 0)) < 0) err(1, "open: %s", dev); if (lseek(devfd, DEV_BSIZE, SEEK_SET) != DEV_BSIZE) @@ -375,3 +386,87 @@ int devfd; return 0; } +static void +vid_to_disklabel(dkname, bootproto) +char *dkname; +char *bootproto; +{ + char *specname; + int exe_file, f; + struct cpu_disklabel *pcpul; + struct stat stat; + unsigned int exe_addr; + unsigned short exe_addr_u; + unsigned short exe_addr_l; + + pcpul = (struct cpu_disklabel *)malloc(sizeof(struct cpu_disklabel)); + bzero(pcpul, sizeof(struct cpu_disklabel)); + + if (verbose) + printf("modifying vid.\n"); + + exe_file = open(bootproto, O_RDONLY, 0444); + if (exe_file == -1) { + perror(bootproto); + exit(2); + } + + f = opendev(dkname, O_RDWR, OPENDEV_PART, &specname); + + if (lseek(f, 0, SEEK_SET) < 0 || + read(f, pcpul, sizeof(struct cpu_disklabel)) + < sizeof(struct cpu_disklabel)) + err(4, "%s", specname); + + + pcpul->version = 1; + strcpy(pcpul->vid_id, "M88K"); + + fstat(exe_file, &stat); + + /* size in 256 byte blocks round up after a.out header removed */ + + pcpul->vid_oss = 2; + pcpul->vid_osl = (((stat.st_size -0x20) +511) / 512) *2; + + lseek(exe_file, 0x14, SEEK_SET); + read(exe_file, &exe_addr, 4); + + /* check this, it may not work in both endian. */ + /* No, it doesn't. Use a big endian machine for now. SPM */ + + { + union { + struct s { + unsigned short s1; + unsigned short s2; + } s; + unsigned long l; + } a; + a.l = exe_addr; + pcpul->vid_osa_u = a.s.s1; + pcpul->vid_osa_l = a.s.s2; + + } + pcpul->vid_cas = 1; + pcpul->vid_cal = 1; + + /* do not want to write past end of structure, not null terminated */ + + strncpy(pcpul->vid_mot, "MOTOROLA", 8); + + pcpul->cfg_rec = 0x100; + pcpul->cfg_psm = 0x200; + + if (!nowrite) { + if (lseek(f, 0, SEEK_SET) < 0 || + write(f, pcpul, sizeof(struct cpu_disklabel)) + < sizeof(struct cpu_disklabel)) + err(4, "%s", specname); + } + free(pcpul); + + close(exe_file); + close(f); + +} diff --git a/sys/arch/mvme88k/stand/libbug/diskrd.c b/sys/arch/mvme88k/stand/libbug/diskrd.c index bc69b365501..d38717c3ce6 100644 --- a/sys/arch/mvme88k/stand/libbug/diskrd.c +++ b/sys/arch/mvme88k/stand/libbug/diskrd.c @@ -15,5 +15,5 @@ mvmeprom_diskrd(arg) asm volatile ("or r2,r0,%0": : "r" (arg)); MVMEPROM_CALL(MVMEPROM_DSKRD); asm volatile ("or %0,r0,r2" : "=r" (ret)); - return (!(ret & 0x4)); + return ((ret & 0x8)); } diff --git a/sys/arch/mvme88k/stand/libbug/putchar.c b/sys/arch/mvme88k/stand/libbug/putchar.c index 564bcb75c15..2193b45c78c 100644 --- a/sys/arch/mvme88k/stand/libbug/putchar.c +++ b/sys/arch/mvme88k/stand/libbug/putchar.c @@ -1,4 +1,4 @@ -/* $OpenBSD: putchar.c,v 1.1 1998/08/22 07:39:56 smurph Exp $ */ +/* $OpenBSD: putchar.c,v 1.2 1998/12/15 06:32:34 smurph Exp $ */ /* * putchar: easier to do this with outstr than to add more macros to @@ -17,9 +17,10 @@ putchar(c) int c; { - char ca[2]; - if (c == '\n') - putchar('\r'); - ca[0] = c; - mvmeprom_outstr(&ca[0], &ca[1]); + char ca; + ca = (char)c & 0xFF; + if (ca == '\n') + putchar('\r'); + asm volatile ("or r2,r0,%0" : : "r" (ca)); + MVMEPROM_CALL(MVMEPROM_OUTCHR); } diff --git a/sys/arch/mvme88k/stand/libsa/SRT0.S b/sys/arch/mvme88k/stand/libsa/SRT0.S index 7156aa32830..ff7cf90e3c4 100644 --- a/sys/arch/mvme88k/stand/libsa/SRT0.S +++ b/sys/arch/mvme88k/stand/libsa/SRT0.S @@ -1,62 +1,62 @@ -| $Id: SRT0.S,v 1.1 1997/03/03 19:30:35 rahnds Exp $ +; $Id: SRT0.S,v 1.2 1998/12/15 06:32:34 smurph Exp $ -| Copyright (c) 1996 Nivas Madhur -| Copyright (c) 1995 Theo de Raadt -| -| 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 under OpenBSD by -| Theo de Raadt for Willowglen Singapore. -| 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 AUTHOR 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. -| -| Copyright (c) 1995 Gordon W. Ross -| 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. The name of the author may not be used to endorse or promote products -| derived from this software without specific prior written permission. -| 4. All advertising materials mentioning features or use of this software -| must display the following acknowledgement: -| This product includes software developed by Gordon Ross -| -| 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 AUTHOR 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. +; Copyright (c) 1996 Nivas Madhur +; Copyright (c) 1995 Theo de Raadt +; +; 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 under OpenBSD by +; Theo de Raadt for Willowglen Singapore. +; 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 AUTHOR 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. +; +; Copyright (c) 1995 Gordon W. Ross +; 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. The name of the author may not be used to endorse or promote products +; derived from this software without specific prior written permission. +; 4. All advertising materials mentioning features or use of this software +; must display the following acknowledgement: +; This product includes software developed by Gordon Ross +; +; 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 AUTHOR 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. ; SRT0.S - Stand-alone Run-Time startup code, part 0 .file "SRT0.S" diff --git a/sys/arch/mvme88k/stand/libsa/exec_mvme.c b/sys/arch/mvme88k/stand/libsa/exec_mvme.c index 19a0ca41405..5d4bfd3149e 100644 --- a/sys/arch/mvme88k/stand/libsa/exec_mvme.c +++ b/sys/arch/mvme88k/stand/libsa/exec_mvme.c @@ -68,6 +68,7 @@ exec_mvme(file, flag) void (*entry)(); register char *cp; register int *ip; + int n; #ifdef DEBUG printf("exec_mvme: file=%s flag=0x%x\n", file, flag); @@ -82,6 +83,7 @@ exec_mvme(file, flag) */ if (read(io, (char *)&x, sizeof(x)) != sizeof(x)) goto shread; + if (N_BADMAG(x)) { errno = EFTYPE; goto closeout; @@ -99,7 +101,14 @@ exec_mvme(file, flag) * so we must mask that off (has no effect on the other formats */ loadaddr = (void *)(x.a_entry & ~sizeof(x)); - + n = x.a_text + x.a_data + x.a_bss + x.a_syms + sizeof(int); + + /* debugging stuff for netboot + printf("hex load address range 0x%x to 0x%x\n", loadaddr, loadaddr+n); + printf("dec load address range %ld to %ld\n", loadaddr, loadaddr+n); + bzero((void *)loadaddr, n); + */ + cp = loadaddr; magic = N_GETMAGIC(x); if (magic == ZMAGIC) @@ -189,6 +198,9 @@ exec_mvme(file, flag) close(io); printf("Start @ 0x%x ...\n", (int)entry); + printf("Controler Address @ %x ...\n", bugargs.ctrl_addr); + if (flag & RB_HALT) mvmeprom_return(); + /* (addr)(flag, 0, kernel.esym, kernel.smini, kernel.emini);*/ (*entry)(flag, bugargs.ctrl_addr, cp, kernel.smini, kernel.emini); printf("exec: kernel returned!\n"); diff --git a/sys/arch/mvme88k/stand/netboot/Makefile b/sys/arch/mvme88k/stand/netboot/Makefile index b38a3fb63d2..ee920ad3152 100644 --- a/sys/arch/mvme88k/stand/netboot/Makefile +++ b/sys/arch/mvme88k/stand/netboot/Makefile @@ -1,10 +1,13 @@ -# $OpenBSD: Makefile,v 1.4 1998/08/22 09:25:10 smurph Exp $ -RELOC=0x3F0000 +# $OpenBSD: Makefile,v 1.5 1998/12/15 06:32:35 smurph Exp $ + +RELOC=0xAF0000 SIZE?= size +STRIP?= strip S= ${.CURDIR}/../../../.. -DEFS= -DSUN_BOOTPARAMS #-DNETIF_DEBUG +DEFS= -DSUN_BOOTPARAMS +#-DNETIF_DEBUG INCPATH=-I${.CURDIR} -I${.CURDIR}/../libsa -I${.CURDIR}/../libbug \ -I${S} -I${S}/lib/libsa CFLAGS= -O2 ${DEFS} ${INCPATH} ${COPTS} @@ -18,19 +21,21 @@ CLEANFILES+=netboot netboot.bin SRCS= boot.c conf.c version.c devopen.c dev_net.c SRCS+= if_ie.c if_le.c OBJS= ${SRCS:S/.c/.o/g} -LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} -LDFLAGS+= -nostdlib -s -N -T ${RELOC} +LIBS= ${LIBSA} ${LIBBUG} ${LIBZ} -lgcc -lc -lgcc +LDFLAGS+= -s -N -T ${RELOC} +#LDFLAGS+= -nostdlib -s -N -Ttext ${RELOC} all: netboot.bin netboot: ${OBJS} ${BUGCRT} ${LIBS} - ${LD} ${LDFLAGS} -o $@ \ - ${BUGCRT} ${OBJS} ${LIBS} - @${SIZE} $@ + ${LD} ${LDFLAGS} \ + ${BUGCRT} ${OBJS} ${LIBS} -o $@ +# @${SIZE} $@ netboot.bin: netboot ${STRIP} netboot dd ibs=32 skip=1 if=netboot of=$@ +# dd ibs=38 skip=1 if=netboot of=$@ chown ${LIBOWN}.${LIBGRP} netboot.bin chmod ${LIBMODE} netboot.bin diff --git a/sys/arch/mvme88k/stand/netboot/boot.c b/sys/arch/mvme88k/stand/netboot/boot.c index bb07754d4ab..6e132bf34d7 100644 --- a/sys/arch/mvme88k/stand/netboot/boot.c +++ b/sys/arch/mvme88k/stand/netboot/boot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: boot.c,v 1.2 1998/08/22 08:37:53 smurph Exp $ */ +/* $OpenBSD: boot.c,v 1.3 1998/12/15 06:32:35 smurph Exp $ */ /*- * Copyright (c) 1995 Theo de Raadt @@ -90,7 +90,7 @@ main() bugargs.arg_end = bugargs.nbarg_end; *bugargs.arg_end = 0; /* ensure */ - printf("\n>> OpenBSD MVME187 netboot [%s]\n", version); + printf("\n>> OpenBSD MVME%x netboot [%s]\n", bugargs.cputyp, version); ret = parse_args(&file, &howto); diff --git a/sys/arch/mvme88k/stand/netboot/if_ie.c b/sys/arch/mvme88k/stand/netboot/if_ie.c index c856f8a5f81..d9003693331 100644 --- a/sys/arch/mvme88k/stand/netboot/if_ie.c +++ b/sys/arch/mvme88k/stand/netboot/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.2 1998/08/22 08:38:00 smurph Exp $ */ +/* $OpenBSD: if_ie.c,v 1.3 1998/12/15 06:32:35 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -441,7 +441,7 @@ ie_init(desc, machdep_hint) bzero(&ie_softc, sizeof(ie_softc)); ie_softc.sc_reg = (struct iereg *) ie_config[desc->io_netif->nif_unit].phys_addr; - ie_softc.sc_mem = (struct iemem *) 0x1e0000; + ie_softc.sc_mem = (struct iemem *) 0xae0000; ie_reset(desc->io_netif, desc->myea); printf("device: %s%d attached to %s\n", nif->nif_driver->netif_bname, nif->nif_unit, ether_sprintf(desc->myea)); |