Sunday, March 9, 2025

First round of virtual mode testing of the Virtual 2315 Cartridge Facility mostly successful

STARTING UP THE VIRTUAL DISK DRIVE AND VERIFYING ITS STATUS TO THE 1130

I set the real/virtual mode switch on the interface board to Virtual, which completely simulates a disk drive, leaving the real 13SD drive inside the machine untouched. The cartridge image loaded and after the simulated 90 second startup delay, the File Ready light came on at both the 1130 main console and the Virtual 2315 Cartridge Facility (V2315CF) box. 

Issuing the XIO (eXecute Input Output) instruction with a Sense DSW command places status bits in the machine accumulator reflecting the condition of the disk drive as viewed from the disk controller logic in the 1130. Before the drive became ready, the status showed that the disk was not ready. 

Once File Ready illuminated the only bits that should be active are Home and the sector number. Home means the disk arm is at its initial (cylinder 0) position. The disk is divided rotationally into four sectors, each of which can hold up to 321 words of data with the two sector bits indicating the sector that will begin next. Sequential Sense DSW commands returned different sector numbers based on where the disk was simulated to have rotated at the moment of execution. 

INTERRUPTS TO PRESENT STATUS FROM THE DISK CONTROLLER

The controller logic will trigger an interrupt on level 2 when a disk operation completes - seek, read or write. The 1130 jumps to a defined interrupt level handler and the interrupt level remains active until the condition causing it is reset.

The Sense DSW command has low order bits that reset conditions - if the bits are on. I single stepped a XIO Sense DSW to reset the condition after each activity. The initial sense bits indicate operation complete (bit 1) but after the Sense DSW has reset it, subsequent Sense DSW do not see that bit. 

Leaving an interrupt involves a particular kind of branch instruction called BOSC which resets the current interrupt level as part of its execution. If I single step execute the BOSC without having cleared the operation complete using Sense DSW, we are immediately back in interrupt level 2 again. Once the condition was cleared, the BOSC ends the interrupt level and puts the processor back in ordinary mode. 

PERFORMING SEEK OPERATIONS AND VERIFYING STATUS

I single stepped an XIO Control instruction, which performs a seek of the number of cylinders in the first command word and the direction set by bit 13 of the second command word. When this executes, the Seek lamp on the V2315CF box flashes and we enter interrupt level 2. The status show from Sense DSW showed operation complete, but also that the Home bit (bit 4) was turned off since we moved away from cylinder 0. 

I did a seek of 2 cylinders forward, resetting the operation complete and exiting the interrupt level. The Home bit was now off.  I performed a second seek, this time for 127 cylinder forward, the result of which would be the arm stopped at cylinder 129. The 1130 and its 13SD disk drive do not perform absolute seeks to an address nor is there any way to know what cylinder you are at, other than cylinder 0. 

After clearing things again, I changed the direction and did a seek of 127 cylinders backwards. Clearing the condition and exiting the interrupt, the Home bit was still off (since we should be back at cylinder 2). A final backwards seek of 127 cylinders ended with the Home bit now set since we stopped at cylinder 0. 

PERFORMING A SECTOR READ AND EXAMINING THE DATA

I set up the system by beginning at cylinder zero and issuing a XIO Control to seek forward 10 cylinders. After clearing the condition, I single step executing an XIO Initiate Read which specified it wanted to read sector 02 (the third sector) of head 1 (the second side) into a buffer at location x1000 where I set up the first word with the length value 321 to read the entire sector. 

The RD lamp flashed, the 1130 entered interrupt level 2 and the Sense DSW returned an operation complete. I cleared the condition and interrupt level, then examined the buffer area. The first word after the count of 321 was x6500 which suggests a flaw in my design. The first word of sectors on a 2315 cartridge are generally storing the relative sector number of that sector. 

With four sectors per rotation and two heads, there are eight sectors on a cylinder. Going to cylinder 10 will allow reading of sectors 80 to 87 - 80 to 83 on head 0 and 84 to 87 on head 1. Since I requested head 1, sector 2 that means a relative sector number of 86 decimal. Converting that to hex the word should be x0056 but it was x6500. 

There is some weird permutation of the bits occurring here. If they were exactly reversed then the word would have been x6a00. So, either I was actually reading the data for cylinder 16 and the bits are purely backwards, or a more complex defect is in operation. 

I need better instrumentation to see where we are performing the read from. I modified the code base to give me that information. 

PERFORMING A WRITE SECTOR AFTER MODIFYING THE BUFFER DATA

I changed the first word to a different value and then single step executed an XIO Initiate Write pointing at the buffer and requesting to write sector 2 of head 1. After clearing the interrupt I erased the buffer word so that I could do another read of the sector. The value returned in the buffer after the read was indeed the changed value I wrote out. This gives me evidence that I am updating the SDRAM when I do the write. 

INSTRUMENTING FOR A MORE THOROUGH CHECK OF READING, WRITING AND SEEKING

I will spend the evening setting up the data I need to see where the V2315CF believes it is fetching and storing sector data. The outstanding news is that my logic to simulate the sector data - the prologue of zeros, the sync word, and all the error correction bits after each word - is performing well. The same is true of my logic extracting the data values from data being written out by the 1130 controller logic. No check bit errors were detected, which suggests a high quality signal path as well. 

Because so much appears to be working correctly, I expect to resolve the issues fairly quickly and consider virtual mode debugged. I would then switch to running in real mode, with the 13SD drive spinning a cartridge and moving the disk arm as commanded by the 1130, while the read and write data streams come from the V2315CF. 




No comments:

Post a Comment