[5678] in Athena Bugs
VS3100 7.1 cannot take crash dumps
daemon@ATHENA.MIT.EDU (epeisach@ATHENA.MIT.EDU)
Mon Aug 6 19:26:46 1990
From: epeisach@ATHENA.MIT.EDU
Date: Mon, 6 Aug 90 19:26:20 -0400
To: bugs@ATHENA.MIT.EDU
Cc: mar@ATHENA.MIT.EDU
Well, not in the future... The following changes will allow them to
work.
Most of the change to machdep.c was reformatting to make the file easier
to read (and compare to the ultrix3.1 source for the same file).
If we had partition tables then the rzdump routine would not need to be
modified and a common routine could do all the work (as Ultrix does)
and we wouldn't have these problems.
This code will not work if the dump device is on a different controller
from the boot device, but the other device drivers we have make the same
assumption.
This should be audited for 7.2
Ezra
Files modifed:
machine/machdep.c
vaxscsi/scsi_data.c
vaxscsi/scsi_disk.c
RCS file: machine/RCS/machdep.c,v
retrieving revision 1.1
diff -c -r1.1 machine/machdep.c
*** /tmp/,RCSt1020742 Mon Aug 6 19:18:00 1990
--- machine/machdep.c Mon Aug 6 19:09:06 1990
***************
*** 1071,1076 ****
--- 1071,1079 ----
dev_t dev; /* dump device */
struct dumpinfo dumpinfo; /* dump info */
{
+ #ifdef VAX420
+ extern struct uba_driver scsidriver;
+ #endif
#define DBSIZE 16
***************
*** 1114,1136 ****
break;
default: /* VAXSTAR hits here */
! for (uba_dev =(struct uba_device *)ubdinit;uba_dev->ui_driver;uba_dev++) {
! if (uba_dev->ui_alive) {
! if ((long)uba_dev->ui_physaddr ==rpbp->csrphy) {
! uba_drive = uba_dev->ui_driver;
! if (*uba_drive->ud_dname ==*gb->gc_name)
! if (uba_dev->ui_unit == unit_ultrix) {
! uba_head = uba_dev->ui_hd;
! longp = (long)uba_head->uh_physuba;
! if ((longp == rpbp->adpphy) ||
! (cpu_subtype == ST_VAXSTAR)) {
! unit_physical = (long)uba_dev->ui_slave;
! break;
! }
! }
}
! }
}
} /* switch */
if (unit_physical == -1) {
--- 1117,1145 ----
break;
default: /* VAXSTAR hits here */
! for (uba_dev =(struct uba_device *)ubdinit;
! uba_dev->ui_driver;
! uba_dev++) {
! if (uba_dev->ui_alive) {
! if ((long)uba_dev->ui_physaddr ==rpbp->csrphy) {
! uba_drive = uba_dev->ui_driver;
! if (strcmp(uba_drive->ud_dname, gb->gc_name) == 0)
! if (uba_dev->ui_unit == unit_ultrix) {
! uba_head = uba_dev->ui_hd;
! longp = (long)uba_head->uh_physuba;
! if ((longp == rpbp->adpphy) ||
! (cpu_subtype == ST_VAXSTAR)) {
! unit_physical = (long)uba_dev->ui_slave;
! #if VAX420
! if (uba_dev->ui_driver == &scsidriver)
! unit_physical *= 100;
! #endif
! break;
}
! }
! }
}
+ }
} /* switch */
if (unit_physical == -1) {
===================================================================
RCS file: vaxscsi/RCS/scsi_data.c,v
retrieving revision 1.1
diff -c -r1.1 vaxscsi/scsi_data.c
*** /tmp/,RCSt1020742 Mon Aug 6 19:18:07 1990
--- vaxscsi/scsi_data.c Mon Aug 6 19:14:50 1990
***************
*** 102,107 ****
--- 102,108 ----
#include "ipc.h"
#include "shm.h"
#include "syslog.h"
+ #include "dump.h"
#include "../machine/cpu.h"
#include "../machine/vaxstar.h"
===================================================================
RCS file: vaxscsi/RCS/scsi_disk.c,v
retrieving revision 1.1
diff -c -r1.1 vaxscsi/scsi_disk.c
*** /tmp/,RCSt1020742 Mon Aug 6 19:18:09 1990
--- vaxscsi/scsi_disk.c Mon Aug 6 19:15:24 1990
***************
*** 756,764 ****
return (0);
}
! rzdump()
{
! }
#endif
--- 756,821 ----
return (0);
}
+ #define phys(cast, addr) ((cast)((int)addr & 0x7fffffff))
! struct dumpinfo dumpinfo;
!
! rzdump(dev)
! dev_t dev;
{
! /* This would be easier if we had partition sizes.... */
! register struct uba_device *ui;
! register struct sz_softc *sc;
! register struct size *sc_dstp;
! extern int dumpsize, maxsz;
! int unit = minor(dev) >> 3;
! int cntlr, targid;
+ if (unit >= nNSZ)
+ return (ENXIO);
+
+ ui = phys(struct uba_device *, szdinfo[unit]);
+ if (ui->ui_alive == 0)
+ return (ENXIO);
+ cntlr = ui->ui_ctlr;
+ if (cntlr >= nNSCSI)
+ return(ENXIO);
+ targid = ui->ui_slave;
+ sc = phys(struct sz_softc *, &sz_softc[cntlr]);
+ sc_dstp= phys(struct size *, sc->sc_dstp[targid]);
+ if (sc->sc_alive[targid] == 0)
+ return(ENXIO);
+
+ /*
+ * Set size_to_dump to number of pages in core.
+ */
+
+ dumpinfo.size_to_dump = maxfree;
+
+ /*
+ * Set maxsz to the size of the dump device in blocks.
+ */
+
+ maxsz = sc_dstp[minor(dev) & 07].nblocks;
+ if (maxsz < 0)
+ maxsz = sc->sc_disksize[targid] -
+ sc_dstp[minor(dev) & 07].blkoffs;
+
+ /*
+ * Set blkoffs to the beginning of the dump device in blocks.
+ */
+
+ dumpinfo.blkoffs = sc_dstp[minor(dev) & 07].blkoffs;
+
+ if (dumplo < 0)
+ return (EINVAL);
+
+ /* we don't do partial dumps */
+ dumpinfo.partial_dump = 0;
+
+ if (dumpinfo.size_to_dump + dumplo >= maxsz) /* dump is too big */
+ dumpsize = dumpinfo.size_to_dump = maxsz - (dumplo + 1);
+
+ return (gendump(dev, dumpinfo));
+ }
#endif