Next Previous Contents

4.3 Installing OpenCBM on Linux or FreeBSD

The installation of OpenCBM differs a little bit depending on the cable used to connect your CBM equipment. The following instructions try to show the installation procedure as straight-forward as possible. At first, I will describe the prerequisites for each cable type. Afterwards, I will describe the installation bits that are common to all cable types. At last, I will describe some special postprocessing steps that are needed for some cable types.

Prerequisites

XUM1541 cable (a.k.a. ZoomFloppy) and XU1541 cable

These two cables are rather easy. In order to compile them, you need the libusb packages (libusb 1.0, not 0.1) and the corresponding libusb development package. For Debian based systems, it is enough to install the package `libusb-1.0-0-dev'.

XA1541 cable or XM1541 cable

The XA1541 cable and the XM1541 cable need a kernel module (cbm.o on Linux, opencbm.ko on FreeBSD) which acts as a driver for the parallel port based cables.

The kernel module on Linux (cbm.o) does not require any kernel patches and should compile right out of the box, at least with kernel 4.x, 3.x and 2.6.x, but 2.0.x, 2.2.x and 2.4.x might still work as well. They have not been tested in ages, though, thus, you are on your own.

In order to compile the kernel module, you will need the headers that correspond to your current running kernel. For debian-based systems, you can accomplish this by running aptitude install linux-headers-`uname -r` as root.

The kernel module on FreeBSD (opencbm.ko) should compile out of the box as well; to compile it, you will need to have the FreeBSD source installed in /usr/src. This can be selected in the FreeBSD installer. For FreeBSD, it is recommended to build from the official ports found in comms/opencbm, comms/opencbm-kmod and comms/opencbm-plugin-xa1541 instead. If you prefer not to use these ports, note that for FreeBSD, you will still have to use the LINUX/Makefile, see below.

Any cable type

If you intend to modify the drive routines for `d64copy' and `cbmformat' you also need a crossassembler. `opencbm/LINUX/config.make' comes with rules for Ullrich von Bassewitz' `cl65' (comes with cc65, http://www.cc65.org/). Starting with version cbm4linux 0.2.3, OpenCBM includes precompiled 6502 binaries, so as long as you don't touch the .a65 files, there's no need for a crossassembler.

This package comes with a .spec file for those who want to build binary .RPMs. See the RPM documentation (outside of this paper) for details about the build process. Additionally, all files needed to built Debian .DEB packages are included. If you upgrade from a previous (non-RPM and non-DEB) version and want to install a packetized binary version (RPM or DEB), don't forget to remove the old files hanging aroung (just do "make uninstall", preferably in the *old* source directory. For a >= 0.4.0 version of OpenCBM, change the line to "make -f LINUX/Makefile uninstall".).

Compile-time configuration

The compile-time configuration is located in `opencbm/LINUX/config.make'. Check the KERN_FLAGS line if you're running kernel 2.0.x or if you don't want to use the Linux parport subsystem for some reason. Same goes for SMP machines.

Compilation

Loading the kernel module (XA1541/XM1541 only)

This is only needed if you are using the XA1541 or XM1541 cables. Otherwise, skip this section

This section describes the kernel module for Linux. For the FreeBSD kernel module, please refer to the included man page, opencbm(4)

If you're using the parport subsystem (which is default), you should now be able to load the driver module by issuing (as root)

or, when built with -DDIRECT_PORT_ACCESS:

Check /var/log/messages if the correct cable type was recognized (XA1541/XM1541).

udev rules so that you can access the cables as non-root user (Linux only)

Normally, you will have access to your device only if you are logged in as root, or if you use sudo. You might want to change this behaviour. For this, OpenCBM includes udev rules that allow you to customize who is able to access the devices.

These files are located in:

The appropriate file(s) are copied into the directory /etc/udev/rules.d/ at installation time. They will allow any member of the group user to use the corresponding cable.

If you want to use another group, just change the files accordingly.

Troubleshooting

Finding the cause of a failure condition can be hard. Anyway, the following tips might help you:

Device access

As a first test, try something simple like

(no root privileges required)

Failure can be caused by:

Runtime configuration (Applies to XA1541 and XM1541 cables only!)

Most probably, you will want to add this to /etc/modules.conf to have the driver loaded on demand: (the file is called /etc/conf.modules on some older SuSE systems)

    alias char-major-10-177 cbm
    options cbm [options]

With [options] being one or more of:

Security considerations

By default, OpenCBM installs the device driver so that anyone has access to the CBM devices:

    $ ls -l /dev/cbm
    crw-rw-rw- 1 root root 10, 177 2007-11-11 14:34 /dev/cbm

You might want to change this behaviour to control more specifically who is allowed to use OpenCBM, and who is not.

The best way is to define a group (for example, `cbmuser') and restrict the access rights to the owner (root) and this group (cbmuser) only.

I assume you already have defined a group `cbmuser', for example, by using groupadd(8) (all Linux variants) or addgroup(8) (all Debian based Linux distributions).

Now, you can restrict the access by two different means, depending upon if you are using devfs or udev:

Congratulation, you have successfully set up your OpenCBM installation!


Next Previous Contents