Using Z37 floppies on your Linux machine.

42 views
Skip to first unread message

George Farris

unread,
Jan 18, 2012, 2:02:28 PM1/18/12
to se...@googlegroups.com
Using H8/H89 Z37 Soft Sectored Floppies With Linux

Preparing Linux
---------------

I have an H8 with Norberto's Z37 controller and a 3.5 inch 720k floppy
drive. You can use 1.4M drives as long as they will properly detect 720k
disks. I have a 1.4M drive in my Linux machine.

So we start with the drive specs for the Z37 on the H8 using CP/M:

3.5 Inch drive,
80 Tracks,
Double Density,
16 Sectors per Track,
256 Bytes per Sector
Capacity of 620k

Use format under CP/M, chose Double Density and Double Sided and format
a disk.

Now on your Linux machine, what you don't have Linux! Well it's about
time you stepped up to a better operating system don't you think:-)

First we make the device node:

You must choose an unused device number from the Geometry table below, I
chose device 20, it is listed as an 880k, 5.25" drive. I will never have
or use such a drive so I can easily replace the device node.

mknod /dev/fd0z620 b 2 80
^ ^ ^ ^
| | | Minor device number (format number * 4 +
| | | drive + controller*128)
| | Major device number (always 2!)
| Blockdevice
A name that you choose for the format. I
recommend to base the name on the capacity,
but you may choose any name you want.

I chose floppy device fd0 and added a z for z37 and 620 for the
capacity.

So to replace device 20 in the geometry table, I end up with device node
80 for my device. It works out like so (20*4+0+(0*128)) = 80

Then we redefine the geometry of the new device with setfdprm:

setfdprm /dev/fd0z620 sect=16 dd ssize=256 dtr=2 cyl=80

Finally we tell the floppy driver to autodetect the new format when
using just the short version of the Linux floppy device name, /dev/fd0

floppycontrol --autodetect 20,7,8,4

This says, try the z37 620k format first then, 720k,1440k and 2880k

If you want to restore the autodetection to default this is what it is:

floppycontrol --autodetect 7,8,4,25,22,31

Finished! Easy right. You can now happily use your floppy drive, well
at least until the next time you boot, then you will loose all your
changes. To make it permanent see the Boot Time section next.


Boot time
-----------

To make your settings stick you must tell Linux to set this up every
time you boot. Fortunately that is dead simple. Just put the commands
we just configured into your /etc/rc.local file and make sure it's
executable.

Step 1 - Add this to your /etc/rc.local file

mknod /dev/fd0z620 b 2 80
setfdprm /dev/fd0z620 sect=16 dd ssize=256 dtr=2 cyl=80
floppycontrol --autodetect 20,7,8,4

Step 2 - Make sure it's executable

chmod +x /etc/rc.local

Of course you must do all this as "root" or with the sudo command.


Copying images
--------------

You can now copy images of your floppies or make new floppies of an
image stored on your Linux box. What! You don't have Linux!!

Good old dd comes to the rescue here.

Make an image from the floppy:
dd if=/dev/fd0z620 of=<filename>

Copy image to floppy:
dd if=<filename> of=/dev/fd0z620

I use a file name that is descriptive and also has the format in it,
such as: h17-h37-cpm-2.2.04_z37-620k,img


Using the cpmtools package
--------------------------
You can use the cpmtools package to work with floppies under Linux.
Use your package manager and install cpmtools.

Add this to your /etc/cpmtools/diskdefs file

diskdef h37
seclen 256
tracks 80
sectrk 16
blocksize 2048
maxdir 256
boottrk 2
os 2.2
end

Now you can use the CP/M tools software to:

cmpls - list files on CP/M disks
cpmcp - copy files to and from CP/M disks
cpmrm - remove files on CP/M disks
cpmchmod - change file mode on CP/M files
cpmchattr - change file attributes on CP/M files

for example, to list the files on a disk:
cpmls -f h37 /dev/fd0z620

Because we set the autodetect list above you can now just use the base
device and not the full device name, like so:

cpmls -f h37 /dev/fd0

Geometry Table
--------------

This is the original Linux geometry table

1 360KB, 5.25" DD drive
2 1200KB, 5.25" HD drive
3 360KB, 3.5" DD drive
4 720KB, 3.5" DD drive
5 360KB, 5.25" DD disk in HD drive
6 720KB, 5.25" DD disk in HD drive
7 1440KB, 3.5" HD drive
8 2880KB, 3.5" ED drive
9 3120KB, 3.5" ED drive
10 1440KB, 5.25" HD drive
11 1680KB, 3.5" HD drive
12 410KB, 5.25" DD disk in HD drive
13 820KB, 3.5" DD drive
14 1476KB, 5.25" HD drive
15 1722KB, 3.5" HD drive
16 420KB, 5.25" DD disk in HD drive
17 830KB, 3.5" DD drive
18 1494KB, 5.25" HD drive
19 1743KB, 3.5" HD drive
20 880KB, 5.25" DD drive
21 1040KB, 3.5" DD drive
22 1120KB, 3.5" DD drive
23 1600KB, 5.25" HD drive
24 1760KB, 3.5" HD drive
25 1920KB, 3.5" HD drive
26 3200KB, 3.5" ED drive
27 3520KB, 3.5" ED drive
28 3840KB, 3.5" ED drive
29 1840KB, 3.5" HD drive
30 800KB, 3.5" DD drive
31 1600KB, 3.5" HD drive

Cheers everyone and happy imaging!!!

I'll put all this up on my web site when I get a chance.
http://h8trans.cowlug.org

George


Kenneth L. Owen

unread,
Jan 18, 2012, 7:16:21 PM1/18/12
to se...@googlegroups.com
Hi George,

All was going well until:

setfdprm /dev...

This command was not recognized on my Ubuntu 10.4 system.

-- ken

Adrian Stoness

unread,
Jan 18, 2012, 7:28:39 PM1/18/12
to se...@googlegroups.com
maybe cause its ubuntu no offence ment i have found it to be a useles flavour of linux

Mark Garlanger

unread,
Jan 18, 2012, 8:35:39 PM1/18/12
to se...@googlegroups.com
You probably just need to install a package that has that program. Try searching whatever package system ubuntu has. I normally use Fedora and wasn't able to find it either. A google search implied that it may be in a package called fdutils.

Mark

--
You received this message because you are subscribed to the Google Groups "SEBHC" group.
To post to this group, send email to se...@googlegroups.com.
To unsubscribe from this group, send email to sebhc+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sebhc?hl=en.


George Farris

unread,
Jan 18, 2012, 8:49:40 PM1/18/12
to se...@googlegroups.com
On Wed, 2012-01-18 at 19:16 -0500, Kenneth L. Owen wrote:
> Hi George,
>
> All was going well until:
>
> setfdprm /dev...
>

Sorry folks the setfdprm command is in the "fdutils" package.

A simple sudo apt-get install fdutils" will do it Ken.

Cheers
George


Kenneth L. Owen

unread,
Jan 18, 2012, 8:50:45 PM1/18/12
to se...@googlegroups.com
Hi George,

I had to upgrade with floppyutils. Now, setfdprm works.

-- ken


On Wed, 2012-01-18 at 19:16 -0500, Kenneth L. Owen wrote:

Dan Emrick

unread,
Jan 18, 2012, 8:53:33 PM1/18/12
to se...@googlegroups.com
Ken,

I believe Mark is correct.  It seems several flavors of Linux do not include the package in normal installation, but it may be in an "extra" directory or some such.  If you can't find it on your system, I expect you can download it  Try www.fdutils.linux.lu/ or maybe packages.debian.org/sid/fdutils .  You can always check sourceforge or ibiblio.org .

Also, not surprising about not finding  it on Ubuntu. That version seems to be more targeted toward desktop use than "technical tinkering."

Dan

Glenn Roberts

unread,
Jan 27, 2012, 7:11:01 PM1/27/12
to se...@googlegroups.com
So I haven't been able to reproduce this on either of my two linux systems.
One maybe too old, the other too new!?

I have an Ubuntu (11.10) laptop. That's where I tried this first. When I
run setfdprm I get the error "/dev/fd0z620: no such device or address".
The device is there and has the right major and minor device numbers,
permissions etc. the floppy drive works; Ubuntu runs some kind of daemon
that watches the drive and automatically mounts it. When I put in, for
example, a DOS formatted diskette it detects it and pops up a file browser.
Perhaps this is interfering with access to the device? Anyone know how to
temporarily disable it?

I also have a fedora core system running on a Pentium III box. Its plenty
peppy but pretty old (ca. 2005). The problem there is that it has an older
version of setfdprm, one which has very different options. E.g. I don't
even see an option to set sector size (it seems fixed at 512). I suppose I
could update it but am not sure how to do that any more - I've gotten
spoiled by boxes that automatically update themselves. Suppose I could
download a gz file somewhere and manually install.

What I'd really like is to find a decent "plain" linux system that'll run
nicely on my old pIII system but is modern and up to date. I tried
downloading the latest Fedora ISO image but it is apparently now bloatware.

Sorry for the ramble. Any suggestions? What's a good lightweight linux
distro for someone who isn't trying to run all the glitzy desktop stuff?

George: what distro are you running?

Thanks for any help!

- Glenn

Preparing Linux
---------------

floppycontrol --autodetect 20,7,8,4

floppycontrol --autodetect 7,8,4,25,22,31


Boot time
-----------

chmod +x /etc/rc.local


Copying images
--------------

cpmls -f h37 /dev/fd0

Geometry Table
--------------

George


Dan Emrick

unread,
Jan 27, 2012, 8:09:19 PM1/27/12
to se...@googlegroups.com
Hi, Glenn,

I run Slackware on all my Linux boxes.  At install time you have the option not to load X or any of the other unneeded packages. .  Even Slackware, the "hackers Linux" some call it, is starting to come with "bloatware", much to my disappointment (been using it for almost 10 years).  Even the current version (13.37), however, allows you to select your own packages.  Even when running X, I do much of my work from a terminal screen.

Also, there is a Linux Live CD called Slax that gives you the option of a desktop or just a console terminal when it boots.  I'll dig up the URL or maybe provide you with an iso, it you like.

Dan

Dan Emrick

unread,
Jan 27, 2012, 8:15:15 PM1/27/12
to se...@googlegroups.com
Glenn,

Check this out http://www.tuxradar.com/content/whats-best-lightweight-linux-distro . I haven't used them, but the discussions are pretty good.  Also, Slax is at www.slax.org . - Dan

George Farris

unread,
Jan 28, 2012, 12:43:40 PM1/28/12
to se...@googlegroups.com
On Fri, 2012-01-27 at 19:11 -0500, Glenn Roberts wrote:
> What I'd really like is to find a decent "plain" linux system that'll run
> nicely on my old pIII system but is modern and up to date. I tried
> downloading the latest Fedora ISO image but it is apparently now bloatware.
>
> Sorry for the ramble. Any suggestions? What's a good lightweight linux
> distro for someone who isn't trying to run all the glitzy desktop stuff?
>

I'm running various versions of Ubuntu and Debian. The one I figured out
the setfdprm stuff on is a regular GNOME desktop of Ubuntu 10.10. I did
have to down grade Compiz but that was simple and it just concerned
desktop effects.

I would start with Debian and just install the base system. It's a very
nice minimal install but you can add everything you want after the fact
even a full blown desktop.

It's all nicely done with apt-get or aptitude. Debian has good docs on
the site as well and almost every thing documented about Ubuntu that is
not specific to their changes, can be done on Debian since that where
Ubuntu starts from.


Cheers
George


Joe

unread,
Jan 28, 2012, 5:47:42 PM1/28/12
to se...@googlegroups.com
I've been using xubuntu on my ancient laptops. I have it on a P3 450mhz
(512mb ram) and P3 1.2G (1GB ram) laptops. Works very well, as it's a
stripped Ubuntu installation.

-----Original Message-----
From: se...@googlegroups.com [mailto:se...@googlegroups.com] On Behalf Of
George Farris


Cheers
George


Glenn Roberts

unread,
Feb 25, 2012, 11:42:41 AM2/25/12
to se...@googlegroups.com
George: I haven't gotten very far with this. I've loaded Debian.

mknod /dev/fd0z620 b 2 80

works fine but when I try to do:

setfdprm /dev/fd0z620 sect=16 dd ssize=256 dtr=2 cyl=80

I get /dev/fd0z620: No such device or address.

I also looked at the output from dmesg to see if it finds a floppy drive but
I see no evidence of that. the floppy drive is enabled in the BIOS because
previously this machine was able to see and mount the floppy drive (that was
with Ubuntu).

Could it be that the default kernel doesn't have floppy support enabled? Do
I have to build a custom kernel? Should I see a module in the output from
lsmod? (there's nothing that looks like floppy or fd)

Tx.

- glenn

-----Original Message-----
From: se...@googlegroups.com [mailto:se...@googlegroups.com] On Behalf Of
George Farris


Cheers
George


Dan Emrick

unread,
Feb 25, 2012, 9:37:59 PM2/25/12
to se...@googlegroups.com
Glenn,

Not sure about Debian, but Slackware keeps a copy of the configuration for the running kernel in the /boot directory (or wherever the kernel is).  You can check for CONFIG_BLK_DEV_IDEFLOPPY=y (or =m or =n) to see if the kernel already knows about the floppy.  If the parameter is marked =m, the module should have been built and can be loaded if needed.  If it says =n, you'll have to compile the module, or a new kernel if you want to go there.

I'll put Debian back on a VM tomorrow and try to reconstruct what I did to get fdutils working.

Dan

sebhc+unsubscribe@googlegroups.com.

George Farris

unread,
Feb 25, 2012, 9:45:56 PM2/25/12
to se...@googlegroups.com
Hi,

You should be able to do an lsmod and see if you have a floppy driver
loaded. I usually sort it so: lsmod | sort | less

If not try modprobe floppy or insmod floppy

Cheers
George

Glenn Roberts

unread,
Feb 25, 2012, 9:48:25 PM2/25/12
to se...@googlegroups.com

Tx. I’m trying loading it on another old machine I have.  If that fails I may go to slackware…


For more options, visit this group at
http://groups.google.com/group/sebhc?hl=en.

--

You received this message because you are subscribed to the Google Groups "SEBHC" group.

To view this discussion on the web visit https://groups.google.com/d/msg/sebhc/-/sGIfcgnH6nAJ.


To post to this group, send email to se...@googlegroups.com.

To unsubscribe from this group, send email to sebhc+un...@googlegroups.com.

Glenn Roberts

unread,
Feb 25, 2012, 10:20:08 PM2/25/12
to se...@googlegroups.com
I've decided it was some problem with the Dell laptop configuration that I
was using. Perhaps because the drive is swappable? Or because it wasn't
installed at the time I installed the OS (because I had the CD drive
installed in the bay so I could read the install media).

I've switched to another system and so far so good. Will know more
tomorrow.

Thanks!

Glenn Roberts

unread,
Feb 26, 2012, 8:57:40 AM2/26/12
to se...@googlegroups.com
Reinstalling Debian on a different machine did the trick. I've sworn off
laptops for linux for now. thanks.

Too bad the install messed up my Win XP on that box (I want to dual boot).
The windows partition is still there but GRUB doesn't know about it.
another thing to fix...

steve shumaker

unread,
Feb 26, 2012, 10:44:28 AM2/26/12
to se...@googlegroups.com
ya.... laptops and linux - of any flavor - yuk. I have some files
on repairing GRUB if you'd like to browse them (had a similar issue a
while back)


steve

Pat Swayne

unread,
Feb 26, 2012, 4:40:21 PM2/26/12
to se...@googlegroups.com
I have Fedora 15 running on a Dell (5160, I think) notebook. This
particular model has a replaceable video card, and I found an Nvidia
card for it on Ebay. Fedora runs with that one, but not with the weird
one that came in it.
-- Pat
Reply all
Reply to author
Forward
0 new messages