RSTS/E boots now

This commit is contained in:
Jeff Parsons 2016-11-30 12:32:32 -08:00 • committed by Jeff Parsons
commit 3a8322838d
11 changed files with 453 additions and 424 deletions

View file

@ -281,7 +281,6 @@ RK11.prototype.initBus = function(cmp, bus, cpu, dbg)
/*
* Add only drives from the machine-wide autoMount configuration that match drives managed by this component.
*
*/
if (configMount) {
for (var sDrive in configMount) {
@ -592,10 +591,10 @@ RK11.prototype.finishLoadDrive = function onLoadDrive(drive, disk, sDiskName, sD
if (disk) {
/*
* We shouldn't mount the disk unless we're sure the drive is able to handle it.
* TODO: While this is a perfectly reasonable thing to do, one wonders if the Disk object shouldn't
* have done this itself, since we passed our Drive object to it (it already knows the drive's limits).
*/
aDiskInfo = disk.info();
if (disk && aDiskInfo[0] > drive.nCylinders || aDiskInfo[1] > drive.nHeads /* || aDiskInfo[2] > drive.nSectors */) {
if (disk.nCylinders > drive.nCylinders || disk.nHeads > drive.nHeads /* || disk.nSectors > drive.nSectors */) {
this.notice("Disk \"" + sDiskName + "\" too large for drive " + this.getDriveName(drive.iDrive));
disk = null;
}
@ -618,7 +617,6 @@ RK11.prototype.finishLoadDrive = function onLoadDrive(drive, disk, sDiskName, sD
* of a local disk image, it will map all such disks to "Local Disk", and any attempt to "Mount" such
* a disk, will essentially result in a "Disk not found" error.
*/
// this.addDiskHistory(sDiskName, sDiskPath, disk);
/*
@ -635,7 +633,6 @@ RK11.prototype.finishLoadDrive = function onLoadDrive(drive, disk, sDiskName, sD
*
* Successful unmounts are a different story, however; those *do* trigger a change. See unloadDrive().
*/
// this.regInput |= FDC.REG_INPUT.DISK_CHANGE;
/*
@ -860,9 +857,13 @@ RK11.prototype.initDrive = function(drive, iDrive, data)
var fSuccess = true;
drive.iDrive = iDrive;
drive.name = this.idComponent;
drive.fBusy = drive.fLocal = false;
drive.name = this.idComponent;
/*
* NOTE: We initialize the following drive properties to their MAXIMUMs; disks may have
* these or SMALLER values (subject to the limits of what the controller supports, of course).
*/
drive.nCylinders = 203;
drive.nHeads = 2;
drive.nSectors = 12;
@ -884,9 +885,7 @@ RK11.prototype.initDrive = function(drive, iDrive, data)
drive.ibSector = 0;
drive.sector = null;
if (!drive.disk) {
drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with
}
if (!drive.disk) drive.sDiskPath = ""; // ensure this is initialized to a default that displayDisk() can deal with
drive.status = PDP11.RK11.RKDS.RK05 | PDP11.RK11.RKDS.SOK | PDP11.RK11.RKDS.DRDY | PDP11.RK11.RKDS.RRDY;
@ -1012,7 +1011,7 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add
var sWords = "";
while (nWords--) {
if (!sector) {
sector = drive.disk.seek(iCylinder, iHead, iSector + 1);
sector = disk.seek(iCylinder, iHead, iSector + 1);
if (!sector) {
err = PDP11.RK11.RKER.SKE;
break;
@ -1020,7 +1019,7 @@ RK11.prototype.readData = function(drive, iCylinder, iHead, iSector, nWords, add
ibSector = 0;
}
var b0, b1, data;
if ((b0 = drive.disk.read(sector, ibSector++)) < 0 || (b1 = drive.disk.read(sector, ibSector++)) < 0) {
if ((b0 = disk.read(sector, ibSector++)) < 0 || (b1 = disk.read(sector, ibSector++)) < 0) {
err = PDP11.RK11.RKER.NXS;
break;
}
@ -1087,14 +1086,14 @@ RK11.prototype.writeData = function(drive, iCylinder, iHead, iSector, nWords, ad
}
addr += 2;
if (!sector) {
sector = drive.disk.seek(iCylinder, iHead, iSector + 1, true);
sector = disk.seek(iCylinder, iHead, iSector + 1, true);
if (!sector) {
err = PDP11.RK11.RKER.SKE;
break;
}
ibSector = 0;
}
if (!drive.disk.write(sector, ibSector++, data & 0xff) || !drive.disk.write(sector, ibSector++, data >> 8)) {
if (!disk.write(sector, ibSector++, data & 0xff) || !disk.write(sector, ibSector++, data >> 8)) {
err = PDP11.RK11.RKER.NXS;
break;
}