Topic: creating modules for chumby classic

I need /ttyACM to work on my chumby classics.  cdc-acm.ko is the driver, it is not on the classic, but it is on the Chumby one.  I tried pulling that and putting it in the /drivers directory on the classic, but it won't run.  "insmod ..." returns:

insmod cdc-acm.ko
[ 4397.020000] cdc_acm: version magic '2.6.28-chumby preempt mod_unload modversions ARMv5 ' should be '2.6.16-csb ARMv5 gcc-4.3'
insmod: cannot insert 'cdc-acm.ko': Invalid module format (-1): Exec format error

Do I need to install ironforge_toolchain and all that or is there another way?

Re: creating modules for chumby classic

It looks like you need to build against the Ironforge kernel, which is different than the Falconwing kernel.

Re: creating modules for chumby classic

How do I do that?

Re: creating modules for chumby classic

After reading some of the wiki I was able to build a working version of linux-2.6.16-chumby-1.7.0.

Cool!

Poking around in the untared files I see that cdc-acm.c and .h are in the drivers directory.  However, it's not on my chumby.  Obviously I have all the things I need to get this to work, so...

What do I have to do to get cdc-acm.ko onto my chumby classic?

Re: creating modules for chumby classic

You'd typically reconfigure the kernel to build the driver, then rebuild it.  If you've chosen to have the driver in a loadable module, you'd then be able to put just the module on a usb stick and load it into the current kernel, or you can include it in a full kernel build and reflash the device.

Re: creating modules for chumby classic

How do you reconfigure the kernel?  There are, like, a million files that have the same name.

My guess is that there is a file that lists the modules that are put into /drivers and registers them with kernel so that when I plug in a device, the driver is located and loaded up.  But...which file?

Re: creating modules for chumby classic

You go to the root directory of the kernel, and type "make menuconfig".  It should bring up a UI that asks you questions and lets you choose what you want to build, and how.

Re: creating modules for chumby classic

Duane - For some reason make menuconfig won't work on ubuntu, I think I need ncurses, but so far it won't build on my machine.

There has to be a simple way to do this...

9 (edited by Materdaddy 2012-05-31 06:27:13)

Re: creating modules for chumby classic

mwalimu wrote:

Duane - For some reason make menuconfig won't work on ubuntu, I think I need ncurses, but so far it won't build on my machine.

There has to be a simple way to do this...

You need to install libncurses5-dev for menuconfig on ubuntu (and debian) machines.


If you don't want to use menuconfig (the simple way to do this), and you actually know the name of the config option, you can simply edit the ".config" file under the top level of the kernel directory.  Change the line that will likely read:

# CONFIG_BLAH_BLAH is not set

to build directly into the kernel:

CONFIG_BLAH_BLAH=y

to build a module:

 CONFIG_BLAH_BLAH=m
Linux Guy - Occasional Chumby Hacker

Re: creating modules for chumby classic

Progress!  I got make menuconfig to work.  I saw that cdc-acm was built from the messages make sent me.  I loaded k1.zip onto my chumby classic, but "cdc-acm.ko" is not on the chumby. 

So, where is it and how do I get it in the chumby?

11 (edited by Materdaddy 2012-05-31 17:08:42)

Re: creating modules for chumby classic

mwalimu wrote:

Progress!  I got make menuconfig to work.  I saw that cdc-acm was built from the messages make sent me.  I loaded k1.zip onto my chumby classic, but "cdc-acm.ko" is not on the chumby. 

So, where is it and how do I get it in the chumby?

In your kernel build directory, look for "cdc-acm.ko" and transfer it to the chumby.  The c1 rootfs does it's module loading manually in /etc/init.d/rcS.background so you might want to add a line there (or use debugchumby on a usb stick) to load your module.  Not sure if it's the same on the classic, I don't have one booted right now to check.

Linux Guy - Occasional Chumby Hacker

Re: creating modules for chumby classic

Success!  /ttyACM0 is up and running!  Now to figure out what other cool things I can do...