{"id":116,"date":"2009-12-19T22:06:17","date_gmt":"2009-12-19T20:06:17","guid":{"rendered":"http:\/\/lallafa.de\/blog\/?page_id=116"},"modified":"2013-08-03T16:07:20","modified_gmt":"2013-08-03T14:07:20","slug":"opencbm-on-mac","status":"publish","type":"page","link":"https:\/\/lallafa.de\/blog\/c64-projects\/opencbm-on-mac\/","title":{"rendered":"OpenCBM on Mac"},"content":{"rendered":"<h3>1. Introduction<\/h3>\n<p><a href=\"http:\/\/sourceforge.net\/projects\/opencbm\/\">OpenCBM<\/a> 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).<\/p>\n<p>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.<\/p>\n<h3>2. Software Installation<\/h3>\n<h4><strong><\/strong>2.1 Install with MacPorts<\/h4>\n<ul>\n<li>First you need to setup <strong>MacPorts<\/strong> (if you haven&#8217;t already installed it on your machine). <a href=\"http:\/\/www.macports.org\/install.php\">Download<\/a> and follow the <a href=\"http:\/\/www.macports.org\/install.php\">Installation instructions<\/a> there. Follow all steps there exactly and also install the XCode Development Environment &#8211; otherwise your build will fail!<\/li>\n<li>Open Terminal.app and change to a new directory:<\/li>\n<\/ul>\n<pre><code>&gt; mkdir opencbm\r\n&gt; cd opencbm<\/code><\/pre>\n<ul>\n<li>Download one of these Portsfiles into this directory:\n<ul>\n<li>The <a href=\"https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-git\">Portfile building the most recent OpenCBM Git Repository<\/a>\n<ul>\n<li>Use this only if you want a very bleeding edge, experimental version<\/li>\n<li>This version is not necessarily stable!<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>&gt; curl -o Portfile https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-git<\/code><\/pre>\n<ul>\n<li>The <a href=\"https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-v2\">Portsfile of the ZoomFloppy v2.0 Release (31.12.2011)<\/a>\n<ul>\n<li>Use this version for a ZoomFloppy board Firmware v7<\/li>\n<li>Stable Version for OpenCBM ZoomFloppy Release v2.0<\/li>\n<li>[Update 3.8.2013: Fixed libusb-legacy dependency]<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>&gt; curl -o Portfile https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-v2<\/code><\/pre>\n<ul>\n<li>The <a href=\"https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-v1\">Portsfile of the ZoomFloppy v1.0 Release (30.1.2011<\/a>\n<ul>\n<li>Use this version for a ZoomFloppy board with Firmware v6<\/li>\n<li>Stable Version for OpenCBM ZoomFloppy Release v1.0<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code>&gt; curl -o Portfile https:\/\/www.lallafa.de\/files\/opencbm\/Portfile-v1<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>Check the downloaded Portfile: (The latest release may vary!)<\/li>\n<\/ul>\n<pre>&gt; md5 Portfile\r\nMD5 (Portfile) = fc3ffb1466b4f3b3236dfe430c36340e  &lt;-- ZoomFloppy Release 2.0 on 31.12.2011\r\nMD5 (Portfile) = ff721a10aee0de1c2303ba979b893267  &lt;-- ZoomFloppy Release 1.0 on 1.7.2011\r\nMD5 (Portfile) = 90fa77d1cedc98b19b00db50e3bbede4\u00c2\u00a0 &lt;-- current Git<\/pre>\n<ul>\n<li>Make\u00c2\u00a0 sure the checksum is correct.<\/li>\n<li>Now call MacPorts&#8217; port command to install OpenCBM: When asked for a password enter your user&#8217;s password<\/li>\n<\/ul>\n<pre><code>&gt; sudo port install\r\nPassword:\r\n---&gt;\u00c2\u00a0 Computing dependencies for opencbm\r\n---&gt;\u00c2\u00a0 Fetching opencbm\r\n---&gt;\u00c2\u00a0 Verifying checksum(s) for opencbm\r\n---&gt;\u00c2\u00a0 Extracting opencbm\r\n---&gt;\u00c2\u00a0 Configuring opencbm\r\n---&gt;\u00c2\u00a0 Building opencbm\r\n---&gt;\u00c2\u00a0 Staging opencbm into destroot\r\n---&gt;\u00c2\u00a0 Installing opencbm @0.4.99_20110130\r\n---&gt;\u00c2\u00a0 Activating opencbm @0.4.99_20110130\r\n---&gt;\u00c2\u00a0 Cleaning opencbm<\/code><\/pre>\n<ul>\n<li>That&#8217;s it! OpenCBM is now installed on your machine!<\/li>\n<li>Have a look at the tools installed:<\/li>\n<\/ul>\n<pre><code>&gt; ls -1 \/opt\/local\/bin\/cbm*\r\n\/opt\/local\/bin\/cbmcopy*\r\n\/opt\/local\/bin\/cbmctrl*\r\n\/opt\/local\/bin\/cbmformat*\r\n\/opt\/local\/bin\/cbmforng*\r\n\/opt\/local\/bin\/cbmread@\r\n\/opt\/local\/bin\/cbmrpm41*\r\n\/opt\/local\/bin\/cbmwrite@<\/code><\/pre>\n<h4>2.2 Update<\/h4>\n<p>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):<\/p>\n<pre>&gt; sudo port uninstall opencbm\r\n&gt; sudo port install<\/pre>\n<h4>2.3 Configuration<\/h4>\n<p>After installation you need to configure OpenCBM. The most important file is <strong>\/opt\/local\/etc\/opencbm.conf<\/strong>. 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:<\/p>\n<pre><code>&gt; sudo pico <strong>\/opt\/local\/etc\/opencbm.conf<\/strong>\r\ndefault=xum1541<\/code><\/pre>\n<ul>\n<li>Press &#8220;Ctrl+X&#8221; &#8220;Y&#8221; &#8220;Enter&#8221; to leave the editor and write the file<\/li>\n<li>That&#8217;s it. Your device is now configured!<\/li>\n<\/ul>\n<h3>3. Hardware Setup<\/h3>\n<h4>3.1 ZoomFloppy Device<\/h4>\n<ul>\n<li>Your purchased <a href=\"http:\/\/store.go4retro.com\/products\/ZoomFloppy.html\">ZoomFloppy device<\/a> is shipped fully setup. Nothing needs to be done here.<\/li>\n<li>Have a look at the ZoomFloppy User&#8217;s Guide for information how to connect the devices and your Mac.<\/li>\n<li>Don&#8217;t forget to directly attach the ZoomFloppy to your Mac. Do _not_ use a Hub in between!<\/li>\n<\/ul>\n<h4>ZoomFloppy Firmware Update<\/h4>\n<ul>\n<li>If OpenCBM complains about a too old firmware then you can <strong>update the firmware <\/strong>with Nate&#8217;s firmware update tool<\/li>\n<li>Download the source code from <a href=\"http:\/\/www.root.org\/~nate\/c64\/xum1541\/\">Nate&#8217;s xum1541 Page<br \/>\n<\/a><\/li>\n<li>Untar the source and enter the directory<\/li>\n<li>Compile the source with:<\/li>\n<\/ul>\n<pre>&gt; make -f LINUX\/Makefile<\/pre>\n<ul>\n<li>The tool <strong>xum1541cfg<\/strong> is created in the current directory<\/li>\n<li>Now download the XUM1541 prebuild firmware from <a title=\"OpenCBM's Git Repository\" href=\"http:\/\/opencbm.git.sourceforge.net\/git\/gitweb.cgi?p=opencbm\/opencbm;a=tree;f=xum1541;h=a652b10e25378b179bfa92b8605e163ccf1e10e7;hb=HEAD\">OpenCBM&#8217;s Git Repository<\/a>. Pick a *.hex file suitable for the ZoomFloppy (e.g. <strong>xum1541-ZOOMFLOPPY-v06.hex<\/strong>).<\/li>\n<li>Update the firmware with this command (after attaching the device of cource):<\/li>\n<\/ul>\n<pre>&gt; .\/xum1541cfg update xum1541-ZOOMFLOPPY-v06.hex<\/pre>\n<h4>3.2 Other Hardware for the XUM151 Firmware<\/h4>\n<ul>\n<li>Nate Lawson&#8217;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.<\/li>\n<li>See the <a href=\"http:\/\/www.root.org\/~nate\/c64\/xum1541\/\">XUM1541 Homepage<\/a> for details on how to build the HW.<\/li>\n<li>It works well with Macs and I use one myself built from a USBkey development board available from Atmel.<\/li>\n<li>If you built the HW you need to flash the firmware.\n<ul>\n<li>You can use the <strong>dfu-programmer<\/strong> on your Mac to do so. Just install the dfu-programmer package from MacPorts:<\/li>\n<\/ul>\n<pre><code>&gt; sudo \/opt\/local\/bin\/port install dfu-programmer<\/code><\/pre>\n<ul>\n<li>Now download the XUM1541 prebuild firmware from <a title=\"OpenCBM's Git Repository\" href=\"http:\/\/opencbm.git.sourceforge.net\/git\/gitweb.cgi?p=opencbm\/opencbm;a=tree;f=xum1541;h=a652b10e25378b179bfa92b8605e163ccf1e10e7;hb=HEAD\">OpenCBM&#8217;s Git Repository<\/a>. Pick a *.hex file (e.g.\u00c2\u00a0<strong>xum1541-AT90USBKEY-v02.hex<\/strong>).<\/li>\n<\/ul>\n<ul>\n<li>Enable the bootloader mode on your device by resetting it while holding the user button. Now you can flash the firmware with dfu-programmer:<\/li>\n<\/ul>\n<pre><code>&gt; dfu-programmer AT90USB1287 erase\r\n&gt; dfu-programmer AT90USB1287 flash xum1541-&lt;yourdevice&gt;-&lt;version&gt;.hex<\/code><\/pre>\n<ul>\n<li>That&#8217;s it. Reset your device again and the new firmware should be up and running.<\/li>\n<\/ul>\n<p>Here is a snapshot of my XUM1541 Adapter:<\/p>\n<p><div id=\"attachment_125\" style=\"width: 330px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-125\" data-attachment-id=\"125\" data-permalink=\"https:\/\/lallafa.de\/blog\/c64-projects\/opencbm-on-mac\/xum1541\/\" data-orig-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?fit=320%2C219&amp;ssl=1\" data-orig-size=\"320,219\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"XUM1541\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Lallafa&amp;#8217;s XUM1541 Prototype&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?fit=300%2C205&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?fit=320%2C219&amp;ssl=1\" class=\"size-full wp-image-125\" title=\"XUM1541\" alt=\"\" src=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?resize=320%2C219\" width=\"320\" height=\"219\" srcset=\"https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?w=320&amp;ssl=1 320w, https:\/\/i0.wp.com\/lallafa.de\/blog\/wp-content\/uploads\/2009\/12\/XUM1541.jpg?resize=300%2C205&amp;ssl=1 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><p id=\"caption-attachment-125\" class=\"wp-caption-text\">Lallafa&#8217;s XUM1541 Prototype<\/p><\/div><\/li>\n<\/ul>\n<h4>3.3 XU1541 Hardware<\/h4>\n<ul>\n<li>The <strong>XU1541 firmware and hardware <\/strong>was developed by Till Harbaum. He discontinued the project but Spiro Trikaliotis kept the information on the web. See his <a href=\"http:\/\/www.trikaliotis.net\/xu1541\">XU1541 Page<\/a> for details. There you can find schematics to build your own device.<\/li>\n<\/ul>\n<h3>4. Running OpenCBM<\/h3>\n<p>Hook up your trusty 1541 or 1571 drive to your USB adapter and connect the adapter to your Mac. Now let&#8217;s check if the device was detected by OpenCBM:<\/p>\n<pre><code>&gt; cbmctrl detect\r\n8: 1571 (XP1541)<\/code><\/pre>\n<p>Ah! My 1571 was detected (even with parallel interface hence the P in XP). Let&#8217;s look at the drive status:<\/p>\n<pre><code>&gt; cbmctrl status 8\r\n00, ok,00,00<\/code><\/pre>\n<p>Fine, everything looks good! Let&#8217;s have a look at the contents of a disk:<\/p>\n<pre><code>&gt; cbmctrl dir 8\r\n0 .\"test\/demo\u00c2\u00a0 1\/85 \" 84 2a\r\n14\u00c2\u00a0\u00c2\u00a0 \"how to use\"\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 prg\r\n8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \"how part two\"\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 prg\r\n7\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \"how part three\"\u00c2\u00a0\u00c2\u00a0 prg\r\n...\r\n8\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \"load address\"\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 prg\r\n7\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \"unscratch\"\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 prg\r\n5\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 \"header change\"\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 prg\r\n402 blocks free.\r\n00, ok,00,00<\/code><\/pre>\n<p>You can copy files from the disk to your Mac with:<\/p>\n<pre><code>&gt; cbmread 8 \"how to use\"\r\n[Info] reading HOW TO USE -&gt; how to use.prg\r\n[Info] identified a 1571 drive\r\n....\/[Info] 00, OK,00,00<\/code><\/pre>\n<p>You can copy the whole disk as an image to a D64 image file with:<\/p>\n<pre><code>&gt; d64copy 8 disk.d64\r\n[Warning] growing image file to 683 blocks\r\n1: *********************\r\n2: *********************\r\n3: *********************\r\n...\r\n33: *****************\r\n34: *****************\r\n35: *****************\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0\u00c2\u00a0 100%\u00c2\u00a0\u00c2\u00a0 683\/683\r\n683 blocks copied.<\/code><\/pre>\n<p>The other way round: Copy an existing disk image onto a real disk:<\/p>\n<pre><code>&gt; d64copy myimage.d64 8<\/code><\/pre>\n<p>So these are the most useful commands at a short glance. If you want to explore more of OpenCBM&#8217;s tools then you can call each cbm* binary with the &#8211;help switch to get more information on options and usage.<\/p>\n<pre><code>&gt; cbmctrl --help<\/code><\/pre>\n<p>Furthermore,\u00c2\u00a0 all commands have man pages with detailed descriptions. You call man:<\/p>\n<pre><code>&gt; man cbmctrl<\/code><\/pre>\n<p>Now enjoy OpenCBM on your Mac!<\/p>\n<h3>5. Page Updates<\/h3>\n<ul>\n<li>6.12.2012 &#8211; Updated sf.net git repository address in Portfile-v2 and Portfile in repository<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction 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 &hellip; <a href=\"https:\/\/lallafa.de\/blog\/c64-projects\/opencbm-on-mac\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":475,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"ngg_post_thumbnail":0,"jetpack_post_was_ever_published":false,"footnotes":""},"class_list":["post-116","page","type-page","status-publish","hentry"],"jetpack_shortlink":"https:\/\/wp.me\/PiBMF-1S","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/pages\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/comments?post=116"}],"version-history":[{"count":30,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/pages\/116\/revisions"}],"predecessor-version":[{"id":729,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/pages\/116\/revisions\/729"}],"up":[{"embeddable":true,"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/pages\/475"}],"wp:attachment":[{"href":"https:\/\/lallafa.de\/blog\/wp-json\/wp\/v2\/media?parent=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}