reading/writing disks?

345 views
Skip to first unread message

Len

unread,
Aug 25, 2017, 12:51:39 PM8/25/17
to Altair-Duino
Has anybody tried to read and/or write to the disks on the microSD card using "cpmtools" under another OS (I think those tools are available under Linux, OS/X, and Windows)? I want to build a couple of custom disks and add them to the supplied mix, but I've had no luck so far.

If anybody even knows the sector/track count/skew, etc., that would be helpful.

(I figure I can use Kermit to transfer files via one serial port or another, eventually)


Jim McClanahan

unread,
Sep 14, 2017, 1:21:37 PM9/14/17
to Altair-Duino
I'm trying to figure out the same thing. Just getting started, but it looks like SIMH linked to at the bottom here does the trick:

http://altairclone.com/support.htm

Looks like a combo dev, test, and transfer tool.

Thanks,
Jim

Jim McClanahan

unread,
Sep 15, 2017, 10:48:51 AM9/15/17
to Altair-Duino
This is from the drive.cpp code:

#define DRIVE_SECTOR_LENGTH 137
#define DRIVE_NUM_SECTORS 32
#define DRIVE_NUM_SECTORS_MD 16
#define DRIVE_NUM_TRACKS 77
#define DRIVE_NUM_TRACKS_MD 35

The sectors are 137 bytes long with 128 bytes of payload. Regular 8" drives have 32 sectors per track and 77 tracks. Regular mini-disk (5.25") drives have 16 sectors per track and 35 tracks.

Even knowing that, I took a quick look at cpmtools and it isn't clear to me that you could read / write the image files. 

Thanks,
Jim

David Hansel

unread,
Sep 15, 2017, 6:22:01 PM9/15/17
to Altair-Duino
One way to transfer files from a PC to CP/M disks on the Altair (or the other way around)
is using Mike Douglas' excellent PCPUT/PCGET tools.

I like the following setup:
- configure 2SIO port 1 to use the primary serial interface (necessary for CP/M use anyways)
- configure 2SIO port 2 to use the secondary serial interface
- start CP/M on the Altair
- start Putty on your PC and connect to the primary serial (to interact with CP/M)
- start TeraTerm on your PC and connect to the secondary serial
- the CP/M disks contain PCPUT.COM and PCGET.COM

To transfer a file from PC to CP/M:
- in CP/M type: PCGET [filename] B
  (note the B at the end to tell PCGET to receive from 2SIO port 2)
- in TeraTerm, select File->Transfer->XMODEM->Send... and select the file
  to be transmitted
- TeraTerm should show the transmission and PCGET should confirm with
  "Transfer Complete" when done.

Transfering from CP/M to PC works just the same, just using PCPUT and XMODEM->Receive...

This can most likely also be done by just using TeraTerm on the primary
console but I personally prefer Putty - except that Putty does not have XMODEM support.

Len

unread,
Sep 15, 2017, 7:41:22 PM9/15/17
to Altair-Duino
AHA! Thank you! (and thanks for your work on the emulator, it's terrific)

(and thanks, Jim, for responding too, I'm sorry I haven't had a chance to post here before now)

I was just able to create a new empty disk named "DISK10.DSK" while running in the non-Arduino version (a Linux build) by dd'ing a blank disk in the "disks" directory using this command - BEWARE, THIS IS A DANGEROUS LINUX COMMAND, AND CAN RUIN YOUR WORKSTATION DRIVE IF YOU MAKE A MISTAKE!:

    dd if=/dev/zero of=DISK10.DSK bs=337664 count=1

mounting it in drive 1 - add a new entry to DISKDIR.TXT - and using the CP/M FORMAT command on B. I haven't tried transferring it to the microSD card yet, etc.

I think I might build a bunch of empty disks and leave them there for future use.


David Hansel

unread,
Sep 15, 2017, 7:52:29 PM9/15/17
to Altair-Duino
Actually you shouldn't need to do that. You can just mount a disk image that does not yet exist
and then format it in CP/M. That will automatically create the image.

It won't create an entry in DISKDIR.TXT though, so you'll have to remember which ones
you have created.

Joseph Bento

unread,
Dec 31, 2017, 2:47:20 PM12/31/17
to Altair-Duino
Still learning, so excuse this is a dumb question.  

I take it that I can transfer files from my PC to the Altair using the method you describe.  I'm currently connected via the USB programming port on the Arduino, using TeraTerm to communicate.  How do I see what the COM port assignment is that CP/M sees?

I've downloaded a few CP/M games that I'd like to transfer to the SD card.

Thanks!

Joe

Joseph Bento

unread,
Dec 31, 2017, 4:29:36 PM12/31/17
to Altair-Duino
Playing around with PCGET.  I type PCGET [filename] and a transfer appears to initiate, and the filename is created in the CP/M directory listing.Using XMODEM protocol, the transfer never progresses.  

Joseph Bento

unread,
Dec 31, 2017, 8:09:21 PM12/31/17
to Altair-Duino
Changed my terminal emulator.  File appears to transfer, though continues far past the number of blocks specified for the file.

Reply all
Reply to author
Forward
0 new messages