Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/vax/boot/boot A bunch of small fixes to make boot w...



details:   https://anonhg.NetBSD.org/src/rev/b3d6e9552714
branches:  trunk
changeset: 468012:b3d6e9552714
user:      ragge <ragge%NetBSD.org@localhost>
date:      Thu Apr 01 20:40:07 1999 +0000

description:
A bunch of small fixes to make boot work on most VAXen.

diffstat:

 sys/arch/vax/boot/boot/Makefile |   4 ++-
 sys/arch/vax/boot/boot/boot.c   |   6 +++-
 sys/arch/vax/boot/boot/hp.c     |   8 +++---
 sys/arch/vax/boot/boot/if_le.c  |   7 +++++-
 sys/arch/vax/boot/boot/if_ze.c  |   7 +++++-
 sys/arch/vax/boot/boot/netio.c  |   4 +--
 sys/arch/vax/boot/boot/ra.c     |  42 +++++++++++++++++++++++++++++++++++-----
 sys/arch/vax/boot/boot/tmscp.c  |   8 ++----
 8 files changed, 63 insertions(+), 23 deletions(-)

diffs (291 lines):

diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/Makefile
--- a/sys/arch/vax/boot/boot/Makefile   Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/Makefile   Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.2 1999/03/27 09:33:30 ragge Exp $
+#      $NetBSD: Makefile,v 1.3 1999/04/01 20:40:07 ragge Exp $
 
 S=     ${.CURDIR}/../../../../
 
@@ -10,6 +10,8 @@
 
 CLEANFILES+=${PROG} ${PROG}.mop
 CPPFLAGS+=-DSUPPORT_BOOTPARAMS -DSUPPORT_BOOTP -DSUPPORT_DHCP -D_STANDALONE
+#CPPFLAGS+=-DBOOTP_DEBUG -DNETIF_DEBUG -DETHER_DEBUG -DNFS_DEBUG -DDEV_DEBUG \
+#      -DRPC_DEBUG -DRARP_DEBUG -DPARANOID
 BINDIR=        /
 
 SA_AS= library
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/boot.c
--- a/sys/arch/vax/boot/boot/boot.c     Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/boot.c     Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
+/*     $NetBSD: boot.c,v 1.2 1999/04/01 20:40:07 ragge Exp $ */
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -51,7 +51,7 @@
  */
 
 char line[100];
-int    devtype, bootdev, howto;
+int    devtype, bootdev, howto, debug;
 extern unsigned opendev;
 extern  unsigned *bootregs;
 
@@ -104,6 +104,7 @@
        }
        printf("\n");
 
+       /* First try to autoboot */
        if (askname == 0) {
                type = (devtype >> B_TYPESHIFT) & B_TYPEMASK;
                if ((unsigned)type < ndevs && devsw[type].dv_name)
@@ -117,6 +118,7 @@
                        }
        }
 
+       /* If any key pressed, go to conversational boot */
        for (;;) {
                struct vals *v = &val[0];
                char *c, *d;
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/hp.c
--- a/sys/arch/vax/boot/boot/hp.c       Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/hp.c       Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hp.c,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
+/*     $NetBSD: hp.c,v 1.2 1999/04/01 20:40:07 ragge Exp $ */
 /*
  * Copyright (c) 1994 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -129,12 +129,12 @@
        hd = (void *)&mr->mba_md[hs->unit];
        lp = &hplabel;
 
-       pfnum = (u_int)buf >> PGSHIFT;
+       pfnum = (u_int)buf >> VAX_PGSHIFT;
 
-       for(mapnr = 0, nsize = size; (nsize + NBPG) > 0; nsize -= NBPG)
+       for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0; nsize -= VAX_NBPG)
                *(int *)&mr->mba_map[mapnr++] = PG_V | pfnum++;
 
-       mr->mba_var = ((u_int)buf & PGOFSET);
+       mr->mba_var = ((u_int)buf & VAX_PGOFSET);
        mr->mba_bc = (~size) + 1;
        bn = dblk + lp->d_partitions[hs->part].p_offset;
 
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/if_le.c
--- a/sys/arch/vax/boot/boot/if_le.c    Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/if_le.c    Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_le.c,v 1.2 1999/03/25 23:16:37 thorpej Exp $ */
+/*     $NetBSD: if_le.c,v 1.3 1999/04/01 20:40:07 ragge Exp $ */
 /*
  * Copyright (c) 1997 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -36,6 +36,11 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
+#include <sys/queue.h>
+#include <sys/socket.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/if_ze.c
--- a/sys/arch/vax/boot/boot/if_ze.c    Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/if_ze.c    Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ze.c,v 1.2 1999/03/25 23:16:37 thorpej Exp $        */
+/*     $NetBSD: if_ze.c,v 1.3 1999/04/01 20:40:07 ragge Exp $  */
 /*
  * Copyright (c) 1998 James R. Maynard III.  All rights reserved.
  *
@@ -32,6 +32,11 @@
 
 #include <sys/param.h>
 #include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/queue.h>
+
+#include <net/if.h>
+#include <net/if_ether.h>
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/netio.c
--- a/sys/arch/vax/boot/boot/netio.c    Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/netio.c    Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netio.c,v 1.1 1999/03/06 16:36:05 ragge Exp $  */
+/*     $NetBSD: netio.c,v 1.2 1999/04/01 20:40:07 ragge Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -226,7 +226,6 @@
         * and the more modern, BOOTP way. (RFC951, RFC1048)
         */
 
-#if 0
 #ifdef SUPPORT_BOOTP
 
        /* Get boot info using BOOTP way. (RFC951, RFC1048) */
@@ -245,7 +244,6 @@
        } else
 
 #endif /* SUPPORT_BOOTP */
-#endif /* SUPPORT_BOOTP */
        {
 #ifdef SUPPORT_BOOTPARAMS
                /* Get boot info using RARP and Sun bootparams. */
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/ra.c
--- a/sys/arch/vax/boot/boot/ra.c       Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/ra.c       Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ra.c,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
+/*     $NetBSD: ra.c,v 1.2 1999/04/01 20:40:07 ragge Exp $ */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -98,6 +98,10 @@
        unsigned short johan, johan2;
        int i,err;
 
+#ifdef DEV_DEBUG
+       printf("raopen: adapter %d ctlr %d unit %d part %d\n", 
+           adapt, ctlr, unit, part);
+#endif
        bzero(lp, sizeof(struct disklabel));
        ra->unit = unit;
        ra->part = part;
@@ -138,18 +142,29 @@
        /* Init of this uda */
        while ((*ra->ra_sa & MP_STEP1) == 0)
                ;
-
+#ifdef DEV_DEBUG
+       printf("MP_STEP1...");
+#endif
        *ra->ra_sw = 0x8000;
        while ((*ra->ra_sa & MP_STEP2) == 0)
                ;
+#ifdef DEV_DEBUG
+       printf("MP_STEP2...");
+#endif
 
        *ra->ra_sw = johan;
        while ((*ra->ra_sa & MP_STEP3) == 0)
                ;
+#ifdef DEV_DEBUG
+       printf("MP_STEP3...");
+#endif
 
        *ra->ra_sw = johan2;
        while ((*ra->ra_sa & MP_STEP4) == 0)
                ;
+#ifdef DEV_DEBUG
+       printf("MP_STEP4\n");
+#endif
 
        *ra->ra_sw = 0x0001;
        uda.uda_ca.ca_rspdsc = (int)&ubauda->uda_rsp.mscp_cmdref;
@@ -159,12 +174,18 @@
        uda.uda_cmd.mscp_unit = ra->unit;
        command(M_OP_ONLINE);
 
+#ifdef DEV_DEBUG
+       printf("reading disklabel\n");
+#endif
        err = rastrategy(ra,F_READ, LABELSECTOR, DEV_BSIZE, io_buf, &i);
        if(err){
                printf("reading disklabel: %s\n",strerror(err));
                return 0;
        }
 
+#ifdef DEV_DEBUG
+       printf("getting disklabel\n");
+#endif
        msg = getdisklabel(io_buf+LABELOFFSET, lp);
        if (msg)
                printf("getdisklabel: %s\n", msg);
@@ -182,10 +203,15 @@
        uda.uda_rsp.mscp_msglen = MSCP_MSGLEN;
        uda.uda_ca.ca_rspdsc |= MSCP_OWN|MSCP_INT;
        uda.uda_ca.ca_cmddsc |= MSCP_OWN|MSCP_INT;
+#ifdef DEV_DEBUG
+       printf("sending cmd %x...", cmd);
+#endif
        hej = *ra_softc.ra_ip;
        while(uda.uda_ca.ca_rspdsc<0)
                ;
-
+#ifdef DEV_DEBUG
+       printf("sent.\n");
+#endif
 }
 
 rastrategy(ra, func, dblk, size, buf, rsize)
@@ -202,15 +228,15 @@
        u_int   i, j, pfnum, mapnr, nsize;
        volatile int hej;
 
-
        if (vax_cputype != VAX_8200) {
                ur = (void *)ra->ubaddr;
                udadev = (void*)ra->udaddr;
                ptmapp = (u_int *)&ur->uba_map[0];
 
-               pfnum = (u_int)buf >> PGSHIFT;
+               pfnum = (u_int)buf >> VAX_PGSHIFT;
 
-               for(mapnr = 0, nsize = size; (nsize + NBPG) > 0; nsize -= NBPG)
+               for(mapnr = 0, nsize = size; (nsize + VAX_NBPG) > 0;
+                   nsize -= VAX_NBPG)
                        ptmapp[mapnr++] = PG_V | pfnum++;
                uda.uda_cmd.mscp_seq.seq_buffer = ((u_int)buf) & 0x1ff;
        } else
@@ -221,6 +247,10 @@
            dblk + lp->d_partitions[ra->part].p_offset;
        uda.uda_cmd.mscp_seq.seq_bytecount = size;
        uda.uda_cmd.mscp_unit = ra->unit;
+#ifdef DEV_DEBUG
+       printf("rastrategy: blk 0x%lx count %lx unit %lx\n", 
+           uda.uda_cmd.mscp_seq.seq_lbn, size, ra->unit);
+#endif
        if (func == F_WRITE)
                command(M_OP_WRITE);
        else
diff -r 2689466456d5 -r b3d6e9552714 sys/arch/vax/boot/boot/tmscp.c
--- a/sys/arch/vax/boot/boot/tmscp.c    Thu Apr 01 20:36:32 1999 +0000
+++ b/sys/arch/vax/boot/boot/tmscp.c    Thu Apr 01 20:40:07 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tmscp.c,v 1.1 1999/03/06 16:36:05 ragge Exp $ */
+/*     $NetBSD: tmscp.c,v 1.2 1999/04/01 20:40:08 ragge Exp $ */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -86,7 +86,6 @@
        unsigned short johan;
        int i,err;
 
-printf("OPen\n");
        curblock = 0;
        if(adapt>nuba) return(EADAPT);
        if(ctlr>nuda) return(ECTLR);
@@ -168,10 +167,9 @@
        volatile u_int *ptmapp = (u_int *)&ur->uba_map[0];
        volatile int hej;
 
-printf("strategy: size %d dblk %ld\n", size, dblk);
-       pfnum=(u_int)buf>>PGSHIFT;
+       pfnum=(u_int)buf>>VAX_PGSHIFT;
 
-       for(mapnr=0, nsize=size;(nsize+NBPG)>0;nsize-=NBPG)
+       for(mapnr=0, nsize=size;(nsize+VAX_NBPG)>0;nsize-=VAX_NBPG)
                ptmapp[mapnr++]=PG_V|pfnum++;
 
        /*



Home | Main Index | Thread Index | Old Index