A bunch of small fixes to make boot work on most VAXen.
This commit is contained in:
parent
978ab908d4
commit
60d4b9c2bd
|
@ -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 @@ SRCS= srt0.s boot.c devopen.c conf.c autoconf.c netio.c rom.c romread.s \
|
|||
|
||||
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
|
||||
|
|
|
@ -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 @@ Xmain()
|
|||
}
|
||||
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 @@ Xmain()
|
|||
}
|
||||
}
|
||||
|
||||
/* If any key pressed, go to conversational boot */
|
||||
for (;;) {
|
||||
struct vals *v = &val[0];
|
||||
char *c, *d;
|
||||
|
|
|
@ -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 @@ hpstrategy(hs, func, dblk, size, buf, rsize)
|
|||
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;
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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 @@ netmountroot(f, devname)
|
|||
* and the more modern, BOOTP way. (RFC951, RFC1048)
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#ifdef SUPPORT_BOOTP
|
||||
|
||||
/* Get boot info using BOOTP way. (RFC951, RFC1048) */
|
||||
|
@ -244,7 +243,6 @@ netmountroot(f, devname)
|
|||
printf("\n");
|
||||
} else
|
||||
|
||||
#endif /* SUPPORT_BOOTP */
|
||||
#endif /* SUPPORT_BOOTP */
|
||||
{
|
||||
#ifdef SUPPORT_BOOTPARAMS
|
||||
|
|
|
@ -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 @@ raopen(f, adapt, ctlr, unit, part)
|
|||
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 @@ raopen(f, adapt, ctlr, unit, part)
|
|||
/* 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 @@ raopen(f, adapt, ctlr, unit, part)
|
|||
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 @@ command(cmd)
|
|||
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 @@ rastrategy(ra, func, dblk, size, buf, rsize)
|
|||
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 @@ rastrategy(ra, func, dblk, size, buf, rsize)
|
|||
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
|
||||
|
|
|
@ -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 @@ tmscpopen(f, adapt, ctlr, unit, part)
|
|||
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 @@ tmscpstrategy(ra, func, dblk, size, buf, rsize)
|
|||
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++;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue