The VCPU:
The VCPU (Virtual CPU) is a generic running environment, which is an extension of the sd2iec firmware developed for SD2IEC drives. (In all documentation, the drives family is referred to as SD2IEC (all upper case), the original firmware for this drives is referred to as sd2iec (all lower case).) This firmware extension is currently found in the FlexSD firmware, which is an sd2iec firmware fork.
Information for general users:
In order to run programs that require the VCPU, the SD2IEC drive must have the appropriate firmware. However, there are several types of hardware with the name SD2IEC, and different firmware for each! Replacing firmware is usually a simple operation: copy the desired firmware into the root directory of a properly formatted SD card, insert the card into the drive, and reboot the drive. If the drive finds the copied firmware file, it will replace the current version with the new one (if the two versions are different). When replacing firmware, one of the drive's LEDs will flash rapidly during the process. The drive will only use firmware files that match the SD2IEC hardware! So, if the user is not sure what SD2IEC hardware he has, he can copy all types of the firmware to the card and the drive will select the appropriate one. At the end of the process, the drive will reboot with the updated firmware. It is then recommended to delete the firmware file from the card. Do not leave multiple versions on the card! (If the firmware replacement does not work, contact the drive manufacturer.) In principle the drive cannot be broken, the previous process can be used to restore the original firmware. Currently supported SD2IEC versions (except for a few, very rare versions) are those that can be used with the original sd2iec firmware!
Warning: the VCPU does not emulate any CBM drive! (Old 1541-only programs will not work with new firmware only!)
To use it, download the latest "precompiled binaries" package from the site, extract and copy the firmware file corresponding to the drive (or all of them) to the SD card, then proceed as described above.
Information for CBM programmers:
The original sd2iec firmware does not support loading and running programs in the drive. If the programmer wants to create SD2IEC support, he must implement the driver-side code in the sd2iec firmware. (In this case, the SD2IEC drive behaves towards the computer as if it were a 15x1 drive running the loaded program.) Then any future upgrades will also need to modify the drive firmware... The VCPU changes this architecture: it provides a hardware-independent virtual running environment into which the programmer is free to implement his own drive-side program. Although this has to be handled separately on the computer side (instead of one kind of drive, there is a separate 15x1 or SD2IEC drive), the only requirement is that the drive firmware only needs to support VCPU, and the programmer can create the drive-side code he needs. Since the drive-side code is then contained on the computer side, subsequent modifications/upgrades will be independent of the drive firmware.
With the VCPU, any data transfer protocol can be freely implemented on the drive side, so the programmer can create an implementation like the 15x1 version works. This way, the code used on the computer side can be the same for the 15x1 or SD2IEC drive. (The initialization of the drive and the program that goes into the drive will obviously be different.) As the VCPU is not just for managing disk images, the SD2IEC drive provides a large capacity storage.
The VCPU consists of a simplified/extended emulated 6502 and its associated hardware environment (also emulated). Differences between the different SD2IEC implementations are hidden from the programmer by the VCPU, so no separate support is needed!
To use it, download the "precompiled binaries" package from the site, extract and copy the firmware file corresponding to the drive (or all of them) to the SD card, then proceed as described above. For programming information, see the "programming documentation" in same place. (Precompiled) test programs are also available to help you with programming and to observe the use of the different functions.
FlexSD firmware site