diff --git a/_posts/2017-02-09-pdp-11-front-panel-demo.md b/_posts/2017-02-09-pdp-11-front-panel-demo.md index fc3fc55c9..62997a548 100644 --- a/_posts/2017-02-09-pdp-11-front-panel-demo.md +++ b/_posts/2017-02-09-pdp-11-front-panel-demo.md @@ -13,25 +13,58 @@ machines: As I mentioned in the "[PDP-11 Tutorials](http://www.pcjs.org/blog/2017/01/03/)" blog post, I've been working on some methods for visually illustrating how machine components work. And the PDP-11/70 Operator's Console, -with its many blinking lights and switches, seemed like a good candidate. +with its daunting number of lights and switches, seemed like a good candidate. NOTE: I prefer the generic term "Front Panel" to describe DEC's Operator's Console, because it's less ambiguous and more generally recognized and understood. I still haven't written a *real* tutorial on the PDP-11/70 Front Panel, which will require starting at a much more -fundamental level, explaining and demonstrating each switch in turn. - -However, I have made more progress on the basic elements that any tutorial or demo requires: allowing the user to walk -through a step-by-step demonstration of some procedure. +fundamental level, explaining and demonstrating each switch in turn. However, I have made more progress on the basic +elements that any tutorial or demo will need: allowing the user to walk through a step-by-step demonstration of some +procedure. To illustrate, I've copied a multi-step procedure from the page on [Toggle-Ins](/devices/pdp11/machine/1170/panel/debugger/#toggle-ins) that shows how to use the PDP-11/70 Front Panel to verify that the Memory Management Unit (MMU) is operating properly. -The procedure involves entering a small 3-instruction program at address 200 that will write a value (070707) to -address 200, executing the program, and then verifying that the MMU relocated that value to address 300 instead. +The procedure requires you to enter a small 3-instruction program at address 200 that will write a value (070707) to +address 200, execute the program, and then verify that the MMU relocated that value to address 300 instead. + +As you click through each of the steps below, pay attention to the Front Panel. You should see all the switches being +toggled at each stage. And as you complete each step, the button for that step will be disabled, so that you don't +forget your place or accidentally repeat a step. And as you scroll through the steps, the machine should always remain +visible. + +Give it a try! {% include machine.html id="test1170" %} +### MMU Relocation Test + +From DEC's [PDP-11/70 Maintenance Service Guide](http://archive.pcjs.org/pubs/dec/pdp11/1170/PDP1170_Maintenance_Service_Guide_Apr88.pdf), +Chapter 4: + + Use the following toggle-in to verify the correct operation of Memory Management Relocation. + + 200/012737 MOV #400,@#177572 (load maint. bit in MMRO) + 202/000400 + 204/177572 + 206/012737 MOV #070707,@#200 (move 070707 to virtual 200) + 210/070707 + 212/000200 + 214/000000 HLT + + 300/000300 Preset loc 300 to 300 + + 17772300/077406 Set Kernel I PDR 0 to R/W 4K page + 17772340/000001 Set Kernel I PAR 0 to (Base address 100) + + Load Address 200 + Start Display = 000216 (Halt@214) + Load Address 300 + Exam Display = 070707 ... Relocation works + +The above "toggle-in" can broken down into the following steps. + Step 1: Load ADDRESS register with 200. {% include machine-command.html type='clickOnce' label='LOAD 200' machine='test1170' command='script' value='set Panel SR 200; sleep 500; hold Panel LOAD 250' %} @@ -76,7 +109,7 @@ Step 11: Load ADDRESS register with 17772300. {% include machine-command.html type='clickOnce' label='LOAD 17772300' machine='test1170' command='script' value='set Panel SR 17772300; sleep 500; hold Panel LOAD 250' %} -Step 12: Deposit 077406 at ADDRESS 17772300. +Step 12: Deposit 077406 at ADDRESS 17772300 ("Set Kernel I PDR 0 to R/W 4K page"). {% include machine-command.html type='clickOnce' label='DEPOSIT 077406' machine='test1170' command='script' value='set Panel SR 077406; sleep 500; hold Panel DEP 250' %} @@ -84,7 +117,7 @@ Step 13: Load ADDRESS register with 17772340. {% include machine-command.html type='clickOnce' label='LOAD 17772340' machine='test1170' command='script' value='set Panel SR 17772340; sleep 500; hold Panel LOAD 250' %} -Step 14: Deposit 000001 at ADDRESS 17772340. +Step 14: Deposit 000001 at ADDRESS 17772340 ("Set Kernel I PAR 0 to (Base address 100"). {% include machine-command.html type='clickOnce' label='DEPOSIT 000001' machine='test1170' command='script' value='set Panel SR 000001; sleep 500; hold Panel DEP 250' %} @@ -105,7 +138,7 @@ Step 18: Examine ADDRESS 300. {% include machine-command.html type='clickOnce' label='EXAM' machine='test1170' command='script' value='hold Panel EXAM 250' %} At this point, the DATA register should display `070707`. You can also use the PCjs Debugger's `rm` command to verify -the contents of DATA register (DR), or to dump memory location 300 directly (`dw 300 l1`). +the contents of DATA register, or use a Dump command (`dw 300 l1`) to dump memory location 300. *[@jeffpar](http://twitter.com/jeffpar)* *Feb 9, 2017* diff --git a/devices/pdp11/machine/1170/panel/debugger/README.md b/devices/pdp11/machine/1170/panel/debugger/README.md index 3bc1b98e9..1b4398755 100644 --- a/devices/pdp11/machine/1170/panel/debugger/README.md +++ b/devices/pdp11/machine/1170/panel/debugger/README.md @@ -106,7 +106,7 @@ Step 11: Load ADDRESS register with 17772300. {% include machine-command.html type='clickOnce' label='LOAD 17772300' machine='test1170' command='script' value='set Panel SR 17772300; sleep 500; hold Panel LOAD 250' %} -Step 12: Deposit 077406 at ADDRESS 17772300. +Step 12: Deposit 077406 at ADDRESS 17772300 ("Set Kernel I PDR 0 to R/W 4K page"). {% include machine-command.html type='clickOnce' label='DEPOSIT 077406' machine='test1170' command='script' value='set Panel SR 077406; sleep 500; hold Panel DEP 250' %} @@ -114,7 +114,7 @@ Step 13: Load ADDRESS register with 17772340. {% include machine-command.html type='clickOnce' label='LOAD 17772340' machine='test1170' command='script' value='set Panel SR 17772340; sleep 500; hold Panel LOAD 250' %} -Step 14: Deposit 000001 at ADDRESS 17772340. +Step 14: Deposit 000001 at ADDRESS 17772340 ("Set Kernel I PAR 0 to (Base address 100"). {% include machine-command.html type='clickOnce' label='DEPOSIT 000001' machine='test1170' command='script' value='set Panel SR 000001; sleep 500; hold Panel DEP 250' %} @@ -135,7 +135,7 @@ Step 18: Examine ADDRESS 300. {% include machine-command.html type='clickOnce' label='EXAM' machine='test1170' command='script' value='hold Panel EXAM 250' %} At this point, the DATA register should display `070707`. You can also use the PCjs Debugger's `rm` command to verify -the contents of DATA register (DR). +the contents of DATA register (DR), or use a Dump command (`dw 300 l1`)) to dump memory location 300. In fact, using the PDPjs Debugger, it's much easier to enter the above "toggle-in" with the following commands (the semicolons are optional; they just make it easier to paste an entire set of commands into the Debugger at once): diff --git a/modules/pdp11/lib/panel.js b/modules/pdp11/lib/panel.js index d545ea8f0..ed74081f8 100644 --- a/modules/pdp11/lib/panel.js +++ b/modules/pdp11/lib/panel.js @@ -239,10 +239,11 @@ class PanelPDP11 extends Component { * * @this {PanelPDP11} * @param {number} value (new DISPLAY register) + * @return {number} */ setDR(value) { - this.updateData(this.regDisplay = value); + return this.updateData(this.regDisplay = value); } /** @@ -916,7 +917,12 @@ class PanelPDP11 extends Component { { if (value && !this.cpu.isRunning()) { if (this.fDeposit) this.advanceAddr(); - var w = this.updateData(this.regSwitches); + /* + * This used to be updateData(), but that only updates regData, whereas setDR() updates both regData and regDisplay, + * and for these kinds of explicit Front Panel operations, I'm assuming the values should be synced. + */ + var w = this.setDR(this.regSwitches); + if (this.nAddrSel == PanelPDP11.ADDRSEL.CONS_PHY) { /* * TODO: Determine if this needs to take the UNIBUS map into consideration. @@ -954,7 +960,11 @@ class PanelPDP11 extends Component { */ w = this.cpu.getWordSafe(this.regAddr); } - this.updateData(w); + /* + * This used to be updateData(), but that only updates regData, whereas setDR() updates both regData and regDisplay, + * and for these kinds of explicit Front Panel operations, I'm assuming the values should be synced. + */ + this.setDR(w); } }