The SD card interface is not at all compatible with any existing disk drive controller for the SS-50 bus, so you can’t just drop a “bootable” DSK image onto an SD card and boot with an unmodified system. For the Corsham Tech CPU boards, I put in low level functions to read/write the files on the SD card and added monitor commands to boot from it.
This is not a trivial exercise, but I’ve got lots of information, code and experience to help you. If I find most people are in the same starting point, maybe I can come up with something to make this easier, but here are the steps generally needed to get started.
Functions Needed to Boot
There are six low-level functions you’ll need to provide to boot, but you’ll want a few more to make the disk drivers easier to write. For our cards, I’ve put all of these into the EPROM at fixed locations so other code can just call these functions.
<<insert pario.asm and diskfunc.asm downloads here>>
The PARIO file is the real driver, and is the only file that knows anything about the hardware address of the parallel port. The five main functions of this file are:
- Initialize the parallel port
- Set the port to write to the Arduino
- Set the port to read from the Arduino
- Write a byte to the Arduino
- Read a byte from the Arduino
All other functions call those five (usually just the last four) to perform higher level functions. The file diskfunc.asm has a lot of sample code for higher level functions, but the three that are really required are:
- Read a sector (needed to boot0
- Write a sector
- Get status of a drive
I strongly suggest putting a jump table to each of these functions at a known location in your monitor EPROM so they can be debugged once and then all other software calls them rather than twiddling with hardware directly.
FLEX will read in the first 256 bytes of the DSK file on drive 0 (effectively track 0, sector 0) into memory at A100. This code is expected to load FLEX, and will need access to the sector read function from the last section.
To make this easier, start with our bootloader. This is assembled from the FLEX ASMB assembler:
Your code can be identical except for adjustments for your jump table.