• Please review our updated Terms and Rules here

how to transfer .COM via serial port

agentb

Experienced Member
Joined
Apr 22, 2021
Messages
364
Location
Philly, USA
Here's my challenge for today, how to get a binary (.COM) file moved over to a floppy on my Osborne 1. I've got 1200 baud serial comm and did a:
pip test.bas=ptr:
and that worked.

but I'm assuming this wont work with a binary file because there will invariably be a Ctrl-Z character in the .com file.

Thoughts!? All I have is a CP/M system floppy.
 
If I read the manual correctly, PIP will do the job but requires a [O] switch at the end. I think that is the letter O but double check the manual to be sure.

pip test.bas=ptr:[O]
 
If I read the manual correctly, PIP will do the job but requires a [O] switch at the end. I think that is the letter O but double check the manual to be sure.

pip test.bas=ptr:[O]

Brilliant! Thanks for the quick response. I will give this a try. Very interesting, and sure enough the MBASIC.COM I was trying to transfer over is indeed a multiple of 128 bytes:

In a non-ASCII file, however, CONTROL-Z is just as likely to occur as any other
character. Therefore, it cannot be used as the end-of-file marker. CP/M uses a
different method to mark the end of a non-ASCII file. CP / M assumes it has reached
the end of the file when it has read the last record (basic unit of disk space) allocated
to the file. The disk directory entry for each file contains a list of the disk records
allocated to that file. This method relies on the size of the file, rather than its
content, to locate the end of the file.
 
Alternatively. a CP/M .COM file can be represented by an Intel HEX file, which is pure ASCII. Some versions of CP/M and MP/M including a GENHEX utility to do the conversion. LOAD, of course, does the reverse. Intel HEX files do have the advantage that they're checksummed.
 
Alternatively. a CP/M .COM file can be represented by an Intel HEX file, which is pure ASCII. Some versions of CP/M and MP/M including a GENHEX utility to do the conversion. LOAD, of course, does the reverse. Intel HEX files do have the advantage that they're checksummed.

Ahh interesting. I haven't had success yet with the [O] option, PIP doesn't seem to close after the xfer. I read about using LOAD to convert to .COM but I wasn't sure how to go from .COM to .HEX -- to then send the .HEX over serial. Still playing around. Apparently you can't send too big of a file because after the buffer is full and the write to floppy happens, that may corrupt the serial xfer (?)
 
Using the instructions here, I was able to chunk the .hex kermit file into 4 pieces, xfer them over via ascii, and concatenate back together with pip onto drive B. Pretty neat that pip. Then I used the DDT and SAVE command to write out the kerm411.com which seems to work! Will try kermit next for xfering binary files.
 
There are also a several Software solutions to copying CP/M Files. The BEST is 22DISK designed/written/tested/supported by
a Gent that frequents VCF. Plus there is CONVERT and XENOCOPY. You can also use cpmtools (or cpmtools built with libdsk)
to copy files from Desktop/Laptop to an Image of the floppy. Then, the Image is converted to a file that is written to floppy media.
And of course there are the GOTEK's, Flashfloppy, and HxC software for the conversion of software images to the GOTEK/Flashfloppy Formats (Definitions).

cpmtools/libdsk/GOTEK Definitions I have for some of the Osborne's are:
Code:
BEGIN OSB1 Osborne 1 - SSSD 48 tpi 5.25" - 256 x 10
INSERT 22DISK DEFINITION HERE
END

# OSB1 Osborne 1 - SSSD 48 tpi 5.25" - 256 x 10
diskdef osb1
seclen 256
tracks 40
sectrk 10
blocksize 2048
maxdir 64
skew 2
boottrk 3
os 2.2
end

# libdsk data below
[osb1]
description = OSB1 Osborne 1 - SSSD 48 tpi 5.25" - 256 x 10
cylinders = 40
heads = 1
secsize = 256
sectors = 10
secbase = 1
datarate = SD

#Flashfloppy/GOTEK
[osb1]
cyls = 40
heads = 1
secs = 10
interleave = 2
bps = 256
id = 1
#rpm = 360
rpm = 300
rate = 125
mode = fm
iam = no

BEGIN OSB2 Osborne 1 - SSDD 48 tpi 5.25" - 1024 x 5
INSERT 22DISK DEFINITION HERE
END

# OSB2 Osborne 1 - SSDD 48 tpi 5.25" - 1024 x 5
diskdef osb2
seclen 1024
tracks 40
sectrk 5
blocksize 1024
maxdir 64
skew 1
boottrk 3
os 2.2
end

# libdsk data below
[osb2]
description = OSB2 Osborne 1 - SSDD 48 tpi 5.25" - 1024 x 5
cylinders = 40
heads = 1
secsize = 1024
sectors = 5
secbase = 1
datarate = DD

#Flashfloppy/GOTEK
[osb2]
cyls = 40
heads = 1
secs = 5
interleave = 1
bps = 1024
id = 1
#rpm = 360
rpm = 300
rate = 250
mode = mfm
iam = no

BEGIN OSB3 Osborne Executive - SSDD 48 tpi 5.25" - 1024 x 5
INSERT 22DISK DEFINITION HERE
END

# OSB3 Osborne Executive - SSDD 48 tpi 5.25" - 1024 x 5
diskdef osb3
seclen 1024
tracks 40
sectrk 5
blocksize 1024
maxdir 64
skew 1
boottrk 3
os 2.2
end

# libdsk data below
[osb3]
description = OSB3 Osborne Executive - SSDD 48 tpi 5.25" - 1024 x 5
cylinders = 40
heads = 1
secsize = 1024
sectors = 5
secbase = 1
datarate = DD

#Flashfloppy/GOTEK
[osb3]
cyls = 40
heads = 1
secs = 5
interleave = 6
bps = 1024
id = 1
#rpm = 360
rpm = 300
rate = 250
mode = mfm
iam = no

BEGIN OSB4 Osborne G2 System - DSDD 48 tpi 5.25" - 1024 x 5
INSERT 22DISK DEFINITION HERE
END

# OSB4 Osborne G2 System - DSDD 48 tpi 5.25" - 1024 x 5
diskdef osb4
seclen 1024
tracks 40
sectrk 10
blocksize 2048
maxdir 128
skew 1
offset 20480
boottrk 0
os 2.2
end

# libdsk data below
[osb4]
description = OSB4 Osborne G2 System - DSDD 48 tpi 5.25" - 1024 x 5
sides = extsurface
cylinders = 80
heads = 2
secsize = 1024
sectors = 5
secbase = 1
datarate = DD

#Flashfloppy/GOTEK
[osb4]
cyls = 80
heads = 2
secs = 5
interleave = 1
bps = 1025
id = 1
#rpm = 360
rpm = 300
rate = 250
mode = mfm
iam = no

BEGIN OSB5 Osborne G2 System - DSDD 96 tpi 5.25" - 1024 x 5
INSERT 22DISK DEFINITION HERE
END

# OSB5 Osborne G2 System - DSDD 96 tpi 5.25" - 1024 x 5
diskdef osb5
seclen 1024
tracks 80
sectrk 10
blocksize 2048
maxdir 256
skew 1
offset 20480
boottrk 0
os 2.2
end

# libdsk data below
[osb5]
description = OSB5 Osborne G2 System - DSDD 96 tpi 5.25" - 1024 x 5
sides = extsurface
cylinders = 160
heads = 2
secsize = 1024
sectors = 5
secbase = 1
datarate = DD

#Flashfloppy/GOTEK
[osb5]
cyls = 160
heads = 1
secs = 5
interleave = 1
bps = 1024
id = 1
#rpm = 360
rpm = 300
rate = 250
mode = mfm
iam = no

There are good tutorials on cpmtools and libdsk on several forums. The latest (and most updated) is on the Debian Forum.


Larry


Click image for larger version  Name:	Convert.png Views:	0 Size:	29.7 KB ID:	1206712
 
Using the instructions here, I was able to chunk the .hex kermit file into 4 pieces, xfer them over via ascii, and concatenate back together with pip onto drive B. Pretty neat that pip. Then I used the DDT and SAVE command to write out the kerm411.com which seems to work! Will try kermit next for xfering binary files.

Ahh well, the kerm411.com isn't working today, who knows. Probably will go back to messing with PIP
 
Thanks Mike. PCGET.HEX sounds like just what I need and can be sent over the serial port with PIP. Actually I guess I need the PCGET.ASM since I need to change the IO port addresses which look to be: 2A00 for status/control, and 2A01 for data - that 2SIO board looks to use the same 6850 chip as the Osborne so could work. I believe I then just would need to do ASM PCGET.ASM and then LOAD PCGET.HEX and then I should have the PCGET.COM (?)
 
I looked into that PCGET.ASM code and looks to be made for 8080 Altair so not sure how to get it to work for Osborne. The IN instruction looks to take a 8-bit port for the 8080, and that instruction doesn't look to exist for Z80. I tried using 2A00H and 2A01H for the ports but I dont think ASM liked that as I dont think it makes for a valid instruction. I'm going to try getting kermit over there again, but I do like the xmodem idea.
 
The Z80 supports all 8080 instructions, so it does it have the same IN instruction as the 8080 (along with some Z80 specific variants as well), however, the Osborne uses memory mapped I/O instead of I/O space. As you noted, the memory mapped location of the port is at 2A00h, 2A01h, but I/O devices are in bank 2, so it doesn’t look like a program at 0100h can directly access the serial port.

Mike
 
Success! Through a combination of info from http://www.toniwestbrook.com/archives/80 and http://www.z80.eu/kermit.html I was able to cobble together kermit 4.11 and then use gkermit on minicom in linux to do the transfer. Here are some steps for posterity:
  1. get http://www.z80.eu/downloads/mload.hex
  2. get http://www.toniwestbrook.com/wp-cont.../10/cpsker.hex
  3. get http://www.toniwestbrook.com/wp-cont.../10/cpvosb.hex
  4. chunk cpsker.hex into 4 pieces (split -n 4 cpsker.hex, rename chunks to ker1, ker2, ker3, ker4)
  5. transfer over mload.hex and cpvosb.hex via serial port (1200 baud) using ascii upload, make sure to turn off hardware and software flow control (pip mload.hex=ptr:, pip cpvosb.hex=ptr: )
  6. transfer over the 4 kermit chunks, then reassemble (pip ker1=ptr:, ..., pip cpsker.hex=ker1,ker2,ker3,ker4)
  7. make your mload.com (load mload)
  8. make your kerm411.com (MLOAD KERM411=CPSKER,CPVOSB)
  9. run kerm411 and then RECEIVE at command prompt
  10. to upload I setup gkermit as a protocol in minicom with the following command line: /usr/bin/gkermit -e 80 -S -X -i -s
Now i've got MBASIC.COM moved over, next to try Zork if I can free up enough space, bye bye SuperCalc hah
 
Back
Top