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.
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'.
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.
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".).
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.
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:
/var/log/messages if the correct cable type was recognized
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.
Finding the cause of a failure condition can be hard. Anyway, the following tips might help you:
/var/log/messages; it might give you some hints.
Check the interrupts with cat /proc/interrupts.
alias parport_lowlevel parport_pc options parport_pc io=0x378 irq=7
As a first test, try something simple like
(no root privileges required)
Failure can be caused by:
/usr/local/lib/cannot be found; in this case, add
/etc/ld.so.confand execute ldconfig (as root).
/dev/cbmdevice; try chmod 777 /dev/cbm
Most probably, you will want to add this to
/etc/modules.conf to have
the driver loaded on demand: (the file is called
some older SuSE systems)
alias char-major-10-177 cbm options cbm [options]
With [options] being one or more of:
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:
$ chmod 660 /dev/cbm $ chgrp cbmuser /dev/cbm $ ls -l /dev/cbm crw-rw---- 1 root cbmuser 10, 177 2007-11-11 14:34 /dev/cbm
To change the group to another one, change the part `root' in `GROUP="root"' by the name of the group you want to use. To change the access mode, change `MODE="0666"' to `MODE="0660"', so your files looks like:
ACTION!="add", GOTO="opencbm_plugin_xa1541_rules_end" # xa1541/xm1541 parallel port driver KERNEL=="cbm", GROUP="root", MODE="0666" LABEL="opencbm_plugin_xa1541_rules_end"
For your changes to take effect, issue
ACTION!="add", GOTO="opencbm_plugin_xa1541_rules_end" # xa1541/xm1541 parallel port driver KERNEL=="cbm", GROUP="cbmuser", MODE="0660" LABEL="opencbm_plugin_xa1541_rules_end"
You might also want to adjust the file `sys/linux/45-opencbm-parallel.rules', which is used when installing the OpenCBM driver out of the source package.
$ rmmod cbm $ modprobe cbm
Congratulation, you have successfully set up your OpenCBM installation!