HANDLING MACINTOSH FLOPPY DISK IMAGES ON LINUX
----------------------------------------------
So you've used a Kryoflux or similar tool to create disk images of
your Macintosh floppies. Now what? How can you actually use these
images in a Macintosh emulator on your computer? Unfortunately it
isn't as simple as you might hope. Basilisk II, the Macintosh emulator
I'm most familiar with, isn't able to mount floppy images. However, it
can read files from a transfer folder that you setup on your
system. If you can get the files off the disk image and into this
folder without corrupting them, you can then use them in Basilisk II.

The first step is to determine what type of disk image you have. There
are three types of Macintosh disk, all 3.5" in size: 400K, 800K, and
1.44MB. If your image is 400KB in size, then it is in the MFS
format. I'm not aware of any modern tools that allow for reading these
disks. You will likely need a classic Macintosh to read the files off
of the original disk. If I ever get a chance to try this, I will
update this guide.

800KB images are easier to handle. These use the newer HFS format and
are readable by a number of modern tools. Although most PC floppy
drive controllers can't read these disks, once converted to a disk
image the low level format is irrelevant. Two Linux tools for reading
HFS images are hfsutils and hfsplus. At the time of writing, I have
only tested hfsutils, so that is what I'll be discussing here. 1.44MB
HFS images are also readable by these utlities.

HFSUTILS
--------
hfsutils should be available as a package on most Linux
distributions. You can also download the tools from the hfsutils web
site at: https://www.mars.org/home/rob/proj/hfs/.

Once installed, you can mount an image with the hmount command. Here's
an example:

---
bash$ hmount citadel_adventure_of_the_crystal_keep_disk2.img
Volume name is "Citadel Data"
Volume was created on Tue Nov 13 11:59:00 1990
Volume was last modified on Thu Feb 17 18:36:07 2022
Volume has 72192 bytes free
---

hmount may not operate in the way that you expect. You might have
noticed that the hmount command above is missing any kind of mount
point. This is because there isn't one! The disk image isn't visible
through your filesystem and is only accesible via the hfsutils, which
include programs like hls, hcd, hcopy, and so on. So to view the
contents of the image you just mounted, just run hls:

---
bash$ hls
Citadel Data
---

In this case there is only one file on the disk, so lets mount another
image to give another example. But first we need to unmount the
current image:

---
bash$ humount citadel_adventure_of_the_crystal_keep_disk2.img
---

Then we can mount a new image and get a new listing:

---
bash$ hmount citadel_adventure_of_the_crystal_keep_disk1.img
Volume name is "Citadel System"
Volume was created on Mon Nov 12 14:56:31 1990
Volume was last modified on Thu Feb 17 18:31:23 2022
Volume has 8704 bytes free
bash$ hls -l
f  APPL/Dave    303070         0 Nov 12  1990 Citadel
f  GMan/Dave     60954         0 Sep 11  1990 Citadel Help
f  GMap/Dave     11314         0 Sep 11  1990 Citadel Map
f  GDat/Dave     50701     32400 Sep 11  1990 Citadel Save
d          3 items               Nov 12  1990 System Folder
---

So now that we have a disk image mounted, we can finally copy the
image's files to our Basilisk transfer directory. To do that we'll use
the hcopy command with the '-m' flag. '-m' will copy the file in the
MacBinary II format, which will preserve both the Resource and Data
forks of the file. Without this option, you'll only get the Data fork.

---
bash$ hcopy -m "Citadel Save" ~/mac_files/basilisk/transfer/Citadel2/
---

After copying all the files from both disk images, here is what my
Citadel2 directory contains:

---
$ ls -l ~/mac_files/basilisk/transfer/Citadel2
total 1176
-rw-rw-r--  1 jonathan jonathan 303232 Feb 17 18:33 Citadel.bin
-rw-rw-r--  1 jonathan jonathan 724864 Feb 17 18:36 Citadel_Data.bin
-rw-rw-r--  1 jonathan jonathan  61184 Feb 17 18:34 Citadel_Help.bin
-rw-rw-r--  1 jonathan jonathan  11520 Feb 17 18:34 Citadel_Map.bin
-rw-rw-r--  1 jonathan jonathan  83456 Feb 17 18:34 Citadel_Save.bin
---

When hcopy copies a file it adds an appropriate extension. Now, after
loading up Basilisk II and opening the transfer/Citadel2 folder I was
initially dismayed to see that the various .bin files did not have
icons, possibly indicating that the resource fork was
missing. However, when I double-clicked each file it produced a new
file with an icon. I am fairly inexperienced with MacOS, but I presume
that my emulated system has a MacBinary II extractor built-in. I am
running System 7.5.3. You may need to acquire a MacBinary tool if your
system doesn't already support these files.

Following this process, I was able to get all the necessary files for
Citadel copied from the two 800KB disk images and into my virtual
hard drive for Basilisk II. This process would certainly be easier in
an emulator that can natively mount HFS disk images, but it is still
doable without that feature.