Monday, July 18, 2022

Tested all but the FPGA link on the Arduino for the Virtual 2315 Cartridge system

FPGA NOT YET READY NOR IS THE ARDUINO MODIFIED TO ENABLE SECOND SPI

I am just at the earliest stages of working on the VHDL for the FPGA side of this project, which will store the virtual cartridge into its onboard DDR memory and feed it back to the Arduino over the SPI link. Once I have that portion of the FPGA code working I can fully test out the Arduino where I select virtual cartridges, load them to the FPGA and retrieve the potentially updated file when the drive unloads. 

Even if the FPGA code were ready for this functionality, I still have to add the wire to the FPGA pin where UART 2 exports its clock signal to use as the SCK of the second SPI channel. This has to be tacked onto the pad of the FPGA and brought over to a board pin that I will repurpose from its original role. 

VIRTUAL CARTRIDGES ON SD CARD

A 2315 cartridge holds 321 words (16 bits each) in a sector. It has four sectors on a track, two tracks on a cylinder and 203 cylinders on the entire cartridge. This results in 1,042,608 bytes of data per cartridge. I have organized the virtual cartridge file in the same structure as the IBM 1130 simulator uses, for ease of sharing of disk cartridge files between real 1130 systems and the simulator. 

I use an SD card to hold these files, having names of the form VCxxxxxx with a six digit numeric cartridge ID. The program will manage up to 512 cartridge images. The SD card will be prepopulated with a number of cartridge images but additional ones can be easily created by the copy function included in this Virtual 2315 Cartridge system. The user selects one of the existing cartridge images for copying with the Left button, then navigates to an empty slot and pushes the Right button to make a copy in that slot. 

The system will name the new cartridge with the next sequential cartridge number above the one that was selected for copying, but skipping over any existing cartridge files. For example, if we select VC222222 and copy it in an open slot, the Arduino sketch will check to see if VC222223 is already on the SD card, continuing to increment until an unused number is found. 

Note that the cartridge number here is not the same as the cartridge ID as used with the Disk Monitor System (DMS) software on the 1130. DMS uses four digit cartridge IDs. 

USER INTERFACE EXERCISED

The user interface consists of a two line by 16 character LCD screen and five pushbuttons. The top line of the LCD screen shows the cartridge number of the current position in the list of existing cartridge files on the SD card. The second line shows informational messages such as "Selected to copy" or "Duplicating". 

The Up and Down buttons move through the list of existing virtual cartridge files, with the 'up'-most position being the first entry and moving down past the existing entries brings you to empty slots that show as 'blank'. 

Pushing the Left button while a cartridge number is visible on the LCD screen selects that cartridge image for copying. 

Pushing the Right button only takes action if we have previously selected a file with the Left button and the current position shows 'blank'. In that case, we create the new virtual cartridge file and copy the contents of the selected original over to the new file. 

The final button is Select, which will open the virtual cartridge file whose number is showing on the LCD screen. It sends the entire file down to the FPGA where it is loaded into memory ready for access by the disk drive and 1130 computer. 

When the physical disk drive that this system is hooked to has any physical cartridge inserted and is switched on, once the drive attempts to load the heads it sends a signal to the Arduino. If we have sent a disk image down to the FPGA then we report that the heads are loaded, which causes the drive to report Ready and let the 1130 begin issuing input/output commands to it. 

If a file has been shipped down to the 1130 and we reported the heads are loaded, the 1130 may update parts of the virtual cartridge. Therefore, when the drive acts to unload the heads, the Arduino asks the FPGA to ship up the potentially modified virtual cartridge file which we write back onto the SD card. 

The five buttons do not operate while the heads are loaded and our virtual cartridge file is active down in the FPGA, only when the drive is switched off. 

CARTRIDGE COPY TESTED

The functions to move through the virtual cartridge files on the SD card and to make a copy of a selected cartridge were all exercises and validated. The only portions of this code that were not yet tested have to do with the second SPI channel and the transactions with the FPGA to transfer virtual cartridge images. 

I will do a final exhaustive test once everything is hooked together and I am testing with the physical drive on a running IBM 1130. 

FPGA BEING BUILT AROUND EXISTING XEROX ALTO DISK TOOL CODE

Years ago I created a disk tool to connect to Diablo disk drives and extract the cartridge contents. These cartridges were in the Xerox Alto format, quite a bit different from the IBM 1130. These cartridges from the Xerox Palo Alto Research Center archives were provided to us in order to extract all the disk images, after which the physical cartridges were donated to the Computer History Museum. 

The tool was used to archive more than 100 cartridges containing historically valuable programs and data. I built this around a different Xilinx FPGA board, but the principles are similar enough to warrant reuse of the VHDL. 

I had written the tool to operate in two modes - drive and emulator - so that the tool could be wired to a Diablo disk drive or it could be connected to a Xerox Alto. In the latter case, disk file images would appear to be spinning cartridges on a Diablo drive, but the drive was emulated by the tool. 

The driver mode was in full production use, but I had not finished debugging of the emulator version because Ken Shirriff created a handy network boot device that gave us the same ability to run from disk images without spinning the real Diablo drive - since his was complete first, the emulator mode became a very low priority.

I find that the Virtual 2315 Cartridge system will use modified versions of functions in both the driver and the emulator sides of the Alto tool. For example, the driver side, which was cabled to a physical Diablo drive, would track the current sector number and detect the Sector and Index marker pulses. However, the emulator mode hooks to a CPU and would take data from RAM in the FPGA and generate a stream of read data and clock bits to present in lieu of using a physical drive. 

My Xerox Tool used a parallel port over USB link to a PC side program, whereas the Virtual 2315 Cartridge will use an SPI link to an Arduino. The board I used back then had a very different RAM system than the Artix S7 board employed in the current project. As a result there are a number of changes that I have to introduce that are outside of the actual disk functionality. 

No comments:

Post a Comment