Thursday, April 6, 2023

Coded up quite a bit of the Linux app, ignoring the User Interface for now

UTILITY ROUTINES PREPARED

I created small focused routines for utility functions we need, such as startup and shutdown. One sets up and test the two bridges between the Field Programmable Gate Array (FPGA) with our user logic and this program running on the Hard Processor System (HPS) side of the chip. Another opens a disk file on the SD Card and maps it into virtual memory. There are also closedown versions of these. 

SCAFFOLD SET UP IN MAIN ROUTINE

The main program calls the utility routines when necessary and will have comments at the point where routines I will write in the future will be executed. I added a few special tests for the initial board testing, which I will remove, but mainly this is set up with the appropriate code and checks that will be used in production. 

LOAD AND UNLOAD ROUTINES DONE

These routines send a command to the FPGA to begin a load or unload operation. These will cause the contents of the virtual 2315 cartridge image, held on a file on SD Card, to be passed through the FPGA to be placed into a reserved 1MB area of RAM. The unload pulls the contents of that area of RAM back and delivers it to our program where we can identify and store any updates. 

I also created a special version of the unload routine which printed any blocks that had changed - the idea behind this is that if I do a load followed by an unload, the data returned should exactly match what was retrieved from the image file during the load. 

REMAINING WORK ON THE LINUX SIDE

I have to set up three interrupt routines. I will receive an interrupt from the LCD module any time the user touches the screen. In addition, as the disk drive controller does a pick, trying to lower the heads onto the disk surface, it will send an interrupt so we know we are ready to switch on the disk emulation in the FPGA - sending the command to switch drive_ram on. The third interrupt arrives when the pick signal is removed, usually because the operator has switched off the disk drive. We would then send a command to turn drive_ram off. 

The user interface will be a display of the file names from the SD Card which are valid virtual 2315 cartridge images. Buttons will allow the operator to scroll through those file names and select one to virtually mount on the disk drive. The user interface must respond to the button presses, update the screen contents, and when a file is mounted it opens the file using our utility routine. Deselecting a cartridge closes the image file.

In order for the disk drive to think it is ready for input-output operations, it must receive the HeadsLoaded signal that we generate from this program. We do that if we have an image file open and we get the pick signal interrupt. HeadsLoaded is dropped when we get the other interrupt that tells us pick has been switched off. 

The LCD Module comes with a library of C routines that I can call to handle most of the heavy lifting driving the LCD panel and determining where the user touched it. 

No comments:

Post a Comment