The time now is Sun 22 Apr 2018, 16:31
All times are UTC - 4 |
Author |
Message |
DavidBell
Joined: 24 Nov 2006 Posts: 132
|
Posted: Fri 07 Sep 2007, 21:02 Post subject:
Driver compiling questions |
|
I'm trying to modify my topuchscreen driver a little, but I have a couple of questions.
First is, what is the syntax for compiling a single source (.c) file into a driver? currently I am using
from /usr/src/linux, and it works but it goes through checking them all which takes an age when I only want to change one. So if anyone knows the command to compile just one I'd be grateful. I think it's actually two commands - first uses gcc to go from .c to .o, then a second converts to .ko? I tried to look at the makefile but it's incomprehensible to me.
Second problem is /usr/include doesn't seem to be in the default include path when compiling modules, so if I add lines like
Code: | #include <stdio.h>
/*or*/
#include <syslog.h>
/*yes, these are the two I want :-)*/ |
... the files are in /usr/include, but the compiler can't find them. So it there an environmental variable somewhere that sets default include paths, or is it all done in the compile command?
Thanks for any help. DB
|
Back to top
|
|
 |
DavidBell
Joined: 24 Nov 2006 Posts: 132
|
Posted: Sun 16 Sep 2007, 02:10 Post subject:
|
|
For those wondering, you can get a simple makefile that you can modify for individual drviers at http://tldp.org/LDP/lkmpg/2.6/html/index.html (chapter 2.2)
Also found out stdio.h isn't allowed in kernel modules, you have to use kernel functions like printk instead.
DB
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
[ Time: 0.0306s ][ Queries: 12 (0.0046s) ][ GZIP on ] |