Author Topic: Adding modules to kernel and some questions  (Read 12882 times)

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Adding modules to kernel and some questions
« on: March 12, 2005, 11:51:13 pm »
Hi,

I'm trying to add some HW support modules to Pluto. I have few problems and would ask for some help:
1. why is kernel in Pluto CD 686 ?  I guess majority of PCs will be P4 based. I'm compiling all my modules on same arch to stay compatible but am not sure whether this is good...

2. I've compiled pwc.ko module (for support of usb Logitech Quick PRO and other Philips chip based cameras - there are a lots of these used under Linux). I can contribute that module somewhere (maybe contributions forum and place to upload would be needed...). Also I'd kindly ask for guidance how to make proper device templates for adding usb cameras to pluto and motion and more info on whole procedure of adding support for new HW devices....

3. I'm trying to compile CAPI support for AVM Fritz cards (1 BRI ISDN interface, quite cheap and really popular around Europe, but have following problem... (quick question: how can I recompile Asterisk to add chan_capi?)

I've downloaded kernel source, configure it and compiled modules and install
them (make menuconfig, make , make modules, make modules_install) .

I'd also like to compile some other stuff according to separate instructions
but get those errors on build directory in /lib/modules..

Any hint what should I do to get rid of those errors ?


make -C src
make[1]: Entering directory `/root/Plutohome/Fritz/fritz/src'
make -C /lib/modules/2.6.10-1-686/build
SUBDIRS=/root/Plutohome/Fritz/fritz/src modules
make[2]: Entering directory `/lib/modules/2.6.10-1-686/build'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/lib/modules/2.6.10-1-686/build'
make[1]: *** [fcpci.ko] Error 2
make[1]: Leaving directory `/root/Plutohome/Fritz/fritz/src'
make: *** [src/fcpci.ko] Error 2

4. I get same error when I try to compile vloopback (can be found on motion web site), that does useful thing (at least for me and my previous Misterhouse based system). It generates virtual v4l devices, motion application duplicates video stream it receives, so for instance Mythtv can show same video as motion is outputting on virtual v4l device - you can have PIP with security video.... What is your opinion on this feature ?

Thanks in advance,

regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Re: Adding modules to kernel and some questions
« Reply #1 on: March 14, 2005, 05:36:44 pm »
Quote from: "tinia"
1. why is kernel in Pluto CD 686 ?  I guess majority of PCs will be P4 based. I'm compiling all my modules on same arch to stay compatible but am not sure whether this is good...

The 686 kernel works on AMD processors too, not just P4. I've seen it running on a AMD Athlon 64 processor just fine. Haven't tried it on VIA CPUs though.

In the future we may add more kernels to the CD since the installer detects the CPU and installs the most appropriate kernel, but we need to refine the build process to support multiple architectures somehow regarding module compiling.

Quote from: "tinia"
2. I've compiled pwc.ko module (for support of usb Logitech Quick PRO and other Philips chip based cameras - there are a lots of these used under Linux). I can contribute that module somewhere (maybe contributions forum and place to upload would be needed...).

I just looked around and what I saw is weird. There is a pwc.ko file in the 2.6.8-2 kernel, but it's no longer present in the 2.6.10 version. I was unable to find on Google where it went.

Quote from: "tinia"
Also I'd kindly ask for guidance how to make proper device templates for adding usb cameras to pluto and motion and more info on whole procedure of adding support for new HW devices....

To make a device template, you use the pluto admin website on your Core. I don't know how you upload new templates yet though. I don't have much experience with device templates as to properly guide you.

Quote from: "tinia"
3. I'm trying to compile CAPI support for AVM Fritz cards (1 BRI ISDN interface, quite cheap and really popular around Europe, but have following problem... (quick question: how can I recompile Asterisk to add chan_capi?)

Our current Asterisk has some custom changes in it that haven't been incorporated into the main Asterisk tree yet. Our branch of Asterisk will be available in 24 hours in our Subversion repository, which is accessible at http://svn.plutohome.com/pluto/trunk/.

Quote from: "tinia"
I've downloaded kernel source, configure it and compiled modules and install
them (make menuconfig, make , make modules, make modules_install) .

I'd also like to compile some other stuff according to separate instructions
but get those errors on build directory in /lib/modules..

Any hint what should I do to get rid of those errors ?

make -C src
make[1]: Entering directory `/root/Plutohome/Fritz/fritz/src'
make -C /lib/modules/2.6.10-1-686/build
SUBDIRS=/root/Plutohome/Fritz/fritz/src modules
make[2]: Entering directory `/lib/modules/2.6.10-1-686/build'
make[2]: *** No rule to make target `modules'.  Stop.
make[2]: Leaving directory `/lib/modules/2.6.10-1-686/build'
make[1]: *** [fcpci.ko] Error 2
make[1]: Leaving directory `/root/Plutohome/Fritz/fritz/src'
make: *** [src/fcpci.ko] Error 2


We build our modules out-of-tree using the stock Debian 2.6.10 kernel from unstable. The vanilla kernel from http://kernel.org won't work unless you replace the running kernel with one build from those sources.

To compile your modules the same way, you need these packages from our reporitory:
- kernel-source-2.6.10
- kernel-headers-2.6.10-1-686
- kernel-kbuild-2.6-3

You need the source because the kbuild package is for the 2.6.8 kernel that is found in Sarge, and we use the 2.6.10 from Sid (unstable).

After you install these packages, do this to set up the build environment:
Code: [Select]
cd /usr/src
tar -xjvf kernel-source-2.6.10.tar.bz2
mkdir kernel-kbuild-2.6-4
cp -a kernel-source-2.6.10/scripts kernel-kbuild-2.6-4/
ln -s ../kernel-headers-2.6.10-1/include/ kernel-kbuild-2.6-4/
cp kernel-headers-2.6.10-1-686/.extraversion kernel-headers-2.6.10-1-686/localversion


After this is done, you can go into your module source directory and build it with this command:
KDIR=/usr/src/kernel-headers-2.6.10-1-686 make -f Makefile -e

Quote from: "tinia"
4. I get same error when I try to compile vloopback (can be found on motion web site), that does useful thing (at least for me and my previous Misterhouse based system).

One of the team members had a task to play with vloopback to be used with linphone. It wasn't integrated into the product yet though, but it's on the TODO list.

Quote from: "tinia"
It generates virtual v4l devices, motion application duplicates video stream it receives, so for instance Mythtv can show same video as motion is outputting on virtual v4l device - you can have PIP with security video.... What is your opinion on this feature ?

From my point of view, it sounds interesting.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Re: Adding modules to kernel and some questions
« Reply #2 on: March 14, 2005, 10:02:39 pm »
Quote from: "radu.c"


I just looked around and what I saw is weird. There is a pwc.ko file in the 2.6.8-2 kernel, but it's no longer present in the 2.6.10 version. I was unable to find on Google where it went.


Well pwc is like a ghost, it gets in and out occasionaly. It's a long story. But under different maintainer it's available separately. I can send you .ko file to include in Pluto

Quote from: "radu.c"

We build our modules out-of-tree using the stock Debian 2.6.10 kernel from unstable. The vanilla kernel from http://kernel.org won't work unless you replace the running kernel with one build from those sources.

To compile your modules the same way, you need these packages from our reporitory:
- kernel-source-2.6.10
- kernel-headers-2.6.10-1-686
- kernel-kbuild-2.6-3

You need the source because the kbuild package is for the 2.6.8 kernel that is found in Sarge, and we use the 2.6.10 from Sid (unstable).

After you install these packages, do this to set up the build environment:
Code: [Select]
cd /usr/src
tar -xjvf kernel-source-2.6.10.tar.bz2
mkdir kernel-kbuild-2.6-4
cp -a kernel-source-2.6.10/scripts kernel-kbuild-2.6-4/
ln -s ../kernel-headers-2.6.10-1/include/ kernel-kbuild-2.6-4/
cp kernel-headers-2.6.10-1-686/.extraversion kernel-headers-2.6.10-1-686/localversion


After this is done, you can go into your module source directory and build it with this command:
KDIR=/usr/src/kernel-headers-2.6.10-1-686 make -f Makefile -e



I get error when I do
apt-get install kernel-headers-2.6.10-1-686

it says it depends on  kernel-headers-2.6.10-1 that cannot be installed.

If I may suggest it would be good to distribute unified build environment so others can jump in and contribute...

Also I'd kindly ask for some example or tutorial or help to solve real problem of adding new usb webcam to motion security system as example ...

Also some forum dedicated to contributions would be welcome...

Thanks in advance,

regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Adding modules to kernel and some questions
« Reply #3 on: March 17, 2005, 07:14:01 pm »
Hi,

You can check out our programmer's guide at: http://plutohome.com/support/index.php?section=document&docID=15

and also our DCE programmer's guide at:
http://plutohome.com/support/index.php?section=document&docID=51

to understand the DCE architecture.  In the case of Motion and the cameras, Motion is the Device that implements DCE--ie there is a binary that is built and executed, and which communicates with DCERouter.  It can run on any machine.  You can check our source code in: src\Generic_Analog_Capture_Card

"Generic Analog Capture Card" is actually the device template which wraps motion.  We call it that because it's the device users use whenever they want to add a capture card source.  This device has parameters for motion itself.

YOu'll see in the constructor in Generic_Analog_Capture_Card.cpp that it writes out the configuration info for motion.

Then, every camera in the house is a child device under motion (ie controlled via motion).  See Generic_Analog_Camera.  Those devices do not implement DCE.  Commands to them, therefore, get sent to the parent (the capture card).

Whenever someone wants to see what's on a camera, that devices sends the command COMMAND_Get_Video_Frame_CONST (see src/pluto_main/Define_Command.h -- the commands are in the Commands Table and pluto_main is auto-generated from the database).

Since the camera doesn't implement DCE, the message goes to the capture card and comes in on the function: void Generic_Analog_Capture_Card::ReceivedCommandForChild(DeviceData_Base *pDeviceData_Base,string &sCMD_Result,Message *pMessage)

The command is ignored if it's anything but get video frame -- that's all the capture card knows how to implement.

You can also read the sub-docs under the DCE programmer's guide.  We could have optionally stated that the Generic Analog Camera *did* implement DCE, but that it was embedded within the Generic Analog Capture Device.  if we had done that, then when we ran DCEGen it would have created a separate class within our Generic Analog Capture Card project for the camera, and all commands to the camera would have gone into that class itself, rather than the catch-all ReceivedCommandForChild function.  However, since the children of a capture card all implement the same command, and only 1 or 2 commands, it was cleaner to do it this way.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Re: Adding modules to kernel and some questions
« Reply #4 on: March 18, 2005, 07:40:49 am »
Quote from: "tinia"
Quote from: "radu.c"


We build our modules out-of-tree using the stock Debian 2.6.10 kernel from unstable. The vanilla kernel from http://kernel.org won't work unless you replace the running kernel with one build from those sources.

To compile your modules the same way, you need these packages from our reporitory:
- kernel-source-2.6.10
- kernel-headers-2.6.10-1-686
- kernel-kbuild-2.6-3

You need the source because the kbuild package is for the 2.6.8 kernel that is found in Sarge, and we use the 2.6.10 from Sid (unstable).

After you install these packages, do this to set up the build environment:
Code: [Select]
cd /usr/src
tar -xjvf kernel-source-2.6.10.tar.bz2
mkdir kernel-kbuild-2.6-4
cp -a kernel-source-2.6.10/scripts kernel-kbuild-2.6-4/
ln -s ../kernel-headers-2.6.10-1/include/ kernel-kbuild-2.6-4/
cp kernel-headers-2.6.10-1-686/.extraversion kernel-headers-2.6.10-1-686/localversion


After this is done, you can go into your module source directory and build it with this command:
KDIR=/usr/src/kernel-headers-2.6.10-1-686 make -f Makefile -e



I get error when I do
apt-get install kernel-headers-2.6.10-1-686

it says it depends on  kernel-headers-2.6.10-1 that cannot be installed.

If I may suggest it would be good to distribute unified build environment so others can jump in and contribute...

Also I'd kindly ask for some example or tutorial or help to solve real problem of adding new usb webcam to motion security system as example ...

Also some forum dedicated to contributions would be welcome...

Thanks in advance,

regards,

Rob.


Can anyone take a look at this build environment for kernel modules ?

Thanks in advance,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Adding modules to kernel and some questions
« Reply #5 on: March 23, 2005, 01:45:03 pm »
Hi Rob,

   The problem is that the modules build environment in debian is not very robust now (for example the 2.6.10 modules are not very buildable with default modules build from stock debian even if you use unstable). What we did is to "fix" the environment on our machine in the same way that radu explained in the previous posts.

   What a contributor can do is to make sure that his modules can compile wiht the 2.6.10 kernel source tree ( for the 2.6.10 variant) as an out of tree module. If he can do this then he can send us patches and we will include that into our build and release system in the same way that the current ivtv and cx88 drivers are built.

Sincerely,
   ToMiC

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Re: Adding modules to kernel and some questions
« Reply #6 on: March 23, 2005, 05:04:16 pm »
Quote from: "radu.c"


We build our modules out-of-tree using the stock Debian 2.6.10 kernel from unstable. The vanilla kernel from http://kernel.org won't work unless you replace the running kernel with one build from those sources.

To compile your modules the same way, you need these packages from our reporitory:
- kernel-source-2.6.10
- kernel-headers-2.6.10-1-686
- kernel-kbuild-2.6-3

You need the source because the kbuild package is for the 2.6.8 kernel that is found in Sarge, and we use the 2.6.10 from Sid (unstable).

After you install these packages, do this to set up the build environment:
Code: [Select]
cd /usr/src
tar -xjvf kernel-source-2.6.10.tar.bz2
mkdir kernel-kbuild-2.6-4
cp -a kernel-source-2.6.10/scripts kernel-kbuild-2.6-4/
ln -s ../kernel-headers-2.6.10-1/include/ kernel-kbuild-2.6-4/
cp kernel-headers-2.6.10-1-686/.extraversion kernel-headers-2.6.10-1-686/localversion


After this is done, you can go into your module source directory and build it with this command:
KDIR=/usr/src/kernel-headers-2.6.10-1-686 make -f Makefile -e



Hi mihai,

thanks for info. The problem lie in above sentence. Radu instructs me to install packages from Pluto repository, but it fails on :
Code: [Select]

apt-get install kernel-headers-2.6.10-1-686


It complains that this package depends on kernel-headers-2.6.10-1 that cannot be installed. I've installation from kickstart CD, so this should work...

Is there anyone else with working build environment ?

I have no idea left what to do...

Thanks,

regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Ahh
« Reply #7 on: March 23, 2005, 05:18:00 pm »
Sorry about that,

   It seems like that package is missing from our repository. We will fix this but you can work around it by just making sure that the package is built against the kernel sources as an out of the tree module.

Sincerely,
  ToMiC

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Re: Ahh
« Reply #8 on: March 23, 2005, 11:25:14 pm »
Quote from: "mihai.t"
Sorry about that,

   It seems like that package is missing from our repository. We will fix this but you can work around it by just making sure that the package is built against the kernel sources as an out of the tree module.

Sincerely,
  ToMiC


Hi,

thanks for help. Ufnortunately I don't understand how to do workaround. :-(

Maybe I'm missing something, but I'm trying to built modules outside kernel sources, but they complain that there is no 'build' directory and stop.

Regards,

Rob.

archived

  • Hello, I'm new here
  • Posts: 0
    • View Profile
Adding modules to kernel and some questions
« Reply #9 on: March 24, 2005, 11:02:49 am »
Hi Rob,

   Can you please explain how are you trying to build the modules ? We can try to do the same here and advise you further.

Sincerely,
  ToMiC