KEY TO CONTINUED TESTING IN REAL MODE IS TO WIRE UP UNLOCK SIGNAL
In real mode, the cartridge can't be loaded until the disk Unlock lamp is lit (on the 1130 console as well as the UNLK lamp on the Virtual 2315 Cartridge Facility (V2315CF). This is done by a sense circuit on the 2310 Interface Board that provides a logic high to the main unit of the V2315CF when the Unlock wire from the internal disk drive is pulled to ground by the drive electronics. This would normally be directly wired to the Unlock lamp on the 1130 console that is attached to +48V on its other side.
When the disk drive turns off Unlock, it releases the line which would then jump up to 48V. The circuit on the 2310 Interface Board senses that voltage and grounds the output line to logic low which causes the V2315CF UNLK lamp to turn off and the unit to believe the disk drive is now spinning (locked).
In the original IBM design, the unlock wire from the drive is connected to the lamp on the console. This works well for the real (normal) mode of the V2315CF, but when we are running in virtual mode the disk drive is not used at all. It therefore does not turn off the Unlock lamp.
The 2310 Interface Board has a relay that connects the drive unlock wire to the Unlock lamp for real mode, but reroutes the lamp to a MOSFET on the board for virtual mode. The logic in the V2315CF can therefore turn the console Unlock lamp on and off based on simulating the disk drive.
I am still waiting for the version of the 2310 Interface Board PCB that houses the relay and MOSFET, so I was not yet controlling the 1130 console Unlock lamp in the scheme above. I did cut the wires between the drive and the lamp, so that the circuit will be controlled by the relay and MOSFET.
What I hadn't done was to wire the unlock wire from the disk drive to the sense circuit on the 2310 Interface Board, giving the V2315CF notification of when the lamp is logically lit or extinguished. This becomes important for controlling the loading a cartridge and making the drive ready for access.
TESTING AGAIN
After ensuring the wiring was corrected for the Unlock lamp, that the power supply sense wire to the V2315CF was jumpered to ground, and that we had a new undamaged PICO installed, I restarted my testing of real mode disk operations. I loaded a virtual cartridge and flipped on the motor switch to the internal disk drive on the IBM 1130. Prior to the drive readying itself, the V2315CF showed the PWR and RO lamps after I toggled the Read Only switch.
The drive came up to speed and the File Ready lamp illuminated. The V2315CF was ready to emulate a disk drive in its hybrid mode where the physical disk rotates and its arm seeks in and out in concert with our emulated drive. All data flows from and to the 2315 cartridge image file on microSD card.
CHECKING SENSE BITS BEFORE DRIVE GOES READY
The drive should show bit 2 (not ready) and bit 4 (home cylinder) plus the bottom two bits reflect the next sector to arrive under the heads. That number will be changing every 10 milliseconds as the platter rotates in the drive.
You can see the first XIO Sense DSW returned sector 3 and the second time I did it, the sector coming up was 1. The drive continued to be not ready since the 90 second timer in the disk drive hadn't elapsed. That timer allows the disk platter to stabilize its temperature and for any dust in the drive to be blown out before the drive attempts to load the heads down on the surface of the disk platter.
SENSE BIT TESTING WHEN DRIVE IS READY
Once the File Ready lamp turned on, another Sense DSW shows the drive with only the Home bit turned on, plus the bottom two bits indicating the sector approaching the heads at the instant of XIO execution. The RDY lamp on the V2315CF was illuminated as well as the green File Ready lamp on the IBM 1130 console.
During the course of my testing, we saw changes to the sense bits and validated their correctness. When a disk command was issued by the IBM 1130 - seek, read or write - at the end of the operation the disk controller turns on the Operation Complete bit (bit 1) and raises a request for an interrupt on level 2.
 |
Interrupt level 2 was entered |
In order to reset the Operation Complete bit, we have to have the reset bit of the Sense DSW set to 1. Thus, our first Sense DSW after we enter the interrupt handler will see bit 1 turned on but it will be off for any subsequent sense. With bit 1 turned off, when we exit the interrupt handler we are back in normal processing mode.
 |
Operation Complete (bit 1) and not Home |
Interrupt levels are exited by a specific kind of branch command, one with bit 9 turned on in the first instruction word. This is called a BOSC (Branch Out) variant of the BSC (Branch or Skip on Condition) instruction. Once that was executed, a sense DSW shows the normal bit bits for next sector and shows Home only if we are at cylinder zero.
The Home bit (bit 4) will turn on only while the arm at at cylinder 0, otherwise the controller doesn't know exactly where the arm is. The Disk Not Ready bit 2 will come on when the File Ready lamp is off, otherwise it should not appear. The Disk Busy bit 3 turns on while a disk command is being executed and turns off at the completion. Thus, if we did a maximum length seek which takes over 1.5 seconds, bit 3 should be on to a Sense DSW executed in the interval.
SEEK TESTING
I repeated the tests I performed in virtual mode. First a forward seek of 3 cylinders, which should leave the drive at cylinder 3 with the Home bit turned off. A set of three reverse seeks of 1 cylinder each should result in the Home bit only flipping on with the last seek. While the seeks are done, I should hear the 'grunt' of the physical drive moving the real disk arm and seek the Seek lamp on the V2315CF light briefly.
DRIVE NOT PERFORMING SEEKS WHEN THE V2315CF PASSES ALONG A REQUEST
However, no SEEK lamp and no sound from the drive. When I did a read sector with the arm moved to a cylinder away from home, the contents of the sector matched the intended location. The issue was that my disk drive was not performing the seek, only the emulator.
In the 13SD disk drive, if the cable to the CPU is disconnected, the drive goes into a CE (Customer Engineer) mode, where seeks are done by switches on the rear of the drive. The cable is shorting pin D07 to ground to indicate that we are NOT in CE mode. My interface board did not do this.
CORRECTED DEFECT WITH A JUMPER ON 2310 INTERFACE BOARD
I soldered in a jumper wire between pin D07 going to the 13SD drive and ground, after which the drive recognized that it should respond to CPU requests for activity. When I did some seek testing after this correction, I could hear the drive grunt and the locations it reached were in sync with the commands issued.
FINISHING SEEK TESTING
The next test was a move of the maximum 202 cylinders, which should cause the drive to do 101 steps of 20 mils, each lasting 15 milliseconds, placing the arm at the far extreme cylinder. The Seek lamp should be on for the duration of the entire move. a bit less than 2 seconds, and the debug console of the V2315CF should confirm the final position correctly. That worked properly.
I then moved in reverse 201 cylinders. This causes the disk to do 100 steps of 20mils and a final step of 10 mils. The Home bit was off and the debug console showed we were back to cylinder 1. Another single cylinder reverse seek did turn on Home and got the real arm all the way to 0.
 |
Home bit back on at end of Seek |
A few random seeks get done to see that the positioning, duration and reported final cylinder are consistent with what I requested. That wrapped up the seek verification.
SECTOR READ TESTING
After getting the arm back to cylinder 0, I performed an XIO type Initiate Read. The buffer has its first word set to the word count 321. The read command specifies head 0 and sector 0. I verified that the contents put into the buffer matched what was on the virtual cartridge image and what I got during the virtual mode testing. Again, the status is bit 1 (operation complete) plus Home (bit 4) since that was our location.
I repeated this for head 1, sector 0 of the Home cylinder, comparing the data as before. When this checked out properly, it was time to read a known sector. I performed a seek of 10 cylinders then did a sector read of head 1 sector 2. The contents are known to me and I compared what was in the buffer to validate correct reading.
SECTOR WRITE TESTING
Leaving the arm at cylinder 10, I prepared to verify whether I could write changed data back to the emulated drive. I changed a word in the buffer, as I had during virtual mode testing, then issued an XIO Initiate Write for head 1, sector 2. That should have updated the SDRAM in the V2315CF box with the changed word, all other words of the cartridge image unchanged.
To see if this was true, I cleared out part of the buffer and issued an XIO Initiate Read of head 1 sector 2. The data that was returned was indeed the known sector along with my modified word. Real mode is now working as well as virtual mode.
TESTING BEHAVIOR OF V2315CF AT END OF DISK SESSION
I flipped the Load/Unload switch on the V2315CF to Unload, but it did not respond since the real drive was still active with File Ready.
However, as soon as I flipped off the drive motor switch on the 13SD drive, the virtual cartridge unloaded and the unit waited while the physical 2315 cartridge in the drive spun down to rest.
When the platter was no longer rotating, the disk drive unlocked the handle to allow an operator to remove the physical 2315 cartridge. This also lit the UNLCK lamp on the V2315CF and returned it to its idle state waiting for a virtual cartridge to be loaded and the real drive turned back on.
WILL RUN DISK DRIVE DIAGNOSTICS AGAINST THE V2315CF NEXT
IBM has a disk drive diagnostic that exercises the 13SD (internal) disk drive. I will load that code into core memory and started the program running against the V2315CF in real and then virtual mode. If it passes muster then my emulation is certain to be good enough for use running the IBM 1130 with disk images.
PREPARING A NUMBER OF VIRTUAL 2315 CARTRIDGES FOR USE WITH THIS MACHINE
Using the IBM 1130 simulator on my laptop, I created a few disk images that would be useful to run with the real 1130. Most of them will require a line printer and a card reader to be operational before anything useful can be done, but we will be prepared for the time they are ready.