Update boot code to pass boot unit # through to R0

This commit is contained in:
Jeff Parsons 2017-02-03 10:17:49 -08:00 committed by Jeff Parsons
commit 039c6c8ef1
4 changed files with 148 additions and 150 deletions

View file

@ -567,13 +567,15 @@ class CPUStatePDP11 extends CPUPDP11 {
}
/**
* setReset(addr, fStart)
* setReset(addr, fStart, bUnit, addrStack)
*
* @this {CPUStatePDP11}
* @param {number} addr
* @param {boolean|undefined} fStart (true if a "startable" image was just loaded, false if not)
* @param {boolean} [fStart] (true if a "startable" image was just loaded, false if not)
* @param {number} [bUnit] (boot unit #)
* @param {number} [addrStack]
*/
setReset(addr, fStart)
setReset(addr, fStart, bUnit, addrStack)
{
this.addrReset = addr;
@ -583,13 +585,9 @@ class CPUStatePDP11 extends CPUPDP11 {
this.resetCPU();
if (fStart) {
/*
* 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;
}
this.regsGen[0] = bUnit || 0;
for (var i = 1; i <= 5; i++) this.regsGen[i] = 0;
this.regsGen[6] = addrStack || 0o2000;
if (!this.flags.powered) {
this.flags.autoStart = true;
}

View file

@ -820,7 +820,7 @@ class DriveController extends Component {
* 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);
this.cpu.setReset(0, true, iDrive);
var err = this.readData(drive, drive.iCylinderBoot, drive.iHeadBoot, drive.iSectorBoot, drive.cbSectorBoot, 0x0000, 2);
if (err) {
this.notice("Unable to read the boot sector (" + err + ")");