Fix booting from BI-based disks.

This commit is contained in:
ragge 2000-06-11 10:39:26 +00:00
parent 959d05dacc
commit fdc27c43a1
2 changed files with 19 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: devopen.c,v 1.4 2000/05/21 09:45:34 ragge Exp $ */
/* $NetBSD: devopen.c,v 1.5 2000/06/11 10:39:26 ragge Exp $ */
/*
* Copyright (c) 1997 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -69,6 +69,9 @@ devopen(f, fname, file)
unit = bootrpb.unit;
adapt = ctlr = -1;
if (dev == BDEV_KDB)
dev = BDEV_UDA; /* use the same driver */
for (i = 0, dp = 0; i < ndevs; i++)
if (cnvtab[i] == dev)
dp = devsw + i;
@ -145,12 +148,13 @@ devopen(f, fname, file)
case VAX_8800:
case VAX_TYP_8PS:
csrbase = 0; /* _may_ be a KDB */
nexaddr = bootrpb.csrphy;
if (ctlr < 0)
break;
if (adapt < 0)
nexaddr = (bootrpb.adpphy & 0xff000000) + BI_NODE(ctlr);
nexaddr = (nexaddr & 0xff000000) + BI_NODE(ctlr);
else
nexaddr = BI_BASE(ctlr, adapt);
nexaddr = BI_BASE(adapt, ctlr);
break;
#ifdef notyet
case VAX_6200:

View File

@ -1,4 +1,4 @@
/* $NetBSD: ra.c,v 1.6 2000/05/21 09:45:54 ragge Exp $ */
/* $NetBSD: ra.c,v 1.7 2000/06/11 10:39:26 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -85,6 +85,7 @@ raopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
#ifdef DEV_DEBUG
printf("raopen: adapter %d ctlr %d unit %d part %d\n",
adapt, ctlr, unit, part);
printf("raopen: csrbase %x nexaddr %x\n", csrbase, nexaddr);
#endif
bzero(&ralabel, sizeof(struct disklabel));
bzero((void *)&uda, sizeof(struct uda));
@ -118,10 +119,19 @@ raopen(struct open_file *f, int adapt, int ctlr, int unit, int part)
*ra_ip = 0; /* Start init */
bootrpb.csrphy = csrbase;
} else {
paddr_t kdaddr = (paddr_t)nexaddr;
paddr_t kdaddr;
volatile int *w;
volatile int i = 10000;
if (askname == 0) {
nexaddr = bootrpb.csrphy;
dunit = bootrpb.unit;
} else {
nexaddr = (bootrpb.csrphy & ~(NODESIZE - 1)) + KDB_IP;
bootrpb.csrphy = nexaddr;
}
kdaddr = nexaddr & ~(NODESIZE - 1);
ra_ip = (short *)(kdaddr + KDB_IP);
ra_sa = (short *)(kdaddr + KDB_SA);
ra_sw = (short *)(kdaddr + KDB_SW);