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 Mon 15 Jul 2019, 13:53
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
How to compile a kernel module?
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [9 Posts]  
Author Message
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 12:01    Post subject:  How to compile a kernel module?  

I need to start somewhere on a fairly mysterious and complex topic.

#1. I just need to recompile a single kernel module for Linux.

#2. I have all the source files I need and there is a Makefile and KConfig files in the directory.

#3. If I go to that directory and type the command: make thefile.ko, I get an error:

make: *** No rule to make target 'thefile.ko'. Stop.

So then there is no real recipes in there to convert .c/.asm files into their .o or .ko counterparts. Firstly, why? And secondly, what needs to be done to get those rules in there?

If there is a document or readme that describes this, please point me to it. But numerous Linux distros have this style of make and the files are quite similar.

Any help appreciated.
Smile
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 12:51    Post subject: I'm starting to understand
Subject description: I found the rules file in a directory above where my driver is
 

I have now found the build flags in the directory a few above my drivers, in the 3.10.0-327.el7.x86_64 direcdtory.

It starts with VERSION = 3
PATCHLEVE = 10, etc..

So perhaps I just need to navigate to that directory and run the make.
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 13:04    Post subject: I am geting some info from the make help command
Subject description: This lists different ways of making
 

I'll try to descend into the directory by specifying it.

If I run the command make help, it gives a recipe for how to navigate to a directory in the make, as in make dir/....
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 13:13    Post subject: It doesn't work
Subject description: When I run the command:
 

make /pathtomydrive/mydriver.ko, I get an error

make[1]: *** NO rule to make target /usr/src/kernels/3.10.0-327.el7.x86_64/arch/x86/syscalls/syscall_32.tbl', needed by etc..

It doesn't behave the way the help file makes it seem.
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 13:44    Post subject: Someone posted Hans Reenickec's rpm file
Subject description: So I'll try that for now
 

Let's hope
Back to top
View user's profile Send private message 
Keef


Joined: 20 Dec 2007
Posts: 965
Location: Staffordshire

PostPosted: Mon 10 Jul 2017, 14:45    Post subject:  

You just need to type 'make' on its own. It will be (should be) in the right place to find the source files.
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 16:16    Post subject: I have the rpm files installed now
Subject description: The driver is up and running
 

So far no matter what I type, it errors out on arch/x86 directory. I have only one direcxtory populated iwth source code, the aic7xxx. All others are empty, othe than having the source files. But for now, I'll use the driver someone found for me. It seems to be working. I just cannot find a way to get power to the tape drive. I can't find any cables that reach and I don't have connectors so I'm scrounging right now.

Keef wrote:
You just need to type 'make' on its own. It will be (should be) in the right place to find the source files.
Back to top
View user's profile Send private message 
PappyPuppy

Joined: 30 Sep 2016
Posts: 409

PostPosted: Mon 10 Jul 2017, 19:46    Post subject: I scrounged up some power from an old PC/coffee table
Subject description: She's up and running
 

So I can delay any driver work now that my machine has detected the tape drive.
Back to top
View user's profile Send private message 
Sailor Enceladus

Joined: 22 Feb 2016
Posts: 1558

PostPosted: Tue 11 Jul 2017, 15:15    Post subject:  

Since this seems to be a general "how do you compile a kernel module" thread, here is how peebee compiled the broadcom_wl driver:
http://www.murga-linux.com/puppy/viewtopic.php?p=884946#884946
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [9 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
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.0513s ][ Queries: 12 (0.0214s) ][ GZIP on ]