Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Sep 2014, 12:15
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Driver compiling questions
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [2 Posts]  
Author Message
DavidBell

Joined: 24 Nov 2006
Posts: 132

PostPosted: 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
Code:
make modules

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
View user's profile Send private message 
DavidBell

Joined: 24 Nov 2006
Posts: 132

PostPosted: 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
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [2 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

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.0400s ][ Queries: 11 (0.0050s) ][ GZIP on ]