The kernel module (cbm.o) does not require any kernel patches and should compile right out of the box, at least with kernel 2.2.x, 2.4.x and 2.6.x, but 2.0.x might still work as well.
If you intend to modify the drive routines for `d64copy' and `cbmformat' you also need a crossassembler. `LINUX/config.make' comes with rules for A.Fachat's `xa' (available from http://www.floodgap.com/retrotech/xa/ or http://www.lb.shuttle.de/puffin/cbm4linux/; Note: xa has not been tested lately, and might not work anymore) and 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 `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.
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
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!