Fixed conditions required for RSTS/E boot code to work
This commit is contained in:
parent
b54253acf9
commit
2b8ea8ddee
4 changed files with 37 additions and 17 deletions
|
|
@ -496,7 +496,14 @@ CPUStatePDP11.prototype.setReset = function(addr, fStart)
|
||||||
this.setPSW(0);
|
this.setPSW(0);
|
||||||
|
|
||||||
if (fStart) {
|
if (fStart) {
|
||||||
this.autoStart();
|
/*
|
||||||
|
* TODO: Review. I'm zeroing R2-R5 in the fStart case (ie, for boot code) simply because that's what I
|
||||||
|
* saw the PDP-11 Boot Monitor doing (see /apps/pdp11/boot/monitor/BOOTMON.mac).
|
||||||
|
*/
|
||||||
|
for (var i = 2; i <= 5; i++) {
|
||||||
|
this.regsGen[i] = 0;
|
||||||
|
}
|
||||||
|
if (!this.isRunning()) this.startCPU();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (this.dbg) {
|
if (this.dbg) {
|
||||||
|
|
@ -515,6 +522,7 @@ CPUStatePDP11.prototype.setReset = function(addr, fStart)
|
||||||
this.stopCPU();
|
this.stopCPU();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!this.isRunning() && this.panel) this.panel.stop();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1437,7 +1437,7 @@ if (DEBUGGER) {
|
||||||
* is calling us in a loop, in which case it will perform its own updateDisplays() when it's done.
|
* is calling us in a loop, in which case it will perform its own updateDisplays() when it's done.
|
||||||
*/
|
*/
|
||||||
if (fUpdateDisplays !== false) {
|
if (fUpdateDisplays !== false) {
|
||||||
if (this.panel && this.panel.stop) this.panel.stop();
|
if (this.panel) this.panel.stop();
|
||||||
this.cmp.updateDisplays(-1);
|
this.cmp.updateDisplays(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -3924,7 +3924,7 @@ if (DEBUGGER) {
|
||||||
* displayLiveRegs enabled, so once the repeat count has been exhausted, we must perform
|
* displayLiveRegs enabled, so once the repeat count has been exhausted, we must perform
|
||||||
* a final updateDisplays().
|
* a final updateDisplays().
|
||||||
*/
|
*/
|
||||||
if (dbg.panel && dbg.panel.stop) dbg.panel.stop();
|
if (dbg.panel) dbg.panel.stop();
|
||||||
dbg.cmp.updateDisplays(-1);
|
dbg.cmp.updateDisplays(-1);
|
||||||
dbg.setBusy(false);
|
dbg.setBusy(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ RK11.prototype.setBinding = function(sType, sBinding, control, sValue)
|
||||||
|
|
||||||
control.onchange = function onChangeListDisks(event) {
|
control.onchange = function onChangeListDisks(event) {
|
||||||
var controlDesc = rk11.bindings["descDisk"];
|
var controlDesc = rk11.bindings["descDisk"];
|
||||||
var controlOption = control.options[control.selectedIndex];
|
var controlOption = control.options && control.options[control.selectedIndex];
|
||||||
if (controlDesc && controlOption) {
|
if (controlDesc && controlOption) {
|
||||||
var dataValue = {};
|
var dataValue = {};
|
||||||
var sValue = controlOption.getAttribute("data-value");
|
var sValue = controlOption.getAttribute("data-value");
|
||||||
|
|
@ -172,7 +172,7 @@ RK11.prototype.setBinding = function(sType, sBinding, control, sValue)
|
||||||
|
|
||||||
control.onclick = function onClickLoadDrive(event) {
|
control.onclick = function onClickLoadDrive(event) {
|
||||||
var controlDisks = rk11.bindings["listDisks"];
|
var controlDisks = rk11.bindings["listDisks"];
|
||||||
if (controlDisks) {
|
if (controlDisks && controlDisks.options) {
|
||||||
var sDiskName = controlDisks.options[controlDisks.selectedIndex].text;
|
var sDiskName = controlDisks.options[controlDisks.selectedIndex].text;
|
||||||
var sDiskPath = controlDisks.value;
|
var sDiskPath = controlDisks.value;
|
||||||
rk11.loadSelectedDrive(sDiskName, sDiskPath);
|
rk11.loadSelectedDrive(sDiskName, sDiskPath);
|
||||||
|
|
@ -561,15 +561,21 @@ RK11.prototype.bootSelectedDisk = function()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!drive.disk) {
|
if (!drive.disk) {
|
||||||
this.notice("No disk loaded in the selected drive");
|
this.notice("Load a disk into the drive first");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var err = this.readData(drive, 0, 0, 0, drive.cbSector >> 1, 0);
|
/*
|
||||||
|
* NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects
|
||||||
|
* of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU
|
||||||
|
* or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E)
|
||||||
|
* expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler,
|
||||||
|
* a READY state is assured, and the readData() call shouldn't do anything to change that.
|
||||||
|
*/
|
||||||
|
this.cpu.setReset(0, true);
|
||||||
|
var err = this.readData(drive, 0, 0, 0, 512, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
this.notice("Unable to read the boot sector (" + err + ")");
|
this.notice("Unable to read the boot sector (" + err + ")");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.cpu.setReset(0, true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ RL11.prototype.setBinding = function(sType, sBinding, control, sValue)
|
||||||
|
|
||||||
control.onchange = function onChangeListDisks(event) {
|
control.onchange = function onChangeListDisks(event) {
|
||||||
var controlDesc = rl11.bindings["descDisk"];
|
var controlDesc = rl11.bindings["descDisk"];
|
||||||
var controlOption = control.options[control.selectedIndex];
|
var controlOption = control.options && control.options[control.selectedIndex];
|
||||||
if (controlDesc && controlOption) {
|
if (controlDesc && controlOption) {
|
||||||
var dataValue = {};
|
var dataValue = {};
|
||||||
var sValue = controlOption.getAttribute("data-value");
|
var sValue = controlOption.getAttribute("data-value");
|
||||||
|
|
@ -174,7 +174,7 @@ RL11.prototype.setBinding = function(sType, sBinding, control, sValue)
|
||||||
|
|
||||||
control.onclick = function onClickLoadDrive(event) {
|
control.onclick = function onClickLoadDrive(event) {
|
||||||
var controlDisks = rl11.bindings["listDisks"];
|
var controlDisks = rl11.bindings["listDisks"];
|
||||||
if (controlDisks) {
|
if (controlDisks && controlDisks.options) {
|
||||||
var sDiskName = controlDisks.options[controlDisks.selectedIndex].text;
|
var sDiskName = controlDisks.options[controlDisks.selectedIndex].text;
|
||||||
var sDiskPath = controlDisks.value;
|
var sDiskPath = controlDisks.value;
|
||||||
rl11.loadSelectedDrive(sDiskName, sDiskPath);
|
rl11.loadSelectedDrive(sDiskName, sDiskPath);
|
||||||
|
|
@ -563,15 +563,21 @@ RL11.prototype.bootSelectedDisk = function()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!drive.disk) {
|
if (!drive.disk) {
|
||||||
this.notice("No disk loaded in the selected drive");
|
this.notice("Load a disk into the drive first");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var err = this.readData(drive, 0, 0, 0, drive.cbSector >> 1, 0);
|
/*
|
||||||
|
* NOTE: We're calling setReset() BEFORE reading the boot code in order to eliminate any side-effects
|
||||||
|
* of the previous state of either the controller OR the CPU; for example, we don't want any previous MMU
|
||||||
|
* or UNIBUS Map registers affecting the simulated readData() call. Also, some boot code (eg, RSTS/E)
|
||||||
|
* expects the controller to be in a READY state; since setReset() triggers a call to our reset() handler,
|
||||||
|
* a READY state is assured, and the readData() call shouldn't do anything to change that.
|
||||||
|
*/
|
||||||
|
this.cpu.setReset(0, true);
|
||||||
|
var err = this.readData(drive, 0, 0, 0, 512, 0);
|
||||||
if (err) {
|
if (err) {
|
||||||
this.notice("Unable to read the boot sector (" + err + ")");
|
this.notice("Unable to read the boot sector (" + err + ")");
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
this.cpu.setReset(0, true);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -862,7 +868,7 @@ RL11.prototype.initController = function(data)
|
||||||
{
|
{
|
||||||
var i = 0;
|
var i = 0;
|
||||||
if (!data) data = [];
|
if (!data) data = [];
|
||||||
this.regRLCS = data[i++] || 0;
|
this.regRLCS = data[i++] || (PDP11.RL11.RLCS.DRDY | PDP11.RL11.RLCS.CRDY);
|
||||||
this.regRLBA = data[i++] || 0;
|
this.regRLBA = data[i++] || 0;
|
||||||
this.regRLDA = data[i++] || 0;
|
this.regRLDA = data[i++] || 0;
|
||||||
this.tmpRLDA = data[i++] || 0;
|
this.tmpRLDA = data[i++] || 0;
|
||||||
|
|
@ -958,7 +964,7 @@ RL11.prototype.processCommand = function()
|
||||||
*
|
*
|
||||||
* 1) Normally both set
|
* 1) Normally both set
|
||||||
* 2) CRDY is cleared to process a command
|
* 2) CRDY is cleared to process a command
|
||||||
* 3) DRDY is cleared to command is in process
|
* 3) DRDY is cleared to indicate a command in process
|
||||||
*/
|
*/
|
||||||
this.regRLCS &= ~PDP11.RL11.RLCS.DRDY;
|
this.regRLCS &= ~PDP11.RL11.RLCS.DRDY;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue