magazine logo
Welcome to the official Attitude website - Europe's #1 C64 scene disk magazine
Booting Up XU1541
by DJ Gruby/Oxyron

So, now you have got your own XU1541 device, which costed you either some effort to built or some money to buy. You are so happy, as you may finally connect your old good 1541-II disk drive with your modern desktop/notebook equipped only with USB ports, but still you do not know where to start. This article is expected to be the right starting point for you, as it is going to provide you with all the necessary details about seamless booting up of your XU1541 interface.

Everything you read in this article is based on the contents of Spiro Trikaliotis website [1] and the personal experience of its author. So, the very first thing to do is to point your browser to Spiro's home on the web and browse through the guidelines provided by him and Till Harbaum, another person who had started the whole XU1541 project.

Still, if do not want to read through all of those comprehensive instructions, and you are just eager to see the things working, read on. I am not going to repeat all of the information that is easily accessible via XU1541 website, like what the XU1541 is, where you can send your questions concerning the device, or discuss the implementation details. If you have already built/bought your device, most likely you had already went though all of this. So let us just cut to the chase.

SOFTWARE DOWNLOAD

First thing to do is to download an appropriate software that is going to support your XU1541 device. The XU1541 cable is supported by OpenCBM [2]. It is recommended to get the latest version, which can be found in the OpenCBM CVS. According to the instructions provided on the SourceForge OpenCBM CVS "about" page, you should begin with the following instruction set:

$ cvs -d:pserver:anonymous@opencbm.cvs.sourceforge.net:/cvsroot/opencbm login


When prompted for a password for anonymous user, just press the ENTER key.

$ cvs -z3 -d:pserver:anonymous@opencbm.cvs.sourceforge.net:/cvsroot/opencbm co -P .


This will download all the latest sources from OpenCBM CVS repository to your local hard disk drive. Notice that specifying project name as "." causes all the projects available in the repository to be downloaded to your computer (this is very convenient since you may download OpenCBM source code as well as XU1541 drivers at once).

Please note that you need to have CVS installed (obviously). If you however do not, precompiled CVS binaries are available for most distributions from their respective repositories. For example if you are using Fedora/RedHat based Linux, simply run the following command:

# yum install cvs


You might also need subversion client later, so do not hesitate to invoke this command by the way:

# yum install subversion


Software downloaded? Let us move on to...

PREREQUISITES

During XU1541 installation process you might get into variety of troubles, which I try to predict and suggest possible resolution within this section.

The first thing (a warning preventing you from even beginning with the installation process) to be most possibly encountered is this: "You must have linuxdoc or sgmltools installed". It is caused by the fact that "which" command is unable to find neither "linuxdoc" nor "sgml2txt" in your search $PATH. The same comment goes for presumably missing "makeinfo" command and an accompanying error message: "fmt_info::postASP: Failed to run makeinfo. Aborting..." These both problems can be easily fixed by issuing the following command:

# yum install linuxdoc-tools texinfo


Be patient and prepare for the download process to take a moment. Current version, including all dependencies, has got the size of 63 Mbytes, so it may take a little while before completion, it did at least on my network.

During OpenCBM compilation you might get into trouble of missing specific header files, as for example:

./dynlibusb.h:24:17: fatal error: usb.h: No such file or directory


This can be easily worked around by downloading and installing development package for USB library:

# yum install libusb-devel


Then you might also get into trouble of missing tools which are required to build the application, as for example:

make[1]: cl65: Command not found


This is an information that "cc65", a freeware C compiler for 6502 based systems [3], is not available on your system. Do not worry, the resolution is going to be, well maybe not as simple as in the previous cases, but still very straight-forward (checking out the current development version is highly recommended way of getting the latest source code):

$ svn checkout svn://svn.cc65.org/cc65/trunk cc65
$ cd cc65
$ make -f make/gcc.mak
# make -f make/gcc.mak install


One last thing to accomplish before we proceed to the most exciting part of this article is getting kernel source. In order to compile plugin support, you have to download and install the kernel source package. The installator looks for kernel sources and when it is unable to locate them, it complains:

No KERNEL_SOURCE found, aborting!
make[1]: *** [checksources] Error 1


Nothing you can do about it, so just go ahead and get the kernel source...

# yum install kernel-devel


This way we get the kernel source tree properly configured, which enables us to build OpenCBM modules, including XU1541 plugin. Yup, this is it! Simply, we need kernel development package installed on our system first.

I believe this exhausts the list of possible troubles you would get into when not considering prerequisites but going straight to the installation process instead.

INSTALLING OPENCBM

Now we are ready to look into gory details of compiling and installing OpenCBM on our machine. The first thing to look into is chapter 4.1 of OpenCBM documentation entitled "Installing OpenCBM on Linux". Well, actually this is half truth. The documentation is not up to date, it is alright for older cable types. The most important difference is that for the XU1541, you do not insmod (or modprobe) the CBM driver since it is not necessary. The original driver is only needed for the XA1541 and XM1541 cables.

The compile-time configuration is located in "cbm4win/LINUX/config.make" file. Make sure to check it first and feel free to modify it according to your personal preferences. Eventually, enter OpenCBM's "cbm4win" directory and issue the following "make" command:

# make -f LINUX/Makefile install install-plugin-xu1541


This will first compile the core, then plugins, and documentation in the end. Upon successful compilation process, files will be installed into /usr/local directory (see "config.make" for details about destination directories, like "bin" and "lib", feel free to modify them according to your specific needs).

Alright, no problems here? That is great! You might want to have a look at the configuration file for your newly installed program:

$ cat /etc/opencbm.conf
; This is a GENERATED FILE! - DO NOT EDIT!
; Modify the files in /etc/opencbm.conf.d instead,
; and execute '/home/djgruby/Tools/OpenCBM-CVS/cbm4win/lib/plugin/xu1541/plugin_helper_tools rebuild'...

[plugins]
default=xu1541

[xu1541]
location=/usr/local/lib/opencbm/plugin/libopencbm-xu1541.so


Now there is only one little drawback to be discussed left. Upon trying to perform any "cbmctrl" command, you might get into this error message:

warning: cannot query product name for device: error sending control message: Operation not permitted
Error: Found xu1541 in unexpected state, please make sure device is _not_ in bootloader mode!
ERROR: No xu1541 device found
cbmctrl: libusb/xu1541: Operation not permitted


ACCESSING XU1541 DEVICE AS A REGULAR USER

Do not panic though, with the help of Spiro Trikaliotis, I have figured out how to make it work without the need of performing all of the operations while being logged in as a "root" user only. In order to able to access your XU1541 device as a regular user, try to follow these steps:

1. Remove the XU1541 device

2. Perform the following command on your PC:

# ls -R -l /dev >/tmp/before


3. Insert the XU1541 again and wait until it is recognized by the system

4. Perform the following commands on your PC:

# ls -R -l /dev >/tmp/after
# diff -u /tmp/before /tmp/after


You should now see the difference between those two files as containing a line with the detected device, in my case it has been:

/dev/bus/usb/007


The last remaining thing to do is changing mode of this newly recognized device:

# chmod o+w /dev/bus/usb/007/017


Voila, you no longer need to log in as root to access your XU1541 device. The only thing left to say is... Well done, you have made it!

TIME TO GET FUN

Hurray! It was not that hard, was it? With a very little guidance you have managed to successfully and single-handedly configure and install OpenCBM with embedded support for your brand new XU1541 cable. This section is supposed to serve as a quick start guide on how to use it.

Connect your XU1541. Turn on the disk drive. You might want to look into /var/log/messages to make sure that a new USB (!) device has been detected successfully. Let us try out some simple commands, for example:

$ cbmctrl detect


This one is going to detect all drives, reassuring you that XU1541 device has been found. All further examples assume that connected disk drive's device number is 8.

Reset the drive (can you hear the engine spinning?):

$ cbmctrl reset 8


Print out command/status channel to the standard output:

$ cbmctrl status 8


Read directory from disk and print it out to the standard output:

$ cbmctrl dir 8


More examples to be explored can be found on chapter "7.2 cbmctrl" of OpenCBM documentation.

Let us try something more sophisticated. "d64copy" is a disk image transfer (both read and write) program that comes bundled with OpenCBM package. You may use it to copy D64 images from/to your 1541 disk drive. And again, look for the details on usage options into OpenCBM documentation (chapter "7.5 d64copy"), I am just going to give you a few most basic examples.

Try this command to read a D64 disk image from the floppy in drive 8 into the file named "image.d64" ("-v" switch is for verbose output):

$ d64copy -v 8 image.d64


To copy the D64 disk image from "image.d64" file into the floppy in drive 8, type in the following command:

$ d64copy -v image.d64 8


It concludes this article. I hope that you may now consider yourself an expert in configuring and installing XU1541 cable in your Linux environment. So, I guess this is about time to transfer some disks, right?

Happy hacking!

DJ GRUBY/OXYRON

References:

[1] The official XU1541 website http://www.trikaliotis.net/xu1541/
[2] OpenCBM User's Guide http://opencbm.trikaliotis.net/
[3] The 6502 C compiler (cc65) http://www.cc65.org/

   Add/view comments on this article (comments: 0)

SCENE GROUPS
 
OPINION POLL
Do you believe we are
able to cope with
releasing "Attitude"
on a regular basis?

yes no

 YES: 283 (70.75%)
NO:117 (29.25%) 

NEWS COMMENTS

ART COMMENTS

STATISTICS
all visits:

visits today:


website started:
23/09/2004
 
Official Webpage
of Attitude
Copyright 2004-2018
 
DJ Gruby/TRIAD