Next Previous Contents

4.1 Installing OpenCBM on Linux (cbm4linux)

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".).

Compile-time configuration

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.

Compilation

Type

Loading the module

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).

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

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