View Full Version : Can someone please help me install a kernel module?
cmdowns
05-03-2008, 12:18 PM
Hello, I'm back with another I-don't-really-understand-linux-very-well question.
I am working on replicating a project developed by itt forum user D-rock, described in this thread (http://www.internettablettalk.com/forums/showthread.php?t=11877&highlight=arduino). Without confusing things by over explaining what I'm ultimately trying to accomplish, right now I want to be able to run D-rock's Python code that s/he provided in post 24 (http://www.internettablettalk.com/forums/showthread.php?t=11877&highlight=arduino&page=3) of the same thread and send serial data from my n800 (os2008) to my Arduino microcontroller via usb cable.
My problem (I think) is that I don't really know how to install the FTDI driver that itt user Fanoush has compiled and provided by a link in this post (http://www.internettablettalk.com/forums/showpost.php?p=121220&postcount=12) of the same thread.
In D-rock's post 9 (http://www.internettablettalk.com/forums/showpost.php?p=104469&postcount=9) in the thread, s/he describes using the insmod command in the following manner:
#insmod drivers/usb/serial/ftdi_sio.ko
I'm afraid I don't really understand this command sufficiently in order to make it install properly. Can anyone please explain to me the procedure for installing the driver?
BTW, I have to say I've traded numerous pm's with D-rock lately and s/he has been incredibly helpful. Since this question concerns something beyond the scope of his/her project (namely, my lack of knowledge about installing drivers), I though I'd give him/her a break and see if someone else might be willing to answer my questions this time.
Thanks in advance for your assistance. As always, this forum is full of really helpful people.
briand
05-03-2008, 12:25 PM
um...
as root (ie: at the # prompt), type
insmod drivers/usb/serial/ftdi_sio.ko
cmdowns
05-03-2008, 12:42 PM
Thanks for the reply. I guess I should have mentioned in my op that I have tried to enter the code #insmod drivers/usb/serial/ftdi_sio.ko and xterm tells me insmod: can't open 'drivers/usb/serial/ftdi_sio.ko': No such file or directory
Do I need to mkdir the drivers/usb/serial directory? I guess I'm confused because it doesn't look like a directory format I recognize because it doesn't start with the / (root). Is there a certain directory that I need to be working from in order to make this work? What I tried to do is transfer the ftdi_sio.ko file to the /usr/bin directory and try the insmod there. Since this didn't work I'm obviously doing something wrong. Any clues?
qwerty12
05-03-2008, 12:44 PM
The module shouldn't really be in /usr/bin but if you put it there:
insmod /usr/bin/ftdi_sio.ko or insmod /usr/bin/drivers/usb/serial/ftdi_sio.ko
Make sure you are root.
(although, I use modprobe now thanks to jott and KotCzarny)
cmdowns
05-03-2008, 12:54 PM
I'll put the module wherever you think I should (hey . . . watch it!).
Where is the best place to install it and what is the syntax used? Why doesn't D-rock's code dir start at root?
qwerty12
05-03-2008, 01:02 PM
mkdir /lib/modules/`uname -r`
cd to wherever the ftdi_sio.ko is
mv ftdi_sio.ko /lib/modules/`uname -r`
cmdowns
05-03-2008, 01:06 PM
The module shouldn't really be in /usr/bin but if you put it there:
insmod /usr/bin/ftdi_sio.ko or insmod /usr/bin/drivers/usb/serial/ftdi_sio.ko
Make sure you are root.
(although, I use modprobe now thanks to jott and KotCzarny)
I tried this to see if the command would work. If I try the following as root insmod /usr/bin/ftdi_sio.ko xterm tells me insmod: cannot insert 'usr/bin/ftdi_sio,ko': Unknown symbol in module (-1): No such file or directory
So, now two questions:
1) Where should I install the driver?
2) What is the proper code/syntax to install it?
Thanks for the help.
cmdowns
05-03-2008, 01:10 PM
mkdir /lib/modules/`uname -r`
cd to wherever the ftdi_sio.ko is
mv ftdi_sio.ko /lib/modules/`uname -r`
I feel like such a noob but. . .does the 'uname -r' mean I'm supposed to create a name and use it in place of uname? Do I append the chosen name with -r?
Thanks for the assistance.
qwerty12
05-03-2008, 01:11 PM
I tried this to see if the command would work. If I try the following as root insmod /usr/bin/ftdi_sio.ko xterm tells me insmod: cannot insert 'usr/bin/ftdi_sio,ko': Unknown symbol in module (-1): No such file or directorySo, now two questions:
1) Where should I install the driver?
2) What is the proper code/syntax to install it?
Thanks for the help.
That means you used the right command but another module may need inserting. Run the insmod again and run dmesg straight after and paste the last line here.
cmdowns
05-03-2008, 01:37 PM
When I run dmesg, xterm spits out so much I can’t even scroll back to copy it all. This is what I could copy [193043.437500] EAC mode: play disabled, rec disabled
[193043.617187] EAC mode: play enabled, rec enabled[193057.359375] EAC mode: play disabled, rec disabled
[193057.953125] EAC mode: play enabled, rec enabled[193068.953125] EAC mode: play disabled, rec disabled
[193154.539062] EAC mode: play enabled, rec enabled[193158.765625] EAC mode: play disabled, rec disabled
[193158.796875] EAC mode: play enabled, rec enabled[193186.625000] EAC mode: play disabled, rec disabled
[193187.562500] EAC mode: play enabled, rec enabled[193193.429687] EAC mode: play disabled, rec disabled
[193194.445312] EAC mode: play enabled, rec enabled[193196.945312] EAC mode: play disabled, rec disabled
[193200.664062] EAC mode: play enabled, rec enabled[193203.445312] EAC mode: play disabled, rec disabled
[193359.296875] EAC mode: play enabled, rec enabled[193366.781250] EAC mode: play disabled, rec disabled
[193386.687500] EAC mode: play enabled, rec enabled[193391.648437] EAC mode: play disabled, rec disabled
[193396.828125] EAC mode: play enabled, rec enabled[193402.429687] EAC mode: play disabled, rec disabled
[193403.867187] EAC mode: play enabled, rec enabled[193410.570312] EAC mode: play disabled, rec disabled
[193428.992187] EAC mode: play enabled, rec enabled[193442.828125] EAC mode: play disabled, rec disabled
[193446.953125] EAC mode: play enabled, rec enabled[193451.132812] EAC mode: play disabled, rec disabled
[193452.218750] EAC mode: play enabled, rec enabled[193454.718750] EAC mode: play disabled, rec disabled
[193463.039062] EAC mode: play enabled, rec enabled[193468.632812] EAC mode: play disabled, rec disabled
[193470.000000] EAC mode: play enabled, rec enabled[193480.632812] EAC mode: play disabled, rec disabled
[193480.945312] EAC mode: play enabled, rec enabled[193488.359375] EAC mode: play disabled, rec disabled
[193503.585937] EAC mode: play enabled, rec enabled[193509.031250] EAC mode: play disabled, rec disabled
[193509.437500] EAC mode: play enabled, rec enabled[193522.148437] EAC mode: play disabled, rec disabled
[193524.187500] EAC mode: play enabled, rec enabled[193529.687500] EAC mode: play disabled, rec disabled
[193544.695312] EAC mode: play enabled, rec enabled[193554.281250] EAC mode: play disabled, rec disabled
[193554.968750] EAC mode: play enabled, rec enabled[193587.148437] EAC mode: play disabled, rec disabled
[193588.968750] EAC mode: play enabled, rec enabled[193591.468750] EAC mode: play disabled, rec disabled
[193592.585937] EAC mode: play enabled, rec enabled[193618.531250] EAC mode: play disabled, rec disabled
[193621.023437] EAC mode: play enabled, rec enabled[193627.382812] EAC mode: play disabled, rec disabled
[193635.625000] EAC mode: play enabled, rec enabled[193638.125000] EAC mode: play disabled, rec disabled
[193638.156250] EAC mode: play enabled, rec enabled[193646.140625] EAC mode: play disabled, rec disabled
[193646.484375] EAC mode: play enabled, rec enabled[193654.000000] EAC mode: play disabled, rec disabled
[193654.468750] EAC mode: play enabled, rec enabled[193661.054687] EAC mode: play disabled, rec disabled
[193712.421875] EAC mode: play enabled, rec enabled[193718.289062] EAC mode: play disabled, rec disabled
[193723.890625] EAC mode: play enabled, rec enabled[193726.390625] EAC mode: play disabled, rec disabled
[193748.250000] EAC mode: play enabled, rec enabled[193750.617187] EAC mode: play disabled, rec disabled
[193752.414062] EAC mode: play enabled, rec enabled[193754.914062] EAC mode: play disabled, rec disabled
[193756.679687] EAC mode: play enabled, rec enabled[193761.078125] EAC mode: play disabled, rec disabled
[193762.062500] EAC mode: play enabled, rec enabled[193765.390625] EAC mode: play disabled, rec disabled
[193773.734375] EAC mode: play enabled, rec enabled[193776.101562] EAC mode: play disabled, rec disabled
[193776.460937] EAC mode: play enabled, rec enabled[193778.960937] EAC mode: play disabled, rec disabled
[193784.156250] EAC mode: play enabled, rec enabled[193794.906250] EAC mode: play disabled, rec disabled
[193794.937500] EAC mode: play enabled, rec enabled[193803.125000] EAC mode: play disabled, rec disabled
[193807.148437] EAC mode: play enabled, rec enabled[193811.859375] EAC mode: play disabled, rec disabled
[193815.109375] EAC mode: play enabled, rec enabled[193840.750000] EAC mode: play disabled, rec disabled
[193844.851562] EAC mode: play enabled, rec enabled[193860.656250] EAC mode: play disabled, rec disabled
[193861.351562] EAC mode: play enabled, rec enabled[193865.906250] EAC mode: play disabled, rec disabled
[193866.234375] EAC mode: play enabled, rec enabled[193874.617187] EAC mode: play disabled, rec disabled
[193875.031250] EAC mode: play enabled, rec enabled[193879.218750] EAC mode: play disabled, rec disabled
[193896.796875] EAC mode: play enabled, rec enabled[193902.578125] EAC mode: play disabled, rec disabled
[193903.445312] EAC mode: play enabled, rec enabled[193909.929687] EAC mode: play disabled, rec disabled
[193910.578125] EAC mode: play enabled, rec enabled[193916.757812] EAC mode: play disabled, rec disabled
[193921.093750] EAC mode: play enabled, rec enabled[193927.882812] EAC mode: play disabled, rec disabled
[193933.375000] EAC mode: play enabled, rec enabled[193936.054687] EAC mode: play disabled, rec disabled
[193936.351562] EAC mode: play enabled, rec enabled[193942.554687] EAC mode: play disabled, rec disabled
[193943.710937] EAC mode: play enabled, rec enabled[193946.500000] EAC mode: play disabled, rec disabled
[193946.898437] EAC mode: play enabled, rec enabled[193951.273437] EAC mode: play disabled, rec disabled
[193962.554687] EAC mode: play enabled, rec enabled[193965.585937] EAC mode: play disabled, rec disabled
[193970.390625] EAC mode: play enabled, rec enabled[193993.546875] EAC mode: play disabled, rec disabled
[194009.851562] EAC mode: play enabled, rec enabled[194022.695312] EAC mode: play disabled, rec disabled
[194022.882812] EAC mode: play enabled, rec enabled[194032.343750] EAC mode: play disabled, rec disabled
[194046.929687] EAC mode: play enabled, rec enabled[194075.296875] EAC mode: play disabled, rec disabled
[194075.437500] EAC mode: play enabled, rec enabled[194083.640625] EAC mode: play disabled, rec disabled
[194083.828125] EAC mode: play enabled, rec enabled[194104.531250] EAC mode: play disabled, rec disabled
[194107.234375] EAC mode: play enabled, rec enabled[194124.421875] ftdi_sio: Unknown symbol usb_serial_port_softint
[194124.429687] ftdi_sio: Unknown symbol usb_serial_disconnect
[194124.429687] ftdi_sio: Unknown symbol usb_serial_probe
[194124.429687] ftdi_sio: Unknown symbol usb_serial_register
[194124.429687] ftdi_sio: Unknown symbol usb_serial_deregister
[194126.734375] EAC mode: play disabled, rec disabled
[194132.632812] EAC mode: play enabled, rec enabled[194135.132812] EAC mode: play disabled, rec disabled
[194135.414062] EAC mode: play enabled, rec enabled/usr/bin #
Does that shead any light on my problem?
cmdowns
05-03-2008, 01:46 PM
Upon reading your post (http://www.internettablettalk.com/forums/showpost.php?p=177550&postcount=9) more clearly, I realize you only needed the last line of code after I enter dmesg. It is: [194132.632812] EAC mode: play enabled, rec enabled[194135.132812] EAC mode: play disabled, rec disabled
[194135.414062] EAC mode: play enabled, rec enabled/usr/bin
And thanks again for the help.
Johnx
05-03-2008, 01:58 PM
quick insmod primer:
insmod isn't installing the driver so much as loading it. Put the driver (also known as a kernel module) wherever you want. Traditionally, the place to put it is somewhere under /lib/modules/"the current kernel version"/kernel/drivers . If this is your own project, put it wherever it makes sense to you. You will need to reload it every time you reboot.
quick paths primer:
paths come in two varieties: absolute and relative. Say you're currently in /root/ and your kernel module is in /root/foo/my_module.ko . To use insmod from here you can use either the absolute path:
insmod /root/foo/my_module.ko
or the relative path:
insmod foo/my_module.ko
quick primer on what was meant by `uname -r`:
there are two parts to this. The first part to talk about is what the command uname -r does. It simply prints the current release version of the Linux kernel ("r" for release). On my desktop linux box when I type uname -r it gives me: 2.6.24-1-686 . when you put it in back-ticks (that's what this is: ` ) it means "Take the output of the command in the backticks and substitute it in place." So if I type on my desktop linux box:
mkdir `uname -r`
it's the same (for me!) as typing:
mkdir 2.6.24-1-686
By doing it this way, you don't have to type a different command when you are on a different kernel version. (Purely for reference, $(uname -r) has the same result as `uname -r`).
If you haven't done so already, I would *highly* suggest that you grab yourself a free copy of vmware player or vmware server and install (or use a pre-existing) image to run Linux on your desktop (inside windows) so you have a sandbox to play around in. The tablet is a hard, unforgiving place to learn Linux, especially since it has somewhat limited utilities and no man pages.
Please feel free to ask questions though. We were all new once!
-John
cmdowns
05-04-2008, 09:24 AM
The info in Johnx's post (http://www.internettablettalk.com/forums/showpost.php?p=177566&postcount=12) was very informative. It was all good stuff to know. I am a total linux noob. In addition to my n800, I also have a laptop running ubuntu, so I also have that as a resource to learn from. But I'm afraid I still 'don't know how to solve my problem.
In post 9 (http://www.internettablettalk.com/forums/showpost.php?p=177550&postcount=9) qwerty12 suggests the reason I'm getting the following response from xterm insmod: cannot insert 'usr/bin/ftdi_sio,ko': Unknown symbol in module (-1): No such file or directory is because I may be missing some other module that is require in order for me to make this work.
Does that seem like it is likely to be the problem I'm having? Can anyone tell me what that module might be, and what I should do to get everything working right?
Thanks for all the help.
Johnx
05-04-2008, 01:23 PM
You're definitely missing a module (or more than one). The clue is in the dmesg output you posted:
[194124.429687] ftdi_sio: Unknown symbol usb_serial_disconnect
[194124.429687] ftdi_sio: Unknown symbol usb_serial_probe
[194124.429687] ftdi_sio: Unknown symbol usb_serial_register
[194124.429687] ftdi_sio: Unknown symbol usb_serial_deregister
Based on this, I would guess that the module you need has usb and serial in the name. Maybe usbserial.ko or usb-serial.ko or usb_serial.ko.
-John
cmdowns
05-04-2008, 03:09 PM
Ok, I think I've got it figured out now. In the package that I got from fanoush there were multiple driver modules. I didn't realize that I needed to install the usbserial.ko before I installed the ftdi_sio.ko module. Sure enough, when I install the former, the later seems to install with no problem.
Thanks for the info. I'm sure you're right about the tablet being a hard way to learn linux. But I haven't found a better forum for gleaning info than this one. The ubuntu forum is pretty good too, but there is so much info there it's a little hard to sift through at times. I have gotten some good help there too.
Thanks again.
RogerS
05-04-2008, 03:44 PM
I am not having this problem.
I don't expect to have this problem.
Nonetheless, I found reading this entire thread compelling. More than that: inspiring, even. First, for cmdown's persistence in the face of repeated attempts not resolving the situation; second, for briand's and qwerty12's and johnx's helpfulness in guiding cmsdown to resolution, and third, for johnx's very clear statements about insmod, paths and uname.
Feels like real community to me. Thanks to all of you.
Roger
Thanks to CMDowns and Fanoush for the help.
I've now got Arduino talking to N810 and probably N900 is equivalent.
Can avoid more comments like these on our Nokia hacks...
http://www.engadget.com/2009/09/21/n900-hacked-to-replace-the-innards-of-a-speak-and-spell-can-never/comments/21792620/
They've got a point about the bluetooth module. Serial would be better, and we can now use that instead.
The only reason we were using bluetooth is we didn't get hold of the right cable in time and had only 3 weeks to hack the exhibits together so when we had it working we left it alone..
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.