OpenCBM is a library and a set of command line tools that allow to control old Commodore IEC devices like the famous 1541 floppy disk drive with modern computers. You can transfer disk image to and from old discs. As modern computers do not provide a IEC connector, OpenCBM allows to control adapters that attach to your PC. Older PCs use parallel port cables (like the XA1541 or XS1541) and newer ones use an USB adapter (XU1541 or XUM1541).
This pages shows you how to use OpenCBM on your Mac. As modern Macs only support USB connectors and no parallel ones, we focus on setting up the XU1541 or XUM1541 devices including the new ZoomFloppy hardware.
2. Software Installation
2.1 Install with MacPorts
- First you need to setup MacPorts (if you haven’t already installed it on your machine). Download and follow the Installation instructions there. Follow all steps there exactly and also install the XCode Development Environment – otherwise your build will fail!
- Open Terminal.app and change to a new directory:
> mkdir opencbm > cd opencbm
- Download one of these Portsfiles into this directory:
- The Portfile building the most recent OpenCBM Git Repository
- Use this only if you want a very bleeding edge, experimental version
- This version is not necessarily stable!
> curl -o Portfile http://www.lallafa.de/files/opencbm/Portfile-git
- The Portsfile of the ZoomFloppy v2.0 Release (31.12.2011)
- Use this version for a ZoomFloppy board Firmware v7
- Stable Version for OpenCBM ZoomFloppy Release v2.0
- [Update 3.8.2013: Fixed libusb-legacy dependency]
> curl -o Portfile http://www.lallafa.de/files/opencbm/Portfile-v2
- The Portsfile of the ZoomFloppy v1.0 Release (30.1.2011
- Use this version for a ZoomFloppy board with Firmware v6
- Stable Version for OpenCBM ZoomFloppy Release v1.0
> curl -o Portfile http://www.lallafa.de/files/opencbm/Portfile-v1
- The Portfile building the most recent OpenCBM Git Repository
- Check the downloaded Portfile: (The latest release may vary!)
> md5 Portfile MD5 (Portfile) = fc3ffb1466b4f3b3236dfe430c36340e <-- ZoomFloppy Release 2.0 on 31.12.2011 MD5 (Portfile) = ff721a10aee0de1c2303ba979b893267 <-- ZoomFloppy Release 1.0 on 1.7.2011 MD5 (Portfile) = 90fa77d1cedc98b19b00db50e3bbede4 <-- current Git
- Make sure the checksum is correct.
- Now call MacPorts’ port command to install OpenCBM: When asked for a password enter your user’s password
> sudo port install Password: ---> Computing dependencies for opencbm ---> Fetching opencbm ---> Verifying checksum(s) for opencbm ---> Extracting opencbm ---> Configuring opencbm ---> Building opencbm ---> Staging opencbm into destroot ---> Installing opencbm @0.4.99_20110130 ---> Activating opencbm @0.4.99_20110130 ---> Cleaning opencbm
- That’s it! OpenCBM is now installed on your machine!
- Have a look at the tools installed:
> ls -1 /opt/local/bin/cbm* /opt/local/bin/cbmcopy* /opt/local/bin/cbmctrl* /opt/local/bin/cbmformat* /opt/local/bin/cbmforng* /opt/local/bin/cbmread@ /opt/local/bin/cbmrpm41* /opt/local/bin/cbmwrite@
If you want to update your port then get an updated Portfile (see above) and issue the following commands (from the directory containing the Portfile):
> sudo port uninstall opencbm > sudo port install
After installation you need to configure OpenCBM. The most important file is /opt/local/etc/opencbm.conf. There you only need to set up the HW adapter you will use. For a XU151 you can leave the file as it is. For a ZoomFloppy or another XUM1541 HW device set xum1541 here:
> sudo pico /opt/local/etc/opencbm.conf default=xum1541
- Press “Ctrl+X” “Y” “Enter” to leave the editor and write the file
- That’s it. Your device is now configured!
3. Hardware Setup
3.1 ZoomFloppy Device
- Your purchased ZoomFloppy device is shipped fully setup. Nothing needs to be done here.
- Have a look at the ZoomFloppy User’s Guide for information how to connect the devices and your Mac.
- Don’t forget to directly attach the ZoomFloppy to your Mac. Do _not_ use a Hub in between!
ZoomFloppy Firmware Update
- If OpenCBM complains about a too old firmware then you can update the firmware with Nate’s firmware update tool
- Download the source code from Nate’s xum1541 Page
- Untar the source and enter the directory
- Compile the source with:
> make -f LINUX/Makefile
- The tool xum1541cfg is created in the current directory
- Now download the XUM1541 prebuild firmware from OpenCBM’s Git Repository. Pick a *.hex file suitable for the ZoomFloppy (e.g. xum1541-ZOOMFLOPPY-v06.hex).
- Update the firmware with this command (after attaching the device of cource):
> ./xum1541cfg update xum1541-ZOOMFLOPPY-v06.hex
3.2 Other Hardware for the XUM151 Firmware
- Nate Lawson’s Firmware supports different hardware implementations. Currently only the ZoomFloppy is commercially available (see above). All others are more or less prototype setups. In this case you need to build the hardware yourself.
- See the XUM1541 Homepage for details on how to build the HW.
- It works well with Macs and I use one myself built from a USBkey development board available from Atmel.
- If you built the HW you need to flash the firmware.
- You can use the dfu-programmer on your Mac to do so. Just install the dfu-programmer package from MacPorts:
> sudo /opt/local/bin/port install dfu-programmer
- Now download the XUM1541 prebuild firmware from OpenCBM’s Git Repository. Pick a *.hex file (e.g. xum1541-AT90USBKEY-v02.hex).
- Enable the bootloader mode on your device by resetting it while holding the user button. Now you can flash the firmware with dfu-programmer:
> dfu-programmer AT90USB1287 erase > dfu-programmer AT90USB1287 flash xum1541-<yourdevice>-<version>.hex
- That’s it. Reset your device again and the new firmware should be up and running.
Here is a snapshot of my XUM1541 Adapter:
3.3 XU1541 Hardware
- The XU1541 firmware and hardware was developed by Till Harbaum. He discontinued the project but Spiro Trikaliotis kept the information on the web. See his XU1541 Page for details. There you can find schematics to build your own device.
4. Running OpenCBM
Hook up your trusty 1541 or 1571 drive to your USB adapter and connect the adapter to your Mac. Now let’s check if the device was detected by OpenCBM:
> cbmctrl detect 8: 1571 (XP1541)
Ah! My 1571 was detected (even with parallel interface hence the P in XP). Let’s look at the drive status:
> cbmctrl status 8 00, ok,00,00
Fine, everything looks good! Let’s have a look at the contents of a disk:
> cbmctrl dir 8 0 ."test/demo 1/85 " 84 2a 14 "how to use" prg 8 "how part two" prg 7 "how part three" prg ... 8 "load address" prg 7 "unscratch" prg 5 "header change" prg 402 blocks free. 00, ok,00,00
You can copy files from the disk to your Mac with:
> cbmread 8 "how to use" [Info] reading HOW TO USE -> how to use.prg [Info] identified a 1571 drive ..../[Info] 00, OK,00,00
You can copy the whole disk as an image to a D64 image file with:
> d64copy 8 disk.d64 [Warning] growing image file to 683 blocks 1: ********************* 2: ********************* 3: ********************* ... 33: ***************** 34: ***************** 35: ***************** 100% 683/683 683 blocks copied.
The other way round: Copy an existing disk image onto a real disk:
> d64copy myimage.d64 8
So these are the most useful commands at a short glance. If you want to explore more of OpenCBM’s tools then you can call each cbm* binary with the –help switch to get more information on options and usage.
> cbmctrl --help
Furthermore, all commands have man pages with detailed descriptions. You call man:
> man cbmctrl
Now enjoy OpenCBM on your Mac!
5. Page Updates
- 6.12.2012 – Updated sf.net git repository address in Portfile-v2 and Portfile in repository