I don't use Arch Linux, but the minimum google researching I've done
suggests you need the kernel26-headers package.
Some other things to consider:
1. Do the Arch kernels include the staging comedi drivers already?
2. In theory, it should be possible to do a DKMS version of the package
for Arch, which would automatically build the comedi modules when the
kernel is updated. There is an example dkms.conf in the comedi sources,
which I think is up-to-date, and just needs the PACKAGE_VERSION line
tweaking.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
-=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
One thing that is apparent is that it's not using the comedi modules you
built and installed from git, it's using modules from the kernel's
"staging" directory. These must have been shipped with the kernel26
package.
Barring bugs, it shouldn't matter which modules are installed though.
The problem you are seeing is due to Comedi's auto-configuration
mechanism, and the fact that the dt9812 module does not currently
support it. Don't worry, there is a workaround, but first a bit of
background.
When the comedi module is loaded, it reserves a certain number of slots
for "manually configured" devices and creates the /dev/comediN device
files for these reserved slots during module load. It also creates
extra device files automatically for any "automatically configured"
devices that try to register themselves with the comedi core. By
default, the number of reserved slots is 0, so the only /dev/comediN
device files that are created are those for "automatically configured"
devices.
As I mentioned, the dt9812 module does not currently use the
auto-configuration mechanism. So it needs to use one of the reserved
slots, and by default there aren't any!
The comedi module has a couple of module parameters you can set that
control the number of devices and the auto-configuration mechanism. The
options can be set by creating a file "/etc/modprobe.d/comedi.conf". If
your system doesn't have the "/etc/modprobe.d/" directory, you may need
to edit the "/etc/modprobe.conf" file instead.
The first of these parameters is 'comedi_num_legacy_minors', which sets
the number of comedi devices reserved for manual configuration and by
default is 0. The following configuration line sets it to 4, but you
can use any number from 0 to 48:
options comedi comedi_num_legacy_minors=4
The second of these parameters is 'comedi_autoconfig' which controls
whether the auto-configuration mechanism is enabled and by default is 1
(enabled). You can disable the auto-configuration mechanism by setting
it to 0, for example:
options comedi comedi_autoconfig=0
It's possible to combine the two parameters on the same line:
options comedi comedi_autoconfig=0 comedi_num_legacy_minors=4
One quirk is that if comedi_autoconfig=0 and comedi_num_legacy_minors=0,
the comedi_num_legacy_minors value gets automagically changed to 16,
otherwise the comedi module would be completely useless!
Note that these module parameters won't take effect until the main
comedi module is reloaded.
After reloading the comedi module with a non-zero
comedi_num_legacy_minors or with comedi_autoconfig set to 0, you should
see some "/dev/comediN" device files. You can then manually configure
the comedi device using the comedi_config command as root, e.g.:
comedi_config /dev/comedi0 dt9812
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
It depends. When you plug in the dt9812, the modules should be loaded
automatically, but the dt9812 module doesn't do the comedi autoconfig
thing, so it needs to be configured with the comedi_config module.
The dt9812 module is also unusual in that it allows the comedi device to
be configured as a dt9812 even if the device is not currently plugged
in. You might want to take advantage of that by running a startup
script that does "modprobe dt9812" (which also loads the comedi module
as a dependency) followed by "comedi_config /dev/comedi0 dt9812". The
device won't work until you plug it in of course!
> And, I had to change permissions of /dev/comedi0 to a+rw to be able to
> open the device.
It's probably better to avoid making it world accessible and just make
it owner and group accessible. Set the permissions to 0660 and change
the group owner to a specific group. Debian uses the group "iocard".
Some people use the group "comedi". In either case, you probably need
to create the group and make your username a member of it.
The mode and group owner of the /dev/comedi* files can be set set using
a UDEV rule in /dev/udev/rules/90-comedi.rules, for example using mode
0660 and group "iocard":
KERNEL=="comedi[0-9]*" MODE="0660" GROUP="iocard"
or:
SUBSYSTEM=="comedi" MODE="0660" GROUP="iocard"
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
I wonder why it cannot allocate that memory? Is it->n_subdevices
getting set to something stupid?
> I'm stuck and w/o any access to my dt9812 box. How can I get rid of
> the obviously buggy staging driver?
It's possible to mess around with /etc/depmod.conf or /etc/depmod.d/ to
change the search order for all modules, or override the module
directory for specifically named modules - see 'man depmod.conf'. If
you make changes there, I think you need to run 'depmod -a' afterwards
to regenerate the dependencies.
--
-=( Ian Abbott @ MEV Ltd. E-mail: <abb...@mev.co.uk> )=-
It's always handy to have more than one bootable kernel in your grub
config when experimenting with kernel stuff. ;)
I haven't used depmod.conf yet either, but my understanding is you can set:
override comedi 2.6.37-ARCH kernel/comedi
i.e. kernelversion is the `uname -r` value, and modulesubdirectory is
the subdirectory under /lib/modules/`uname -r`/ where the module is to
be found. I'm guessing that the module will be found in any
subdirectory of the specified subdirectory, but I haven't tested it.
You can use * for kernelversion to make life easier.
Rather than listing all the comedi modules, I think you can just change
the search path like so:
search kernel/comedi updates built-in
but I haven't tested that either yet!