• Please review our updated Terms and Rules here

Creating CP/M Floppy's in December 2022 with Debian (Linux)

ldkraemer

Veteran Member
Joined
Mar 14, 2013
Messages
2,611
Location
Chaffee, MO
Debian (Versions 8 thru 11) Linux can be used to create CP/M Boot floppy's, if you know the Sector Size
and the Number of Sectors per Track. Debian (ver 8-11) still supports Floppy Drives if the FDUTILS and
MTOOLS Packages are installed.

FDUTILS Ver 5.6-2
MTOOLS Ver 4.0.26-1

For Linux you must have the proper permissions to access the Floppy Hardware. You can use the groups
command to determine who has permission to use the floppy hardware (/dev/fd0 & /dev/fd1).
Code:
$ groups
larry tty lp dialout cdrom floppy sudo audio dip video plugdev netdev bluetooth lpadmin scanner

If no floppy is detected there will be a message such as:
Code:
$ ls -alt /dev/fd0
ls: cannot access '/dev/fd0': No such file or directory

CONNECTING A FLOPPY DRIVE
All of the drives are typically shipped strapped from the Manufacture, ready to be inserted into a Computer
case as DS1. (Unless someone is selling on ebay and has changed the jumpers from DEFAULT.) To connect
to your Motherboards you just need a cable that has the IBM twisted connectors for the last floppy connector
on the cable having conductors 10 thru 16 twisted. One end of the cable goes to the Motherboard, and middle
connector is for Drive 1 (in a DS{0..3} configuration) and the end connector on the cable is Drive 0 (in
a DS{0..3} configuration). The Floppy at the End of the cable ALWAYS has the TERMINATOR located on
the Drive. (Note: if using 1.2M or 1.44M floppy's they already have the necessary PULL-UP resistors
installed so the Terminator resistors are not required.) Plug the floppy onto the end of the cable in the DS0
position (although the drive will be strapped for DS1). In fact both floppy drives (if used) will be strapped as DS1.

So, all you need is to connect the Power connector to the drive, attach the first Floppy Drive to the end of
the cable and double check that the floppy was strapped for Drive select 1 (DS1) in a DS{0..3} configuration.
The Floppy drive may have designations 1 to 4 versus 0 to 3 as in DS{1..4}. In this case the second floppy
would be DS2 in a DS{1..4} configuration.

After that you power up and make sure the BIOS is properly set for the type floppy 360K, 1.2M, 720K, 1.44M.
When you boot the floppy should turn on the LED and step the floppy to determine if it is a 48 TPI or 96 TPI
unit (40 or 80 Tracks). An error message pops up if the BIOS is set incorrectly.

Test the floppy by copying to and reading from it.

Linux lets you write a variety of floppy types as determined by the /etc/mediaprm file.

/etc/mediaprm is Attached

In this example I am wanting to write a Boot Floppy for the Otrona Attache which has 48 TPI Drives - DSDD 48 tpi 5.25"
This definition is already defined in my mediaprm file:
Code:
"OTR1":
 DS DD sect=10 ssize=512

At this point I need to tell Debian to load the Otrona Parameters for the Floppy drive /dev/fd0.

I INSERT a Blank Floppy in Drive A = /dev/fd0 (for next commands)
Code:
$ lsblk
and the response is:
Code:
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 117.2G 0 part /
├─sda2 8:2 0 24.4G 0 part
├─sda3 8:3 0 321.7G 0 part
└─sda4 8:4 0 2.5G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom

Next, I load the Parameters
Code:
$ sudo setfdprm /dev/fd0 otr1

Which sets the floppy Drive for 512 x 10 and Double Density
Verify that the parameters are correct with:
Code:
$ getfdprm
And the response is:
Code:
DS DD sect=10

I just VERIFIED the parameters are CORRECT!

Now, Format the Floppy:
Code:
$ sudo superformat /dev/fd0 otr1

and double check the configuration that wrote the floppy.
Code:
S lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 400K 0 disk
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 117.2G 0 part /
├─sda2 8:2 0 24.4G 0 part
├─sda3 8:3 0 321.7G 0 part
└─sda4 8:4 0 2.5G 0 part [SWAP]
sr0 11:0 1 1024M 0 rom

Get the *.RAW file to write to floppy
Code:
$ cd Downloads/Otrona
$ sudo dd if=attbt225.raw bs=1 of=/dev/fd0 conv=notrunc
The finished response is:
Code:
409600+0 records in
409600+0 records out
409600 bytes (409 kB) copied, 151.523 s, 5.4 kB/s

Insert the Floppy in the Otrona Attache with 48 TPI Floppy Drives and Boot the Floppy.

Note: The Otrona 48 TPI Floppy is a RAW OUT-OUT format, and cpmtools can read/write RAW ALT,
RAW OUT-OUT, and RAW OUT-BACK formats. The Otrona 96 TPI Floppy is RAW OUT-BACK format.

In this case the real Floppy was Imaged with IMD, and I used the IMDA and IMDU utilities to
extract the raw image in DOS. You can also use DOSBox running on Linux.
Code:
$ IMDA ATTBT225.IMD > ATTBT225.TXT
$ IMDU ATTBT225.IMD ATTBT225.RAW /B /E /D >> ATTBT225.TXT

Extracts the .RAW image from a .IMD file.

Code:
$ cpmls -f otr1 -T raw,otr1 -D ATTBT225.RAW
     Name    Bytes   Recs  Attr     update             create
------------ ------ ------ ---- -----------------  -----------------
AUTO    .COM     2K      6
BACKUP  .COM     2K     12
BARSAMPL.CHT     2K      3
BRUN    .COM    16K    121
CHARTON .COM    26K    200
CHARTONF.        6K     46
D       .COM     2K     11
DAY     .COM     2K     10
DDT     .COM     6K     38
DISK    .COM     6K     44
EDFILE  .COM    12K     86
EPSFIX  .COM    12K     91
FORMAT  .COM     2K      6
LINSAMPL.CHT     2K      3
MBASIC  .COM    26K    195
MDM707  .COM    18K    132 R
MODEM   .COM    20K    146
MUSIC   .COM    10K     72
NULU    .COM    16K    120
PIESAMPL.CHT     2K      2
PORTS   .ATT     2K      3
PORTS   .COM    14K    101
PRINTER .VL2    28K    224
SORTV   .COM     2K      9
SQ      .COM    14K    106
STAT    .COM     6K     41
SYSDUP  .COM     2K      6
SYSGEN  .COM     2K      6
TIME    .COM     2K     16
USQ     .COM    10K     79
VALET   .VL2    28K    224
XDIR    .COM     4K     19
XF      .COM     8K     62
XTYPE   .COM    10K     70 R
   34 Files occupying    322K,      74K Free.


Larry
 

Attachments

  • mediaprm-11-Bullseye.txt
    11.9 KB · Views: 7
Last edited:
Thanks, I corrected a few things where I had mixed otr2 and otr1. The same procedures
will work on the Otrona 96 TPI floppy Images.

A Lot of Linux Distro's have already dropped floppy support, and Debian may at some point.

Larry
 
Hi Larry,
How are you?
It has been a very long time since I contacted you about Intertec Superbrain images and using Image disk to manipulate them. I was wondering if you had a conical version of diskdefs for cpmtools?

Stephen
 
Thanks for this, Larry. I just came into possession of an Otrana Attache, pretty excited to get it going again, but I will need a boot disk eventually. Now to track down a 5-1/4 Floppy Drive so I can try these instructions out and get that Attache computing again!
 
tinsmith,
If you Otrona Attache has 96 TPI Floppy Drives, and you get it booting properly from a floppy that
was created for a 96 TPI drive, I'd like a copy of the Boot Floppy.

I can create a 48TPI floppy for you if you want.

Larry
 
It appears I left off the -p switch for the setfdprm command.

Next, I load the Parameters
Code:
       $ sudo setfdprm -p /dev/fd0 otr1

The command switches are shown in the man page
Code:
        $ man setfdprm

Larry
 
Another thing I discovered yesterday is the developers have changed /dev/fd0 from group floppy to disk.

Code:
$ ls -alt /dev/fd0

brw-rw----   1 root disk      2,   0 Jan 26 10:02 fd0

If you don't want to use sudo all the time, or be logged in as root, you can add your
username to the group disk.

Code:
$ sudo adduser larry disk

Larry
 
Larry, keep in mind that setfdprm does not allow you to specify the starting sector id and assumes (from memory) the track to begin at sector 1.
 
Steven,
Good Point, I hadn't run across that yet. I just wanted an emulator to write real TRS-80 Model 3 floppy's
without having my Model 4, or Kryoflux with me this winter. I can't pack all my Computers into the truck
for the Winter months.

Larry
 
Back
Top