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 Wed 17 Dec 2014, 15:59
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 Posts_count  
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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0386s ][ Queries: 12 (0.0038s) ][ GZIP on ]