LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-01-2012, 01:43 PM   #16
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51

Quote:
Originally Posted by orcaja View Post
how did you get that error?
I don't remember exactly... can't look for it now. Try to modify the Makefile as I did. And the script/Configure file too. And maybe (if other errors persist) do a "export BASH=/bin/bash" before doing the "make config".

The error will say the path to create the missing dir.

If its not this, I will have to try and repeat it all, another day.

Side note: who said all errors are bad?
 
1 members found this post helpful.
Old 02-01-2012, 03:41 PM   #17
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
ohh I had misunderstood. I changed the line 117 on Makefile as you said: "/bin/bash scripts/Configure" and now sudo make config works fine. This asks for the card model.
I only selected the card that I have: 1780, and then...
make
for n in kernel lib tools; do make -C $n || exit 1; done
make[1]: Entering directory `/home/flowsensor/Downloads/advdaq-1.10.0001/kernel'
make -C /lib/modules/2.6.32-5-686/build M=/home/flowsensor/Downloads/advdaq-1.10.0001/kernel modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.32-5-686'
Building modules, stage 2.
MODPOST 0 modules


make didn't create the two .ko files needed for the card.

Last edited by orcaja; 02-06-2012 at 09:35 AM. Reason: too much information
 
Old 02-02-2012, 04:53 AM   #18
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
I can't help you any further.

But, so I could compile it all without "sudoing", I extracted the kernel source code to the home folder.

EDIT: of course, there are times *you will* need to get super user powers; e.g., when installing the compiled driver, for example, by making a "make install". And watch out for wrong paths causing errors.

Last edited by dedec0; 02-02-2012 at 07:38 AM.
 
1 members found this post helpful.
Old 02-02-2012, 07:20 AM   #19
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
Question Where are the *.ko files?

OK! thanks, I really appreciated your help, I think I'm very very close to make it.

I tried without sudoing, and extracted the sources at ~/daq/linux/linux-sources-2.6.32 and also copied the .config file..
make config, make dep and make, all of them fine, finally make install


for n in PCI-1780/ PCI-1784/;\
do cp $n*.ko ../modules; \
done
cp: cannot stat `PCI-1780/*.ko': No such file or directory
cp: cannot stat `PCI-1784/*.ko': No such file or directory
make[1]: *** [install] Error 1

I found the directory kernel/PCI-1780 and it only contains one Make file, files *.c and one with extension .h ... there are no ko files.

Thanks in advance.

Last edited by orcaja; 02-06-2012 at 07:56 AM. Reason: Adding a title
 
Old 02-02-2012, 04:37 PM   #20
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
http://wiki.r1soft.com/display/kb/Co....29+and+higher
 
Old 02-03-2012, 05:19 AM   #21
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
Just in case (some things evaporate quickly)


Debian Bug report logs - #521515
linux-headers-2.6.29-1-amd64: please restore symlinks into -common

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521515
 
Old 02-03-2012, 09:18 AM   #22
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
Question

those links are too advanced for my knowledge, I'm trying to understand.
So far, I think my system is not creating the modules. In make:

make[2]: Entering directory `/usr/src/linux-headers-2.6.32-5-686'
Building modules, stage 2.
MODPOST 0 modules

while executing make, does the line:
for n in kernel lib tools; do make -C $n || exit 1; done
indicates that it will go to the directory kernel and do make, then it will go to lib and tools directories and do make too?. can I run make manually each of them?

I tried this example:
http://www.cyberciti.biz/tips/build-...urce-tree.html
and then ls

hello.c hello.ko hello.mod.c hello.mod.o hello.o Makefile modules.order Module.symvers

This makes me think that I should be able to compile my drivers, but I'm just guessing. am I right?

Last edited by orcaja; 02-03-2012 at 10:08 AM. Reason: adding info
 
Old 02-04-2012, 08:17 PM   #23
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
how to debbug the Make file?

I tried in a laptop, I followed the same steps to compile the driver and I get the same results as before:

make
for n in kernel lib tools; do make -C $n || exit 1; done
make[1]: Entering directory `/home/flowsensor/Downloads/advdaq-1.10.0001/kernel'
make -C /lib/modules/2.6.32-5-686/build M=/home/flowsensor/Downloads/advdaq-1.10.0001/kernel modules
make[2]: Entering directory `/usr/src/linux-headers-2.6.32-5-686'
Building modules, stage 2.
MODPOST 0 modules

Can anyone give me an advice to start debbuging this file?
Thanks in advance.

Last edited by orcaja; 02-06-2012 at 09:37 AM.
 
Old 02-05-2012, 11:25 AM   #24
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
make warning undefined!

I changed my advinit.c file, i added this
#define pci_module_init pci_register_driver
and also change SA_SHIRQ to IRQF_SHARED

now make gives warnings like this:
WARNING: "advdrv_unregister_driver" [/kernel/PCI-1780/pci1780.ko] undefined!;
I haven't found how to solve that, but at least, it generates the pci1780.ko file, but it still does not generate the advdrv_core.ko file...

I'm attaching the Makefile, just in case somebody could have a look. I'm runnning debian 6, kernel 2.6.32
Thanks in advance.
Joc
Attached Files
File Type: txt Makefile.txt (1.8 KB, 34 views)

Last edited by orcaja; 02-08-2012 at 07:50 AM. Reason: add attachment
 
Old 02-08-2012, 02:08 PM   #25
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
Unhappy two ko files at least

I went to the directory /core/ and type make. This generates the advdrv_core.ko file, however, I got this too:

/home/flowsensor/daq/advdaq-1.10.0001/kernel/core/advk_core.c:1593: warning: passing argument 1 of ‘__constant_memcpy’ discards qualifiers from pointer target type

then I went to the directory /PCI-1780/ and typed make, and I get some messages like this:


WARNING: "advdrv_unregister_driver" [/home/flowsensor/daq/advdaq-1.10.0001/kernel/PCI-1780/pci1780.ko] undefined!

But it generated the pci1780.ko anyway. However it seems that the two modules: advdrv_core.ko and pci1780.ko are related, and the first should provide some functions for the second. Anyway, since I have the two files, I did inserted the two of them with insmod, but for the pci1780.ko file I get this:

insmod: error inserting 'pci1780.ko': -1 Unknown symbol in module

Any advice pleease?

Last edited by orcaja; 02-08-2012 at 02:10 PM.
 
Old 02-08-2012, 03:14 PM   #26
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
EXPORT_SYMBOL_GPL,... how to

I inserted the advdrv_core.ko before compiling the pci1780.ko file... same results

At the end of the file advdrv_core.c there are some lines like this:
./core/advdrv_core.c:EXPORT_SYMBOL_GPL(advdrv_register_driver);
./core/advdrv_core.c:EXPORT_SYMBOL_GPL(advdrv_unregister_driver);

but still when I compile the pci1780.ko I get:
WARNING: "advdrv_unregister_driver" [/path/PCI-1780/pci1780.ko] undefined!
WARNING: "advdrv_register_driver" [/path/PCI-1780/pci1780.ko] undefined!

Last edited by orcaja; 02-08-2012 at 03:19 PM. Reason: more details
 
Old 02-09-2012, 10:32 AM   #27
orcaja
Member
 
Registered: Aug 2008
Posts: 94

Original Poster
Rep: Reputation: 1
I compile the advdrv_core.ko, then I did this:

1) Copy the advdrv_core.ko file to a location beneath /lib/modules/<version>/kernel
2) Add the exported symbols to /lib/modules/<version>/build/Module.symvers

Then I compiled the pci1780.ko!!!

Then I ran make install, and that creates the major number and other things beyond my knowledge.

Now the driver is compiled, I think!!!
Now I compiled the very first program for this card, no problems reported so far. But
when I run this very first program, I got this:

err msg: System Error!

I guess, I should mark this thread as SOLVED and started a new one somewhere eh?
Thank you everyone.
Joc

Last edited by orcaja; 02-09-2012 at 10:33 AM. Reason: more info
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile driver without kernel headers??? seattleweb Linux - General 3 07-20-2008 05:56 PM
Kernel-source, alsa-driver and kernel compile jasone Linux - General 13 05-26-2005 12:15 AM
How to compile new ALSA driver into old kernel? sandin Slackware 4 05-14-2005 05:06 AM
Driver won't compile on Kernel 2.6 - works fine on Kernel 2.4 c@sey Linux - Software 4 01-08-2005 01:01 PM
How to compile a driver with the kernel? Kermeat Linux - General 5 02-11-2003 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration