Using the 4D Systems micro-Drive with CP/M

"There are only two types of Hard Drive - Those that have failed and those that will fail"

With the above quote in mind and wishing to avoid the disaster of losing all of the data on my Compact Flash drives, I have been looking for a means of making back-up copies.  The uDrive can transfer hundreds of CP/M files at a time and so is ideal for this purpose.  This useful device is available from here (see 4D systems) and will allow easy transfer of files between a Z80 CP/M computer and a PC. It works by reading serial commands and data; then storing the data as files on a Micro SD card.
The uDrive can operate in raw mode (reading or writing directly to the disk sectors at low level) or in FAT mode (DOS) which is more useful because this allows the micro SD card to be read or written to by a PC.

To give an idea of how small they are - the uDrive is shown here with a standard (for 1984) 2K SRAM chip. Also compare the micro SD cards with a standard SD card.

To use the uDrive with CP/M five main utility programs are required.

 1...Read uDrive directory and display file names.

 2...Write a CP/M file to the uDrive.

 3...Read a DOS file from the uDrive.  

 4...Backup all files on selected CP/M drive to uDrive.

 5...Restore all files on uDrive to selected CP/M drive.

I have written five programs to carry out these tasks - in Z80 assembler. So far they have been working well and the uDrive has been very reliable.   When using the uDrive data is required to be written and read in 'packets'.  These are set to any size from 1 byte to 50 bytes (32hex) when in DOS mode. This is not compatible with CP/M 2.2 which expects data to be in blocks of 128 bytes.  I have arranged the software to work by using 4 x 32-byte packets when exchanging data with CP/M.

 

There was a small problem with the uDrive directory listing in that the directory data is not sent in packets but arrives as continuous data. I found that the time taken for reading and arranging a tidy display of files on screen was very tight. (I am running the serial link at 9600 baud)  The effect was that the display was fine until about 60 to 70 files had been listed then the display began to lose it's formatting. To overcome this the data is first read to RAM (while a message "reading" is displayed, then the saved directory list is transferred to screen. This works out well because it also makes it possible to 'pause' the directory listing at each screen full.

Another compatibility problem I found was that while CP/M files could be written to the uDrive correctly - their size is a multiple of 128 bytes. But if a file was transferred from the PC to the uDrive it was not always a multiple of 128 (80H).  For example, text files written on a PC can be any size. The software now takes note of any remaining bytes and loads them at the end while looking for the final ACK from the uDrive.

Large files (greater than 64K) were also a problem when backing up all files because they have more than one CP/M directory entry. I have added a check which ignores any directory entry with an extent byte larger than 03.

 

Once the CP/M data has been backed up to micro SD cards it can then be saved on a PC and written to CD if required.

Here the uDrive is shown connected to the Interak serial card.

The Interak Compact Flash drive is partitioned into 14 x 8MB drives (C to P) and I have used one 128MB micro SD card as a back-up for each drive. These were the smallest SD cards I could obtain.

Screen dump of Interak after running UDIR.COM.

Fig.1 shows the connection details to serial controller (in this case an AY-3-1015). The use of the diode 1N4148 is to prevent the TTL from pulling up pin 1 of the uDrive to 5V. The uDrive Reset has an internal pull-up to 3.3V.  Serial data is transmitted at 5V levels - not 12V RS232.

uDrive Pin Connections

1..Reset

2..Ground

3..Rx

4..Tx

5..Vcc (3.6V to 5.5V)

 

         I have placed the following programs on this site - click name to view

     (UDIR) display uDrive directory    (UWRITE) write CP/M file to uDrive.

         If you are interested in any of the other programs please contact me.                Back to Home Page