• Please review our updated Terms and Rules here

Creating CPAM image for smartportsd HD on apple 2c ZRAM board

vldmrrr

Experienced Member
Joined
Aug 20, 2016
Messages
169
Location
IA, USA
I recently hooked up smartportsd device to apple 2c that has ZRAM Utra 3 board installed. After patching the firmware to report images of size 800K as "DISK 3.5" floppy I was able to run CPAM60UF.com to make the image bootable to CPAM 5.1 on the board.

Now I wanted to have a bigger sized hard drive image not necessarily bootable, just for more storage. According to Users manual the only hard drive that was supported at the time was Sider drive, no mention of smart port hard drives.

I tried to use a 32MB image with copy of bootable floppy image at the start of the image. The filesystem is recognized with stat reporting different geometry from floppy:

Code:
A: Drive characteristics (800k 3.5 drive)
62272; 128-byte record capacity
784: kilobyte drive capacity
256: 32-byte directory entries
64: checked directory sectors
128: records/ physical extent
16: records/ reservation block
64: 128-byle sector/track
2: reserved tracks

Code:
B: Drive characteristics (32MB image)
16368; 128-byte record capacity
2046: kilobyte drive capacity
512: 32-byte directory entries
0: checked directory sectors
: records/ physical extent
16: records/ reservation block
64: 128-byle sector/track
2: reserved tracks

So the image is treated as 2MB drive, which is not as good as full capacity, but better than 800k. With that data I created the following disk definition for cpmtools:
Code:
diskdef cpam-hd
  seclen 128
  tracks 256
  sectrk 64
  blocksize 2048
  maxdir 512
  boottrk 2
  os 2.2
end

With this format I created a 2MB image using mkfs.cpm and put some files using cpmcp. The files were recognized on target machine but contents are curiously incorrect. By typing a long text files I found that the first 128 bytes are repeated 8 times, then 128 bytes at position 1024 are repeated 8 times and so on.

So I am trying to solve this puzzle of what is at fault here and for what the reason, and invite all enthusiasts of puzzles of the sort to participate with troubleshooting advice.

One strange fact in reported geometry is absent value for "records/ physical extent" on hard drive, whatever that means. Where would that come from? How in general cp/m would deduce all these parameters for hard drive?
 
Last edited:
Under CPAM smart port devices are added using pc.com utility which produces as a result an executable file cauto.com. This file executes automatically after system boot and adds devices that were configured by pc.com.

I looked inside cauto.com and found a place that patches the running system with a block of 6 DPBs (device parameter blocks). After playing with modifying DPB for largest device I was able to create a working configuration for a 16MB drive. The working setup is attached to the post. The archive contains a bootable 800k floppy image PART1.po, blank 16MB hdd image PART2.po that is attached on boot as drive b:, and a diskdefs config file for cpmtools that works with these images. The files were tested on apple 2c with ZRAM Utra 3 board.

I did put boot tracks with patched DPB on hdd image. The system does boot from the image but is not able to execute any program from the disk, so it looks like there is more to it than just patching DPB. There is another block of 107 bytes loaded by cauto.com into the system, but I have not figured out how to apply it to boot tracks.
 

Attachments

  • cpam-smartportsd.zip
    124.9 KB · Views: 0
A kind anonymous shared with me actual source code of CP/AM. After looking into it I learned about the meaning of another block that was patched into the system - it was DPH (Disk parameter headers). The only relevant field seemed to be the first word - address of skew table. In boot loader it sets skew as in 3.5 floppy drive, while hard drive does not have any skew. Indeed setting this field to 0 made the hard drive image bootable and functional - the programs are executed fine from this image booted. The new bootable image is attached.

That seems to conclude the quest declared in the topic's subject. Thank you for your attention
 

Attachments

  • cpam-smartportsd.zip
    109.9 KB · Views: 2
Back
Top